signalwire / freeswitch

FreeSWITCH is a Software Defined Telecom Stack enabling the digital transformation from proprietary telecom switches to a versatile software implementation that runs on any commodity hardware. From a Raspberry PI to a multi-core server, FreeSWITCH can unlock the telecommunications potential of any device.
https://freeswitch.com/#getting-started
Other
3.62k stars 1.43k forks source link

opus codec negotiation issues? #837

Open ldzetekoff opened 4 years ago

ldzetekoff commented 4 years ago

What I have found is interesting and it follows through on hard phones or other soft phones.

Extension on PBX is forced to opus

image

  1. my sip client (either zoiper or my grandstreams as well as the JS client we're developing) originating a call works as expected opus/8000 selected.
  2. with an inbound call to my extension, the PBX doesn't seem to be offering opus/8000 to the client so if the client only has opus/8000, zoiper gets this error

image

if the client has other codecs enabled, it will go to the next one (i.e. g.729).

Here is a zoiper log and comment from them:

`Code: Here is a different invite from the second(smaller) log called "logfile_2020-08-11_15-00-54.txt

received: INVITE sip:1522@70.44.10.180:65030;transport=TLS;rinstance=9523c47ca7247807 SIP/2.0 Via: SIP/2.0/TLS 206.189.77.7:5061;rport;branch=z9hG4bKy0Be2aHXX42Sj Max-Forwards: 68 Route: sip:1522@70.44.10.180:65030;transport=TLS;rinstance=9523c47ca7247807 Contact: sip:mod_sofia@206.189.77.7:5061;transport=tls To: sip:1522@70.44.10.180:65030;transport=TLS;rinstance=9523c47ca7247807 From: "BACKWOODS WIREL" sip:4847658051@myis.pbxhostingnow.com;tag=aSN78DU6a0vKQ Call-ID: e8a07cde-56a7-1239-5cb5-124260aa133a CSeq: 24032453 INVITE Session-Expires: 120;refresher=uac Min-SE: 120 Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE Content-Disposition: session Content-Type: application/sdp Supported: timer, path, replaces User-Agent: FreeSWITCH Allow-Events: talk, hold, conference, presence, as-feature-event, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer Remote-Party-ID: "BACKWOODS WIREL" sip:4847658051@myis.pbxhostingnow.com;party=calling;screen=yes;privacy=off X-FS-Support: update_display,send_info Content-Length: 625

v=0 o=FreeSWITCH 1597155126 1597155127 IN IP4 206.189.77.7 s=FreeSWITCH c=IN IP4 206.189.77.7 t=0 0 m=audio 17364 RTP/AVP 0 18 8 3 101 13 a=rtpmap:0 PCMU/8000 a=rtpmap:18 G729/8000 a=fmtp:18 annexb=no a=rtpmap:8 PCMA/8000 a=rtpmap:3 GSM/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16 a=rtpmap:13 CN/8000 a=ptime:20 m=video 22002 RTP/AVP 102 103 b=AS:1024 a=rtpmap:102 H264/90000 a=rtpmap:103 VP8/90000 a=inactive a=rtcp-fb:102 ccm fir a=rtcp-fb:102 ccm tmmbr a=rtcp-fb:102 nack a=rtcp-fb:102 nack pli a=rtcp-fb:103 ccm fir a=rtcp-fb:103 ccm tmmbr a=rtcp-fb:103 nack a=rtcp-fb:103 nack pli

Again, I cannot see Opus being sent from the server, the invite again has "a=inactive" for media state.`

Here's another log and their comments:

``Code: In the logs I can see the following INVITE coming from your server:

INVITE sip:1522@70.44.10.180:54512;transport=TLS;rinstance=54dcaf3a8bb7758c SIP/2.0 Via: SIP/2.0/TLS 206.189.77.7:5061;rport=5061;branch=z9hG4bKXyH6DvXFS7a3S Max-Forwards: 68 Route: sip:1522@70.44.10.180:54512;transport=TLS;rinstance=54dcaf3a8bb7758c Contact: sip:mod_sofia@206.189.77.7:5061;transport=tls To: sip:1522@70.44.10.180:54512;transport=TLS;rinstance=54dcaf3a8bb7758c From: "BACKWOODS WIREL" sip:4847658051@myis.pbxhostingnow.com;tag=FevDr37yrNK3p Call-ID: 8c6c01ae-56a8-1239-5cb5-124260aa133a CSeq: 24032590 INVITE Session-Expires: 120;refresher=uac Min-SE: 120 Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE Content-Disposition: session Content-Type: application/sdp Supported: timer, path, replaces User-Agent: FreeSWITCH Allow-Events: talk, hold, conference, presence, as-feature-event, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer Remote-Party-ID: "BACKWOODS WIREL" sip:4847658051@myis.pbxhostingnow.com;party=calling;screen=yes;privacy=off X-FS-Support: update_display,send_info Content-Length: 625

v=0 o=FreeSWITCH 1597153093 1597153094 IN IP4 206.189.77.7 s=FreeSWITCH c=IN IP4 206.189.77.7 t=0 0 m=audio 19672 RTP/AVP 0 18 8 3 101 13 a=rtpmap:0 PCMU/8000 a=rtpmap:18 G729/8000 a=fmtp:18 annexb=no a=rtpmap:8 PCMA/8000 a=rtpmap:3 GSM/8000 a=rtpmap:101 telephone-event/8000 a=fmtp:101 0-16 a=rtpmap:13 CN/8000 a=ptime:20 m=video 32262 RTP/AVP 102 103 b=AS:1024 a=rtpmap:102 H264/90000 a=rtpmap:103 VP8/90000 a=inactive a=rtcp-fb:102 ccm fir a=rtcp-fb:102 ccm tmmbr a=rtcp-fb:102 nack a=rtcp-fb:102 nack pli a=rtcp-fb:103 ccm fir a=rtcp-fb:103 ccm tmmbr a=rtcp-fb:103 nack a=rtcp-fb:103 nack pli

As you can see on the INVITE above, OPUS is missing as media suggestion and actually the server is sending a video call for some reason with call state "On hold"

In this case there are few issues, if you have left only Opus on Zoiper as available codec, there is no codec to be matched since your server is not proposing Opus at all.

The second issue is that the call is being sent "On hold", which is not supported for initial INVITE in Zoiper. It can be sent as a re-INVITE, but not as initial invite.`

I'm confused as to why the PBX is NOT offering opus on ringing the extension. What am I missing? I'd like to solve this so we can move forward.

Many thanks Leon

image

dragos-oancea commented 4 years ago

It looks like a configuration issue which has nothing to do with the codec negotiation code in FS.

ldzetekoff commented 4 years ago

Ok configuration where? Multiple clients do this.

Thanks leon

dragos-oancea commented 4 years ago

I am not familiar with fusionpbx , but it may have its own dialplan and custom vars.xml .

you should try to originate calls from fs_cli and see if the calls have Opus. If they don't, see if Opus is in absolute_codec_string in vars.xml .

ldzetekoff commented 4 years ago

Hi Dragos....thanks for getting back to me.

Fusion as you probably know is a GUI for FS. They referred us to you guys :-)

the calls do have opus. I have the absolute codec set for the extension. Its only one way I forget if its inbound or outbound that things don't work as expected.

Thanks leon

PS: What other info can I provide or how would you configure things based on what we need OPUS/8000 or GSM for extensions.

On 9/2/2020 10:07 AM, Dragos Oancea wrote:

I am not familiar with fusionpbx , but it may have its own dialplan and custom vars.xml .

you should try to originate calls from fs_cli and see if the calls have Opus. If they don't, see if Opus is in absolute_codec_string in vars.xml .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/signalwire/freeswitch/issues/837#issuecomment-685760621, or unsubscribe https://github.com/notifications/unsubscribe-auth/AL5FT6LSAHLMZFLOK25D4S3SDZGQVANCNFSM4QQ2CZNQ.

dragos-oancea commented 4 years ago

without FS logs in DEBUG mode there is not much to say. And you gotta make sure you go through the expected dialplan rules when dialing in and out.