From bec68edb16b795bed0dbdd95a09999eb4850d82e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hunyadv=C3=A1ri=20P=C3=A9ter?= Date: Tue, 3 Apr 2018 10:42:04 +0200 Subject: [PATCH] FS-8893: [mod_sofia] Add variables to sofia::register/unregister events --- src/mod/endpoints/mod_sofia/sofia_reg.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c index 4dd30ddb67..847411ab5a 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -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); + } + } } }