Revision
15924
Author
anthm
Date
2009-12-11 16:38:48 -0600 (Fri, 11 Dec 2009)

Log Message

skip update when val has not changed

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (15923 => 15924)


--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	2009-12-11 22:21:29 UTC (rev 15923)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	2009-12-11 22:38:48 UTC (rev 15924)
@@ -500,11 +500,15 @@
 	
 	caller_profile = switch_channel_get_caller_profile(channel);
 
-	caller_profile->callee_id_name = switch_sanitize_number(switch_core_strdup(caller_profile->pool, name));
-	caller_profile->callee_id_number = switch_sanitize_number(switch_core_strdup(caller_profile->pool, number));
+	if (!strcmp(caller_profile->callee_id_name, name) && !strcmp(caller_profile->callee_id_number, number)) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG1, "Same Callee ID \"%s\" <%s>\n", name, number);
+		send = 0;
+	} else {
+		caller_profile->callee_id_name = switch_sanitize_number(switch_core_strdup(caller_profile->pool, name));
+		caller_profile->callee_id_number = switch_sanitize_number(switch_core_strdup(caller_profile->pool, number));
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Update Callee ID to \"%s\" <%s>\n", name, number);
+	}
 
-	switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Update Callee ID to \"%s\" <%s>\n", name, number);
-	
 	if (send) {
 		sofia_send_callee_id(session, NULL, NULL);
 	}