]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
skip update when val has not changed
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 11 Dec 2009 22:38:48 +0000 (22:38 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 11 Dec 2009 22:38:48 +0000 (22:38 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15924 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/sofia.c

index 1c55b657023b01db03fcfc0fcda3569bd3d4bf92..e2dc63fa6b5fc56f7168e21d94a9bf8db1e26dc5 100644 (file)
@@ -500,11 +500,15 @@ void sofia_update_callee_id(switch_core_session_t *session, sofia_profile_t *pro
        
        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);
        }