[sr-dev] git:admorten/sca: modules/sca: fall back to tag lookup if lookup by index fails.

Andrew Mortensen admorten at isc.upenn.edu
Thu Apr 18 19:54:32 CEST 2013


Module: sip-router
Branch: admorten/sca
Commit: fa88b50146eff23dd4c8d40018b7722889f80010
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=fa88b50146eff23dd4c8d40018b7722889f80010

Author: Andrew Mortensen <admorten at isc.upenn.edu>
Committer: Andrew Mortensen <admorten at isc.upenn.edu>
Date:   Thu Apr 18 13:52:10 2013 -0400

modules/sca: fall back to tag lookup if lookup by index fails.

- Fix appearance tracking for SCA implementations with inconsistent
  Call-Info header inclusion.

---

 modules/sca/sca_appearance.c |    4 ++++
 modules/sca/sca_call_info.c  |    6 ++++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/modules/sca/sca_appearance.c b/modules/sca/sca_appearance.c
index dea9ab4..054f281 100644
--- a/modules/sca/sca_appearance.c
+++ b/modules/sca/sca_appearance.c
@@ -897,6 +897,10 @@ sca_appearance_update_index( sca_mod *scam, str *aor, int idx,
     for ( app = app_list->appearances; app != NULL; app = app->next ) {
 	if ( app->index == idx ) {
 	    break;
+	} else if ( idx == 0 ) {
+	    if ( SCA_STR_EQ( &dialog->id, &app->dialog.id )) {
+		break;
+	    }
 	}
     }
     if ( app == NULL ) {
diff --git a/modules/sca/sca_call_info.c b/modules/sca/sca_call_info.c
index 594bcfc..f7f393d 100644
--- a/modules/sca/sca_call_info.c
+++ b/modules/sca/sca_call_info.c
@@ -776,6 +776,12 @@ sca_call_info_uri_update( str *aor, sca_call_info *call_info,
 
     app = sca_appearance_for_index_unsafe( sca, aor, call_info->index,
 						slot_idx );
+    if ( app == NULL ) {
+	LM_WARN( "sca_call_info_uri_update: no appearance found for %.*s "
+		 "index %d, looking up by dialog...", STR_FMT( aor ),
+		 call_info->index );
+	app = sca_appearance_for_dialog_unsafe( sca, aor, &dialog, slot_idx );
+    }
     if ( app != NULL ) {
 	LM_DBG( "sca_call_info_uri_update: setting owner to %.*s",
 		STR_FMT( contact_uri ));




More information about the sr-dev mailing list