Module: sip-router Branch: admorten/sca Commit: 6071ddce7f1922d3df79a0e6d34ef44e187d93b6 URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=6071ddce...
Author: Andrew Mortensen admorten@isc.upenn.edu Committer: Andrew Mortensen admorten@isc.upenn.edu Date: Mon Apr 15 20:09:01 2013 -0400
modules/sca: only check if callee is SCA if callee_aor has a value.
---
modules/sca/sca_call_info.c | 40 ++++++++++++++++++++++------------------ 1 files changed, 22 insertions(+), 18 deletions(-)
diff --git a/modules/sca/sca_call_info.c b/modules/sca/sca_call_info.c index 6766553..594bcfc 100644 --- a/modules/sca/sca_call_info.c +++ b/modules/sca/sca_call_info.c @@ -700,27 +700,31 @@ sca_call_info_seize_held_call( sip_msg_t *msg, sca_call_info *call_info, sca_hash_table_unlock_index( sca->appearances, slot_idx ); slot_idx = -1;
- if ( sca_uri_lock_if_shared_appearance( sca, &callee_aor, &slot_idx )) { - app = sca_appearance_for_tags_unsafe( sca, &callee_aor, - &prev_callid, &prev_totag, NULL, slot_idx ); - if ( app == NULL ) { - LM_ERR( "sca_call_info_seize_held_call: failed to find " - "appearance of %.*s with dialog %.*s;%.*s", - STR_FMT( &callee_aor ), STR_FMT( &prev_callid ), - STR_FMT( &prev_totag )); - goto done; - } + if ( callee_aor.s != NULL && callee_aor.len > 0 ) { + if ( sca_uri_lock_if_shared_appearance( sca, &callee_aor, &slot_idx )) { + app = sca_appearance_for_tags_unsafe( sca, &callee_aor, + &prev_callid, &prev_totag, NULL, slot_idx ); + if ( app == NULL ) { + LM_ERR( "sca_call_info_seize_held_call: failed to find " + "appearance of %.*s with dialog %.*s;%.*s", + STR_FMT( &callee_aor ), STR_FMT( &prev_callid ), + STR_FMT( &prev_totag )); + goto done; + }
- app->flags |= SCA_APPEARANCE_FLAG_CALLEE_PENDING; + app->flags |= SCA_APPEARANCE_FLAG_CALLEE_PENDING;
- if ( sca_appearance_update_callee_unsafe( app, contact_uri ) < 0 ) { - LM_ERR( "sca_call_info_seize_held_call: failed to update callee" ); - goto done; - } - if ( sca_appearance_update_dialog_unsafe( app, &msg->callid->body, + if ( sca_appearance_update_callee_unsafe( app, contact_uri ) < 0 ) { + LM_ERR( "sca_call_info_seize_held_call: " + "failed to update callee" ); + goto done; + } + if ( sca_appearance_update_dialog_unsafe( app, &msg->callid->body, &to->tag_value, &from->tag_value ) < 0 ) { - LM_ERR( "sca_call_info_seize_held_call: failed to update dialog" ); - goto done; + LM_ERR( "sca_call_info_seize_held_call: " + "failed to update dialog" ); + goto done; + } } }