[Freeswitch-dev] mod_sofia hold/unhold issue correction problems

Michael Jerris mike at jerris.com
Mon Jul 24 16:18:40 UTC 2017


sofia is doing the right thing.. sendrecv is the default state if not otherwise stated in the packet and is not necessary to send there.  the receiving device is broken if its not taking off hold there.


> On Jul 24, 2017, at 5:18 AM, Dmitriy Borisov <borik.internet at gmail.com> wrote:
> 
> Hello!
> 
> There are some issue (or not???) in mod_sofia module.
> 
> You can reproduce this issue by holding call via 0.0.0.0 SDP:
> v=0
> o=OneXS 99765105 2 IN IP4 87.237.24.14
> s=-
> c=IN IP4 0.0.0.0
> t=0 0
> m=audio 49760 RTP/AVP 8 101
> a=fmtp:101 0-15
> a=rtpmap:101 telephone-event/8000
> a=inactive
> 
> and unholding via invite without SDP. 
> 
> In version 7a77e0b (branch v1.6) place of errorneus (as I think) code is near:
>  7641             if (switch_channel_var_true(channel, "sip_unhold_nosdp")) {
>  7642                 switch_core_media_gen_local_sdp(session, SDP_TYPE_RESPONSE, NULL, 0, "sendrecv",
>  7643                                                 zstr(tech_pvt->mparams.local_sdp_str) || !switch_channel_test_flag(channel, CF_PROXY_MODE));
>  7644             } else {
>  7645                 switch_core_media_gen_local_sdp(session, SDP_TYPE_RESPONSE, NULL, 0, NULL,
>  7646                                             zstr(tech_pvt->mparams.local_sdp_str) || !switch_channel_test_flag(channel, CF_PROXY_MODE));
>  7647             }
>  7648
>  7649             if (zstr(tech_pvt->mparams.local_sdp_str)) {
>  7650                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Cannot find a SDP\n");
>  7651                 switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
>  7652             } else {
>  7653                 if (sofia_use_soa(tech_pvt)) {
>  7654                 switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, tech_pvt->mparams.local_sdp_str); // This is my add
>  7655                     nua_respond(tech_pvt->nh, SIP_200_OK,
>  7656                                 SIPTAG_CONTACT_STR(tech_pvt->reply_contact),
>  7657                                 SOATAG_USER_SDP_STR(tech_pvt->mparams.local_sdp_str),
>  7658                                 SOATAG_REUSE_REJECTED(1),
>  7659                                 SOATAG_AUDIO_AUX("cn telephone-event"),
>  7660                                 TAG_IF(sofia_test_pflag(profile, PFLAG_DISABLE_100REL), NUTAG_INCLUDE_EXTRA_SDP(1)), TAG_END());
>  7661                 } else {
>  7662                     nua_respond(tech_pvt->nh, SIP_200_OK,
>  7663                                 NUTAG_MEDIA_ENABLE(0),
>  7664                                 SIPTAG_CONTACT_STR(tech_pvt->reply_contact),
>  7665                                 SIPTAG_CONTENT_TYPE_STR("application/sdp"), SIPTAG_PAYLOAD_STR(tech_pvt->mparams.local_sdp_str), TAG_END());
>  7666                 }
>  7667             }
> 
> 
> In described situation code flow go throw line 7654 and post to nua_respond correct SDP (with correct c=IN IP4 re.al.ip.addr and a=sendrecv):
> 2017-07-24 11:00:54.252668 [WARNING] sofia.c:7654 v=0
> o=Sipean 1500875192 1500875195 IN IP4 x.x.x.x:
> s=Sipean
> c=IN IP4 x.x.x.x
> t=0 0
> m=audio 11642 RTP/AVP 8 101
> a=rtpmap:8 PCMA/8000
> a=rtpmap:101 telephone-event/8000
> a=fmtp:101 0-16
> a=ptime:20
> a=sendrecv
> 
> sofia library sends SDP:
> v=0
> o=Sipean 1500875192 1500875195 IN IP4 x.x.x.x
> s=Sipean
> c=IN IP4 x.x.x.x
> t=0 0
> m=audio 11642 RTP/AVP 8 101
> a=rtpmap:8 PCMA/8000
> a=rtpmap:101 telephone-event/8000
> a=fmtp:101 0-16
> a=ptime:20 
> 
> On SIP client side call in unholded state, but at FreeSWITCH side it is still in HOLDED state
> 
> I have experimented with nua_respond, but maximum result is a correct call state on SIP client side (holded), but not unholding the line. Where should I search for errors? Or this scenario can't work correct?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-dev/attachments/20170724/a73f4a60/attachment-0001.html>


More information about the FreeSWITCH-dev mailing list