]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-6354 --resolve, add realm to sofia::expires event
authorBrian West <brian@freeswitch.org>
Thu, 13 Mar 2014 16:13:06 +0000 (11:13 -0500)
committerBrian West <brian@freeswitch.org>
Thu, 13 Mar 2014 16:13:10 +0000 (11:13 -0500)
src/mod/endpoints/mod_sofia/sofia_reg.c

index 40edaf14640e0a54d65c0def845d4bd36a5f4c48..5bb86ba3bc3a20faa99c3c85bc7e920a698c580e 100644 (file)
@@ -671,6 +671,7 @@ int sofia_reg_del_callback(void *pArg, int argc, char **argv, char **columnNames
                        switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "contact", argv[3]);
                        switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "expires", argv[6]);
                        switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "user-agent", argv[7]);
+                       switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "realm", argv[14]);
                        sofia_event_fire(profile, &s_event);
                }
 
@@ -724,7 +725,7 @@ void sofia_reg_expire_call_id(sofia_profile_t *profile, const char *call_id, int
 
        sql = switch_mprintf("select call_id,sip_user,sip_host,contact,status,rpid,expires"
                                                 ",user_agent,server_user,server_host,profile_name,network_ip,network_port"
-                                                ",%d from sip_registrations where call_id='%q' %s", reboot, call_id, sqlextra);
+                                                ",%d,sip_realm from sip_registrations where call_id='%q' %s", reboot, call_id, sqlextra);
 
 
        sofia_glue_execute_sql_callback(profile, profile->dbh_mutex, sql, sofia_reg_del_callback, profile);
@@ -746,10 +747,10 @@ void sofia_reg_check_expire(sofia_profile_t *profile, time_t now, int reboot)
        if (now) {
                sql = switch_mprintf("select call_id,sip_user,sip_host,contact,status,rpid,expires"
                                                ",user_agent,server_user,server_host,profile_name,network_ip, network_port"
-                                               ",%d from sip_registrations where expires > 0 and expires <= %ld", reboot, (long) now);
+                                               ",%d,sip_realm from sip_registrations where expires > 0 and expires <= %ld", reboot, (long) now);
        } else {
                sql = switch_mprintf("select call_id,sip_user,sip_host,contact,status,rpid,expires"
-                                               ",user_agent,server_user,server_host,profile_name,network_ip, network_port" ",%d from sip_registrations where expires > 0", reboot);
+                                               ",user_agent,server_user,server_host,profile_name,network_ip, network_port" ",%d,sip_realm from sip_registrations where expires > 0", reboot);
        }
 
        sofia_glue_execute_sql_callback(profile, profile->dbh_mutex, sql, sofia_reg_del_callback, profile);
@@ -897,7 +898,7 @@ void sofia_reg_check_sync(sofia_profile_t *profile)
        char *sql;
 
        sql = switch_mprintf("select call_id,sip_user,sip_host,contact,status,rpid,expires"
-                                       ",user_agent,server_user,server_host,profile_name,network_ip,network_port
+                                       ",user_agent,server_user,server_host,profile_name,network_ip,network_port,0,sip_realm"
                                        " from sip_registrations where expires > 0");