diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.c b/src/mod/endpoints/mod_sofia/mod_sofia.c index e697eb66b5..908b82817b 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.c +++ b/src/mod/endpoints/mod_sofia/mod_sofia.c @@ -285,7 +285,7 @@ switch_status_t sofia_on_hangup(switch_core_session_t *session) if (switch_test_flag(tech_pvt, TFLAG_ANS)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Sending BYE to %s\n", switch_channel_get_name(channel)); - nua_bye(tech_pvt->nh, SIPTAG_RECORD_ROUTE_STR(tech_pvt->record_route), SIPTAG_REASON_STR(reason), TAG_END()); + nua_bye(tech_pvt->nh, SIPTAG_REASON_STR(reason), TAG_END()); } else { if (switch_test_flag(tech_pvt, TFLAG_OUTBOUND)) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Sending CANCEL to %s\n", switch_channel_get_name(channel)); @@ -386,9 +386,7 @@ static switch_status_t sofia_answer_channel(switch_core_session_t *session) } } - printf("XXXXXXXXXXXXXXXXXXXXXXXXWTF [%s]\n", tech_pvt->record_route); nua_respond(tech_pvt->nh, SIP_200_OK, - SIPTAG_RECORD_ROUTE_STR(tech_pvt->record_route), NUTAG_AUTOANSWER(0), NUTAG_SESSION_TIMER(session_timeout), SIPTAG_CONTACT_STR(tech_pvt->reply_contact), diff --git a/src/mod/endpoints/mod_sofia/mod_sofia.h b/src/mod/endpoints/mod_sofia/mod_sofia.h index 7cd5c3e02f..fe9b0c393c 100644 --- a/src/mod/endpoints/mod_sofia/mod_sofia.h +++ b/src/mod/endpoints/mod_sofia/mod_sofia.h @@ -381,7 +381,6 @@ struct private_object { char *gateway_name; char *local_crypto_key; char *remote_crypto_key; - char *record_route; int crypto_tag; unsigned char local_raw_key[SWITCH_RTP_MAX_CRYPTO_LEN]; unsigned char remote_raw_key[SWITCH_RTP_MAX_CRYPTO_LEN]; @@ -422,8 +421,6 @@ struct private_object { uint32_t video_count; sofia_dtmf_t dtmf_type; int q850_cause; - char *remote_ip; - int remote_port; }; struct callback_t { diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 6e1d76221f..eb2e21a6c6 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -2586,7 +2586,7 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_ uint32_t sess_max = switch_core_session_limit(0); int is_auth = 0, calling_myself = 0; su_addrinfo_t *my_addrinfo = msg_addrinfo(nua_current_request(nua)); - int network_port = 0; + if (sess_count >= sess_max || !(profile->pflags & PFLAG_RUNNING)) { nua_respond(nh, 503, "Maximum Calls In Progress", SIPTAG_RETRY_AFTER_STR("300"), TAG_END()); @@ -2601,7 +2601,6 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_ get_addr(network_ip, sizeof(network_ip), &((struct sockaddr_in *) my_addrinfo->ai_addr)->sin_addr); - network_port = ntohs(((struct sockaddr_in *) msg_addrinfo(nua_current_request(nua))->ai_addr)->sin_port); if (profile->acl_count) { uint32_t x = 0; @@ -2650,17 +2649,6 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_ } switch_mutex_init(&tech_pvt->flag_mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(session)); - tech_pvt->remote_ip = switch_core_session_strdup(session, network_ip); - tech_pvt->remote_port = network_port; - - if (sip->sip_contact && sip->sip_contact->m_url) { - tech_pvt->record_route = switch_core_session_sprintf(session, "", - sip->sip_contact->m_url->url_user, - tech_pvt->remote_ip, - tech_pvt->remote_port); - } - - if (*key != '\0') { tech_pvt->key = switch_core_session_strdup(session, key); }