VoIP Mailing List Archives
Mailing list archives for the VoIP community |
|
View previous topic :: View next topic |
Author |
Message |
clive at lansink.co.nz Guest
|
Posted: Sat Oct 23, 2021 8:44 pm Post subject: [Freeswitch-users] PortAudio and codecs |
|
|
Hi everyone.
I need help please to make a call using PortAudio which is failing at the CODEC negotiation step. I've done this successfully in the past but that was a number of Freeswitch versions ago and on a different laptop and something may have changed.
I have a recent installation of Freeswitch on a laptop with PortAudio enabled. It registers to our main box running Freeswitch (though a rather older version) which in turn registers to our VOIP provider. When I call a number with the api pa call command, it appears to be successful but nothing happens.
Freeswitch.log on the main box shows the following lines that may explain the problem:
a13d9197-2a00-4858-92d4-5aed6dc7652d 2021-10-24 13:46:23.400156 [ERR] mod_sofia.c:2247 CODEC NEGOTIATION ERROR. SDP:
a13d9197-2a00-4858-92d4-5aed6dc7652d v=0
a13d9197-2a00-4858-92d4-5aed6dc7652d o=FreeSWITCH 1635011588 1635011589 IN IP4 192.168.1.90
a13d9197-2a00-4858-92d4-5aed6dc7652d s=FreeSWITCH
a13d9197-2a00-4858-92d4-5aed6dc7652d c=IN IP4 192.168.1.90
a13d9197-2a00-4858-92d4-5aed6dc7652d t=0 0
a13d9197-2a00-4858-92d4-5aed6dc7652d m=audio 24794 RTP/AVP 102 101
a13d9197-2a00-4858-92d4-5aed6dc7652d a=rtpmap:102 L16/16000
a13d9197-2a00-4858-92d4-5aed6dc7652d a=rtpmap:101 telephone-event/16000
a13d9197-2a00-4858-92d4-5aed6dc7652d a=fmtp:101 0-16
a13d9197-2a00-4858-92d4-5aed6dc7652d a=ptime:20
a13d9197-2a00-4858-92d4-5aed6dc7652d
a13d9197-2a00-4858-92d4-5aed6dc7652d 2021-10-24 13:46:23.400156 [NOTICE] switch_channel.c:3438 Hangup sofia/internal/1015@192.168.1.61 [CS_EXECUTE] [INCOMPATIBLE_DESTINATION]
I know nothing about SDP but when I look at this it kind of suggests to me that the originating machine is only offering L16/16000 as the CODEC to use. If that is the case then that is the problem because I'm pretty sure the main Freeswitch box is not set up to accept that codec.
Back to the laptop, in SIP profiles external.xml, outbound-codec-prefs is set to "$${outbound_codec_prefs}". In vars.xml, outbound_codec_prefs is set to PCMU,PCMA,GSM. I think when it makes the call it should be offering these codecs which are all acceptable to the main Freeswitch box. But then I would expect to see that in the SDP stuff in the log. It should mean the laptop would transcode from the raw PCM data from PortAudio to the codec agreed between the two machines.
But that doesn't seem to be happening. The PortAudio configuration does have a parameter for sample-rate which is currently 16000, and there is something to do with timing set to 20. But those are the only parameters I can see that relate to codecs and neither of them actually specify the codec to use. So I'm thinking that PortAudio has nothing to do with codecs, which would make sense. But that means something else in Freeswitch needs to transcode to the real world.
Can anyone explain why this is failing?
Thank you.
Clive Lansink
Email: Clive@Lansink.Co.NZ
Phone: +64 9 520-4242
Mobile: +64 21 663-999
_________________________________________________________________________
The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.
Join our online community to chat in real time https://signalwire.community
Professional FreeSWITCH Services
sales@freeswitch.com
https://freeswitch.com
Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://cluecon.com
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
https://freeswitch.com |
|
Back to top |
|
|
clive at lansink.co.nz Guest
|
Posted: Sun Oct 24, 2021 2:37 pm Post subject: [Freeswitch-users] PortAudio and codecs |
|
|
Hello again.
I've at least managed to solve my problem but I always like to know why things work the way they do so I would still appreciate an answer on this.
I found a helpful article on how Freeswitch negotiates codecs at https://freeswitch.org/confluence/display/FREESWITCH/Codec+Negotiation. I added the following line to my dial plan at the point where it catches and directs the call to the number I am dialing:
<action application="export" data="nolocal:absolute_codec_string=$${outbound_codec_prefs}"/>
<action application="bridge" data="sofia/gateway/outbound/$1"/>
The example in the article is <action application="export" data="nolocal:absolute_codec_string=PCMA,PCMU"/>, but I preferred to refer back to the global variable outbound_codec_prefs set in vars.xml. So now I presume Freeswitch is transcoding from PortAudio's raw PCM to whatever codec is negotiated when the call is made.
So why did this not work in the first place. Why is Freeswitch not honouring outbound_codec_prefs when I make a call from PortAudio? I'm pretty sure this used to work out of the box so I suspect something has changed.
Thank you.
Clive Lansink
Email: Clive@Lansink.Co.NZ
Phone: +64 9 520-4242
Mobile: +64 21 663-999
-----Forwarded message-----
From: Clive Lansink <clive@lansink.co.nz>
To: Freeswitch users list <freeswitch-users@lists.freeswitch.org>
Subject: [Freeswitch-users] PortAudio and codecs
Reply-to: FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org>
Date: Sun, 24 Oct 2021 01:09:41 +0000
Hi everyone.
I need help please to make a call using PortAudio which is failing at the CODEC negotiation step. I've done this successfully in the past but that was a number of Freeswitch versions ago and on a different laptop and something may have changed.
I have a recent installation of Freeswitch on a laptop with PortAudio enabled. It registers to our main box running Freeswitch (though a rather older version) which in turn registers to our VOIP provider. When I call a number with the api pa call command, it appears to be successful but nothing happens.
Freeswitch.log on the main box shows the following lines that may explain the problem:
a13d9197-2a00-4858-92d4-5aed6dc7652d 2021-10-24 13:46:23.400156 [ERR] mod_sofia.c:2247 CODEC NEGOTIATION ERROR. SDP:
a13d9197-2a00-4858-92d4-5aed6dc7652d v=0
a13d9197-2a00-4858-92d4-5aed6dc7652d o=FreeSWITCH 1635011588 1635011589 IN IP4 192.168.1.90
a13d9197-2a00-4858-92d4-5aed6dc7652d s=FreeSWITCH
a13d9197-2a00-4858-92d4-5aed6dc7652d c=IN IP4 192.168.1.90
a13d9197-2a00-4858-92d4-5aed6dc7652d t=0 0
a13d9197-2a00-4858-92d4-5aed6dc7652d m=audio 24794 RTP/AVP 102 101
a13d9197-2a00-4858-92d4-5aed6dc7652d a=rtpmap:102 L16/16000
a13d9197-2a00-4858-92d4-5aed6dc7652d a=rtpmap:101 telephone-event/16000
a13d9197-2a00-4858-92d4-5aed6dc7652d a=fmtp:101 0-16
a13d9197-2a00-4858-92d4-5aed6dc7652d a=ptime:20
a13d9197-2a00-4858-92d4-5aed6dc7652d
a13d9197-2a00-4858-92d4-5aed6dc7652d 2021-10-24 13:46:23.400156 [NOTICE] switch_channel.c:3438 Hangup sofia/internal/1015@192.168.1.61 [CS_EXECUTE] [INCOMPATIBLE_DESTINATION]
I know nothing about SDP but when I look at this it kind of suggests to me that the originating machine is only offering L16/16000 as the CODEC to use. If that is the case then that is the problem because I'm pretty sure the main Freeswitch box is not set up to accept that codec.
Back to the laptop, in SIP profiles external.xml, outbound-codec-prefs is set to "$${outbound_codec_prefs}". In vars.xml, outbound_codec_prefs is set to PCMU,PCMA,GSM. I think when it makes the call it should be offering these codecs which are all acceptable to the main Freeswitch box. But then I would expect to see that in the SDP stuff in the log. It should mean the laptop would transcode from the raw PCM data from PortAudio to the codec agreed between the two machines.
But that doesn't seem to be happening. The PortAudio configuration does have a parameter for sample-rate which is currently 16000, and there is something to do with timing set to 20. But those are the only parameters I can see that relate to codecs and neither of them actually specify the codec to use. So I'm thinking that PortAudio has nothing to do with codecs, which would make sense. But that means something else in Freeswitch needs to transcode to the real world.
Can anyone explain why this is failing?
Thank you.
Clive Lansink
Email: Clive@Lansink.Co.NZ
Phone: +64 9 520-4242
Mobile: +64 21 663-999
_________________________________________________________________________
The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.
Join our online community to chat in real time https://signalwire.community
Professional FreeSWITCH Services
sales@freeswitch.com
https://freeswitch.com
Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://cluecon.com
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
https://freeswitch.com
_________________________________________________________________________
The FreeSWITCH project is sponsored by SignalWire https://signalwire.com
Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.
Build your next product on our scalable cloud platform.
Join our online community to chat in real time https://signalwire.community
Professional FreeSWITCH Services
sales@freeswitch.com
https://freeswitch.com
Official FreeSWITCH Sites
https://freeswitch.com/oss
https://freeswitch.org/confluence
https://cluecon.com
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
https://freeswitch.com |
|
Back to top |
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|