Просмотр исходного кода

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

- Fix appearance tracking for SCA implementations with inconsistent
  Call-Info header inclusion.
Andrew Mortensen 12 лет назад
Родитель
Сommit
2e0af20cd7
2 измененных файлов с 10 добавлено и 0 удалено
  1. 4 0
      modules/sca/sca_appearance.c
  2. 6 0
      modules/sca/sca_call_info.c

+ 4 - 0
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 ) {

+ 6 - 0
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 ));