# Transcode audio codecs issue pjsip

**URL:** <https://community.asterisk.org/t/transcode-audio-codecs-issue-pjsip/83074>\
**Category:** Asterisk Support\
**Created:** [March 12, 2020, 10:44am UTC](https://community.asterisk.org/t/transcode-audio-codecs-issue-pjsip/83074 "2020-03-12T10:44:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sami-hep](https://avatars.discourse-cdn.com/v4/letter/s/ecd19e/32.png) [@sami-hep](https://community.asterisk.org/u/sami-hep)\
**Post date:** [March 12, 2020, 10:44am UTC](https://community.asterisk.org/t/transcode-audio-codecs-issue-pjsip/83074/1 "2020-03-12T10:44:25Z")

</div>

at one endpoint i allowed gsm  
at the other i allowed i allowed alaw and ulaw  
but the call never happens because of difference of audio codecs although asterisk says that there is transcoding.

this is the translation path of gsm:  
— Translation paths SRC Codec “gsm” sample rate 8000 —  
gsm:8000 To codec2:8000 : No Translation Path  
gsm:8000 To g723:8000 : No Translation Path  
gsm:8000 To ulaw:8000 : (gsm@8000)-\>(slin@8000)-\>(ulaw@8000)  
gsm:8000 To alaw:8000 : (gsm@8000)-\>(slin@8000)-\>(alaw@8000)  
gsm:8000 To g726:8000 : (gsm@8000)-\>(slin@8000)-\>(g726@8000)  
gsm:8000 To g726aal2:8000 : (gsm@8000)-\>(slin@8000)-\>(g726aal2@8000)  
gsm:8000 To adpcm:8000 : (gsm@8000)-\>(slin@8000)-\>(adpcm@8000)  
gsm:8000 To slin:8000 : (gsm@8000)-\>(slin@8000)  
gsm:8000 To slin:12000 : (gsm@8000)-\>(slin@8000)-\>(slin@12000)  
gsm:8000 To slin:16000 : (gsm@8000)-\>(slin@8000)-\>(slin@16000)  
gsm:8000 To slin:24000 : (gsm@8000)-\>(slin@8000)-\>(slin@24000)  
gsm:8000 To slin:32000 : (gsm@8000)-\>(slin@8000)-\>(slin@32000)  
gsm:8000 To slin:44100 : (gsm@8000)-\>(slin@8000)-\>(slin@44100)  
gsm:8000 To slin:48000 : (gsm@8000)-\>(slin@8000)-\>(slin@48000)  
gsm:8000 To slin:96000 : (gsm@8000)-\>(slin@8000)-\>(slin@96000)  
gsm:8000 To slin:192000 : (gsm@8000)-\>(slin@8000)-\>(slin@192000)  
gsm:8000 To lpc10:8000 : (gsm@8000)-\>(slin@8000)-\>(lpc10@8000)  
gsm:8000 To g729:8000 : No Translation Path  
gsm:8000 To speex:8000 : No Translation Path  
gsm:8000 To speex:16000 : No Translation Path  
gsm:8000 To speex:32000 : No Translation Path  
gsm:8000 To ilbc:8000 : (gsm@8000)-\>(slin@8000)-\>(ilbc@8000)  
gsm:8000 To g722:16000 : (gsm@8000)-\>(slin@8000)-\>(g722@16000)  
gsm:8000 To siren7:16000 : No Translation Path  
gsm:8000 To siren14:32000 : No Translation Path  
gsm:8000 To testlaw:8000 : (gsm@8000)-\>(slin@8000)-\>(testlaw@8000)  
gsm:8000 To g719:48000 : No Translation Path  
gsm:8000 To opus:48000 : No Translation Path  
gsm:8000 To none:8000 : No Translation Path  
gsm:8000 To silk:8000 : No Translation Path  
gsm:8000 To silk:12000 : No Translation Path  
gsm:8000 To silk:16000 : No Translation Path  
gsm:8000 To silk:24000 : No Translation Path

this is the log:

\<— Received SIP request (1079 bytes) from UDP:192.168.133.9:5060 —\>  
INVITE [sip:37301@192.168.133.111](mailto:sip:37301@192.168.133.111) SIP/2.0  
Via: SIP/2.0/UDP 192.168.133.9:5060;branch=z9hG4bK.ISnaroGGk;rport  
From: sip:37200@192.168.133.111;tag=6Sq~N7rxb  
To: [sip:37301@192.168.133.111](mailto:sip:37301@192.168.133.111)  
CSeq: 20 INVITE  
Call-ID: 9t3Bc4p4m7  
Max-Forwards: 70  
Supported: replaces, outbound  
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO, UPDATE  
Content-Type: application/sdp  
Content-Length: 495  
Contact: sip:37200@192.168.133.9;transport=udp;+sip.instance=“urn:uuid:313ef843-7fe8-43c9-88d4-20fac982aeb6”  
User-Agent: Linphonec/3.12.0 (belle-sip/1.6.3)

v=0  
o=37200 2645 782 IN IP4 192.168.133.9  
s=Talk  
c=IN IP4 192.168.133.9  
t=0 0  
a=rtcp-xr:rcvr-rtt=all:10000 stat-summary=loss,dup,jitt,TTL voip-metrics  
m=audio 7078 RTP/AVP 0 8 96 97 98 101 99 100  
a=rtpmap:96 speex/8000  
a=fmtp:96 vbr=on  
a=rtpmap:97 opus/48000/2  
a=fmtp:97 useinbandfec=1  
a=rtpmap:98 speex/16000  
a=fmtp:98 vbr=on  
a=rtpmap:101 telephone-event/8000  
a=rtpmap:99 telephone-event/48000  
a=rtpmap:100 telephone-event/16000  
a=rtcp-fb:\* trr-int 5000  
a=rtcp-fb:\* ccm tmmbr

\<— Transmitting SIP response (475 bytes) to UDP:192.168.133.9:5060 —\>  
SIP/2.0 401 Unauthorized  
Via: SIP/2.0/UDP 192.168.133.9:5060;rport=5060;received=192.168.133.9;branch=z9hG4bK.ISnaroGGk  
Call-ID: 9t3Bc4p4m7  
From: sip:37200@192.168.133.111;tag=6Sq~N7rxb  
To: sip:37301@192.168.133.111;tag=z9hG4bK.ISnaroGGk  
CSeq: 20 INVITE  
WWW-Authenticate: Digest realm=“asterisk”,nonce=“1584009606/de0be536678b7eaabfff3d900cbe7027”,opaque=“11f0ba1743b05957”,algorithm=md5,qop=“auth”  
Server: Asterisk PBX certified/16.3-cert1  
Content-Length: 0

\<— Received SIP request (380 bytes) from UDP:192.168.133.9:5060 —\>  
ACK [sip:37301@192.168.133.111](mailto:sip:37301@192.168.133.111) SIP/2.0  
Via: SIP/2.0/UDP 192.168.133.9:5060;branch=z9hG4bK.ISnaroGGk;rport  
Call-ID: 9t3Bc4p4m7  
From: sip:37200@192.168.133.111;tag=6Sq~N7rxb  
To: sip:37301@192.168.133.111;tag=z9hG4bK.ISnaroGGk  
Contact: sip:37200@192.168.133.9;transport=udp;+sip.instance=“urn:uuid:313ef843-7fe8-43c9-88d4-20fac982aeb6”  
Max-Forwards: 70  
CSeq: 20 ACK

\<— Received SIP request (1362 bytes) from UDP:192.168.133.9:5060 —\>  
INVITE [sip:37301@192.168.133.111](mailto:sip:37301@192.168.133.111) SIP/2.0  
Via: SIP/2.0/UDP 192.168.133.9:5060;branch=z9hG4bK.BXINd8rvn;rport  
From: sip:37200@192.168.133.111;tag=6Sq~N7rxb  
To: [sip:37301@192.168.133.111](mailto:sip:37301@192.168.133.111)  
CSeq: 21 INVITE  
Call-ID: 9t3Bc4p4m7  
Max-Forwards: 70  
Supported: replaces, outbound  
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO, UPDATE  
Content-Type: application/sdp  
Content-Length: 495  
Contact: sip:37200@192.168.133.9;transport=udp;+sip.instance=“urn:uuid:313ef843-7fe8-43c9-88d4-20fac982aeb6”  
User-Agent: Linphonec/3.12.0 (belle-sip/1.6.3)  
Authorization: Digest realm=“asterisk”, nonce=“1584009606/de0be536678b7eaabfff3d900cbe7027”, algorithm=md5, opaque=“11f0ba1743b05957”, username=“37200”, [uri="sip:37301@192.168.133.111](mailto:uri=%22sip:37301@192.168.133.111)", response=“79bdff45377b73e674c88d185961d636”, cnonce=“FpoXmJMmZIWIabfS”, nc=00000001, qop=auth

v=0  
o=37200 2645 782 IN IP4 192.168.133.9  
s=Talk  
c=IN IP4 192.168.133.9  
t=0 0  
a=rtcp-xr:rcvr-rtt=all:10000 stat-summary=loss,dup,jitt,TTL voip-metrics  
m=audio 7078 RTP/AVP 0 8 96 97 98 101 99 100  
a=rtpmap:96 speex/8000  
a=fmtp:96 vbr=on  
a=rtpmap:97 opus/48000/2  
a=fmtp:97 useinbandfec=1  
a=rtpmap:98 speex/16000  
a=fmtp:98 vbr=on  
a=rtpmap:101 telephone-event/8000  
a=rtpmap:99 telephone-event/48000  
a=rtpmap:100 telephone-event/16000  
a=rtcp-fb:\* trr-int 5000  
a=rtcp-fb:\* ccm tmmbr

== Setting global variable ‘SIPDOMAIN’ to ‘192.168.133.111’  
\<— Transmitting SIP response (301 bytes) to UDP:192.168.133.9:5060 —\>  
SIP/2.0 100 Trying  
Via: SIP/2.0/UDP 192.168.133.9:5060;rport=5060;received=192.168.133.9;branch=z9hG4bK.BXINd8rvn  
Call-ID: 9t3Bc4p4m7  
From: sip:37200@192.168.133.111;tag=6Sq~N7rxb  
To: sip:37301@192.168.133.111  
CSeq: 21 INVITE  
Server: Asterisk PBX certified/16.3-cert1  
Content-Length: 0

**[Mar 12 12:40:06] NOTICE[16156]: res\_pjsip\_sdp\_rtp.c:418 set\_caps: No joint capabilities for ‘audio’ media stream between our configuration((gsm)) and incoming SDP((ulaw|alaw|speex|opus|speex16))**  
\<— Transmitting SIP response (355 bytes) to UDP:192.168.133.9:5060 —\>  
SIP/2.0 488 Not Acceptable Here  
Via: SIP/2.0/UDP 192.168.133.9:5060;rport=5060;received=192.168.133.9;branch=z9hG4bK.BXINd8rvn  
Call-ID: 9t3Bc4p4m7  
From: sip:37200@192.168.133.111;tag=6Sq~N7rxb  
To: sip:37301@192.168.133.111;tag=695f8456-d5d4-4e18-b81b-3c64b9f8828c  
CSeq: 21 INVITE  
Server: Asterisk PBX certified/16.3-cert1  
Content-Length: 0

\<— Received SIP request (399 bytes) from UDP:192.168.133.9:5060 —\>  
ACK [sip:37301@192.168.133.111](mailto:sip:37301@192.168.133.111) SIP/2.0  
Via: SIP/2.0/UDP 192.168.133.9:5060;branch=z9hG4bK.BXINd8rvn;rport  
Call-ID: 9t3Bc4p4m7  
From: sip:37200@192.168.133.111;tag=6Sq~N7rxb  
To: sip:37301@192.168.133.111;tag=695f8456-d5d4-4e18-b81b-3c64b9f8828c  
Contact: sip:37200@192.168.133.9;transport=udp;+sip.instance=“urn:uuid:313ef843-7fe8-43c9-88d4-20fac982aeb6”  
Max-Forwards: 70  
CSeq: 21 ACK

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [March 12, 2020, 11:08am UTC](https://community.asterisk.org/t/transcode-audio-codecs-issue-pjsip/83074/2 "2020-03-12T11:08:19Z")

</div>

The call between an endpoint and Asterisk has to agree on at least one common codec to work. You can’t send gsm to an endpoint if it was never negotiated. Transcoding occurs when you are playing back files, or talking to another channel with a different codec.

---

<div class="post-metadata">

**Author:** ![sami-hep](https://avatars.discourse-cdn.com/v4/letter/s/ecd19e/32.png) [@sami-hep](https://community.asterisk.org/u/sami-hep)\
**Post date:** [March 12, 2020, 11:09am UTC](https://community.asterisk.org/t/transcode-audio-codecs-issue-pjsip/83074/3 "2020-03-12T11:09:17Z")

</div>

what do you mean by to another channel ?

---

<div class="post-metadata">

**Author:** ![jcolp](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/jcolp/32/8848_2.png) [@jcolp](https://community.asterisk.org/u/jcolp)\
**Post date:** [March 12, 2020, 11:10am UTC](https://community.asterisk.org/t/transcode-audio-codecs-issue-pjsip/83074/4 "2020-03-12T11:10:00Z")

</div>

If endpoint Alice calls endpoint Bob through Asterisk, then that would be two channels. Alice could have negotiated as ulaw, and Bob as gsm. In that case Asterisk would transcode between ulaw and gsm.

---

<div class="post-metadata">

**Author:** ![sami-hep](https://avatars.discourse-cdn.com/v4/letter/s/ecd19e/32.png) [@sami-hep](https://community.asterisk.org/u/sami-hep)\
**Post date:** [March 12, 2020, 11:21am UTC](https://community.asterisk.org/t/transcode-audio-codecs-issue-pjsip/83074/5 "2020-03-12T11:21:19Z")

</div>

got it. that was so helpful

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [April 11, 2020, 11:21am UTC](https://community.asterisk.org/t/transcode-audio-codecs-issue-pjsip/83074/6 "2020-04-11T11:21:25Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
