diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 375ced0971..4b01b682c6 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -430,6 +430,7 @@ void sofia_event_callback(nua_event_t event, case nua_i_fork: case nua_r_info: case nua_r_bye: + case nua_r_unregister: case nua_r_unsubscribe: case nua_r_publish: case nua_i_cancel: @@ -464,7 +465,6 @@ void sofia_event_callback(nua_event_t event, sofia_handle_sip_i_notify(session, status, phrase, nua, profile, nh, sofia_private, sip, tags); break; case nua_r_register: - case nua_r_unregister: sofia_reg_handle_sip_r_register(status, phrase, nua, profile, nh, sofia_private, sip, tags); break; case nua_i_options: diff --git a/src/mod/endpoints/mod_sofia/sofia_reg.c b/src/mod/endpoints/mod_sofia/sofia_reg.c index 9152dbf049..b43a930ca4 100644 --- a/src/mod/endpoints/mod_sofia/sofia_reg.c +++ b/src/mod/endpoints/mod_sofia/sofia_reg.c @@ -50,10 +50,8 @@ static void sofia_reg_new_handle(sofia_gateway_t *gateway_ptr, int attach) gateway_ptr->nh = nua_handle(gateway_ptr->profile->nua, NULL, SIPTAG_CALL_ID_STR(gateway_ptr->uuid_str), - NUTAG_URL(gateway_ptr->register_proxy), SIPTAG_TO_STR(gateway_ptr->register_to), NUTAG_CALLSTATE_REF(ss_state), SIPTAG_FROM_STR(gateway_ptr->register_from), TAG_END()); - if (attach) { if (!gateway_ptr->sofia_private) { gateway_ptr->sofia_private = malloc(sizeof(*gateway_ptr->sofia_private)); @@ -77,12 +75,9 @@ static void sofia_reg_kill_reg(sofia_gateway_t *gateway_ptr) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "UN-Registering %s\n", gateway_ptr->name); nua_unregister(gateway_ptr->nh, NUTAG_URL(gateway_ptr->register_url), - SIPTAG_FROM_STR(gateway_ptr->register_from), - SIPTAG_TO_STR(gateway_ptr->register_from), SIPTAG_CONTACT_STR(gateway_ptr->register_contact), - SIPTAG_EXPIRES_STR("0"), - NUTAG_REGISTRAR(gateway_ptr->register_proxy), - NUTAG_OUTBOUND("no-options-keepalive"), NUTAG_OUTBOUND("no-validate"), NUTAG_KEEPALIVE(0), TAG_NULL()); + NUTAG_REGISTRAR(gateway_ptr->register_proxy), + TAG_END()); } }