Merge pull request #928 in FS/freeswitch from ~ANTONIO/freeswitch-fs-9398:master to master

* commit '9cd2dbbddb9afb59037704739e206e30b4ac1cb6':
  FS-9398 solve missing variables in sofia events expire and unregister
This commit is contained in:
Mike Jerris 2016-09-02 13:11:53 -05:00
commit 346a60ed3d
1 changed files with 7 additions and 2 deletions

View File

@ -717,6 +717,8 @@ int sofia_reg_del_callback(void *pArg, int argc, char **argv, char **columnNames
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]);
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "network-ip", argv[11]);
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "network-port", argv[12]);
sofia_event_fire(profile, &s_event);
}
@ -1332,6 +1334,8 @@ uint8_t sofia_reg_handle_register_token(nua_t *nua, sofia_profile_t *profile, nu
contact = sip->sip_contact;
to = sip->sip_to;
from = sip->sip_from;
call_id = sip->sip_call_id->i_id;
switch_assert(call_id);
if (sip->sip_user_agent) {
agent = sip->sip_user_agent->g_string;
@ -1853,8 +1857,6 @@ uint8_t sofia_reg_handle_register_token(nua_t *nua, sofia_profile_t *profile, nu
switch_goto_int(r, 0, end);
}
call_id = sip->sip_call_id->i_id;
switch_assert(call_id);
/* Does this profile supports multiple registrations ? */
multi_reg = (sofia_test_pflag(profile, PFLAG_MULTIREG)) ? 1 : 0;
@ -2159,6 +2161,9 @@ uint8_t sofia_reg_handle_register_token(nua_t *nua, sofia_profile_t *profile, nu
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "call-id", call_id);
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "rpid", rpid);
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "realm", realm);
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "network-ip", network_ip);
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "network-port", network_port_c);
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "user-agent", agent);
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "expires", "%ld", (long) exptime);
}
}