Merge pull request #1500 in FS/freeswitch from ~HUNYI/freeswitch:feature/FS-8893-add-variables-to-sofia-register-unregister to master
* commit 'bec68edb16b795bed0dbdd95a09999eb4850d82e': FS-8893: [mod_sofia] Add variables to sofia::register/unregister events
This commit is contained in:
commit
0b97c68f3d
|
@ -1571,6 +1571,7 @@ 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, "username", username);
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "realm", realm);
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "user-agent", agent);
|
||||
|
||||
switch (auth_res) {
|
||||
case AUTH_OK:
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "auth-result", "SUCCESS");
|
||||
|
@ -2022,6 +2023,9 @@ uint8_t sofia_reg_handle_register_token(nua_t *nua, sofia_profile_t *profile, nu
|
|||
if (update_registration) {
|
||||
switch_event_add_header_string(s_event, SWITCH_STACK_BOTTOM, "update-reg", "true");
|
||||
}
|
||||
if (v_event && *v_event) {
|
||||
switch_event_merge(s_event, *v_event);
|
||||
}
|
||||
switch_event_fire(&s_event);
|
||||
}
|
||||
|
||||
|
@ -2166,6 +2170,11 @@ 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, "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);
|
||||
|
||||
if (v_event && *v_event) {
|
||||
switch_event_merge(s_event, *v_event);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue