From 7a6e8f4672fa4d788490cfdaeb6cb1d400704a10 Mon Sep 17 00:00:00 2001 From: Brian West Date: Thu, 13 Mar 2014 11:13:06 -0500 Subject: [PATCH] FS-6354 --resolve, add realm to sofia::expires event --- src/mod/endpoints/mod_sofia/sofia_reg.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c index 40edaf1464..5bb86ba3bc 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -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");