No path to translate from SIP to PJSIP

I have purchased a single G729 codec license from Digium. I have a SIP client who is connected on G.711 ulaw and trying to reach a G729 trunk. Currently I am seeing that the call is getting connected only from G729 to G711 and not the other way round i.e G711 to G729. Please let me know what could be wrong here. I have no other extensions on this box except for this SIP client and SIP trunk.

Your subject doesn’t make sense. Translations paths are between codecs, not between channel technologies.

Translating from G.729 to any other codec requires you install a third party codec. The only one of which I know which is correctly licensed is Sangoma’s which requires licence fees to be paid.

I’m pretty sure you need two licences, one for each direction, in the situation you describe.

If you really have both chan_sip and chan_pjsip, you should convert the chan_sip users to use chan_pjsip.

Yes that was my doubt that I may need two licenses but then how come one side calling works with a single license. I am not able to understand. I have also tried to move the client from PJSIP to SIP but have the same results. I dont have permissions to upload log files so I am pasting the error logs below:

<--- SIP read from UDP:10.229.38.180:5060 --->

SIP/2.0 200 OK

Via: SIP/2.0/UDP 10.229.38.185:5560;branch=z9hG4bK32cc4cf3

From: <sip:XXXXXXXX@10.229.38.180:5560>;tag=as5895fd2b

To: <sip:XXXXXXXX@10.229.38.180:5060>;tag=iz0romw2-CC-1004

Call-ID: 05ae478b0f9e2c000b6a5e3350d24433@10.229.38.180

CSeq: 102 INVITE

Allow: INVITE,ACK,OPTIONS,BYE,CANCEL,REGISTER,INFO,PRACK,SUBSCRIBE,NOTIFY,UPDATE,MESSAGE,REFER

Session-Expires: 1800;refresher=uac

Require: timer

Contact: <sip:XXXXXXXX@10.229.38.180:5060;transport=udp>

Content-Length: 234

Content-Type: application/sdp

v=0

o=HuaweiSoftX3000 890494166 890494167 IN IP4 10.229.38.180

s=Sip Call

c=IN IP4 10.229.38.180

t=0 0

m=audio 21686 RTP/AVP 18 101

a=rtpmap:18 G729/8000

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-15

a=fmtp:18 annexb=no

Comparing SDP version 890494167 -> 890494167 and unique parts [HuaweiSoftX3000 890494166 IN IP4 10.229.38.180] -> [HuaweiSoftX3000 890494166 IN IP4 10.229.38.180]

sip_route_dump: route/path hop: <sip:XXXXXXXXXX@10.229.38.180:5060;transport=udp>

set_destination: Parsing <sip:XXXXXXXXXX@10.229.38.180:5060;transport=udp> for address/port to send to

set_destination: set destination to 10.229.38.180:5060

Transmitting (no NAT) to 10.229.38.180:5060:

ACK sip:XXXXXXXXXXX@10.229.38.180:5060;transport=udp SIP/2.0

Via: SIP/2.0/UDP 10.229.38.185:5560;branch=z9hG4bK5f3ebf82

Max-Forwards: 70

From: <sip:XXXXXXXXXX@10.229.38.180:5560>;tag=as5895fd2b

To: <sip:XXXXXXXXXX@10.229.38.180:5060>;tag=iz0romw2-CC-1004

Contact: <sip:XXXXXXXXXXX@10.229.38.185:5560>

Call-ID: 05ae478b0f9e2c000b6a5e3350d24433@10.229.38.180

CSeq: 102 ACK

User-Agent: FPBX-15.0.17.55(16.22.0)

Content-Length: 0

---

**--** SIP/10.229.38.180-00000035 answered PJSIP/2101-0000007e

**--** SIP/10.229.38.180-00000035 Internal Gosub(sub-send-obroute-email,s,1(XXXXXXXXX,XXXXXX,1,1636376837,,XXXXXX)) start

**--** Executing [s@sub-send-obroute-email:1] **GotoIf** (" **SIP/10.229.38.180-00000035** ", " **0?sendEmail** ") in new stack

**--** Executing [s@sub-send-obroute-email:2] **NoOp** (" **SIP/10.229.38.180-00000035** ", " **email notifications disabled..exiting.** ") in new stack

**--** Executing [s@sub-send-obroute-email:3] **Return** (" **SIP/10.229.38.180-00000035** ", "") in new stack

**==** Spawn extension (from-trunk, , 1) exited non-zero on 'SIP/10.229.38.180-00000035'

**--** SIP/10.229.38.180-00000035 Internal Gosub(sub-send-obroute-email,s,1(XXXXXXXXX,XXXXXXXXX,1,1636376837,,XXXXXXXXX)) complete GOSUB_RETVAL=

[2021-11-08 08:07:21] **WARNING** [187816][C-0000006e]: **channel.c** : **6704** **ast_channel_make_compatible_helper** : No path to translate from SIP/10.229.38.180-00000035 to PJSIP/2101-0000007e

[2021-11-08 08:07:21] **WARNING** [187816][C-0000006e]: **app_dial.c** : **3300** **dial_exec_full** : Had to drop call because I couldn't make PJSIP/2101-0000007e compatible with SIP/10.229.38.180-00000035

You are using FreePBX. FreePBX peer support is provided at https://community.freepbx.org/ Answers you get here may require you to do things that are difficult or impossible to do with the FreePBX GUI.

You haven’t provided the full SIP exchanges for both parties, only the second half of that for the B leg.

Could you please provide the output of the CLI command “core show translations”.

Are you sure that device 2101 doesn’t also support G.729, as setup direction could be significant in terms of whether G.729 was used for that device, which would allow G.729 pass through even though you didn’t have the codec properly installed.

The part of the code that is complaining about the inability to translate is agnostic to the channel technology; it is only using SIP and PJSIP as part of the names of the channels, not because they are significant to the issue.

You should move the trunk to PJSIP and disable chan_sip. chan_sip is deprecated in current Asterisk and scheduled for removal in, I think, Asterisk 21.

The FreePBX forum has an associated pastebin server. You can quote the final part of the URL in their forum even if you haven’t accumulated enough posting history to use a URL. (That probably works with this forum as well.)

I moved the trunk to PJSIP on both sides but issue still exist. Also attached the trace both from A Leg & B Leg. Thanks for all your help.

  -- Remote UNIX connection disconnected
  == Using SIP RTP Audio TOS bits 184
  == Using SIP RTP Audio TOS bits 184 in TCLASS field.
  == Using SIP RTP Audio CoS mark 5
    -- Executing [XXXXXXXXXX@from-internal:1] Macro("PJSIP/2101-0000008a", "user-callerid,LIMIT,EXTERNAL,") in new stack
    -- Executing [s@macro-user-callerid:1] Set("PJSIP/2101-0000008a", "TOUCH_MONITOR=1636387193.192") in new stack
    -- Executing [s@macro-user-callerid:2] Set("PJSIP/2101-0000008a", "CHANCONTEXT=") in new stack
    -- Executing [s@macro-user-callerid:3] Set("PJSIP/2101-0000008a", "CHANCONTEXT=") in new stack
    -- Executing [s@macro-user-callerid:4] Set("PJSIP/2101-0000008a", "CHANEXTENCONTEXT=2101-0000008a") in new stack
    -- Executing [s@macro-user-callerid:5] Set("PJSIP/2101-0000008a", "CHANEXTEN=2101-0000008a") in new stack
    -- Executing [s@macro-user-callerid:6] Set("PJSIP/2101-0000008a", "CALLERID(number)=2101") in new stack
    -- Executing [s@macro-user-callerid:7] Set("PJSIP/2101-0000008a", "AMPUSER=2101") in new stack
    -- Executing [s@macro-user-callerid:8] Set("PJSIP/2101-0000008a", "HOTDESCKCHAN=2101-0000008a") in new stack
    -- Executing [s@macro-user-callerid:9] Set("PJSIP/2101-0000008a", "HOTDESKEXTEN=2101") in new stack
    -- Executing [s@macro-user-callerid:10] Set("PJSIP/2101-0000008a", "HOTDESKCALL=0") in new stack
    -- Executing [s@macro-user-callerid:11] ExecIf("PJSIP/2101-0000008a", "0?Set(HOTDESKCALL=1)") in new stack
    -- Executing [s@macro-user-callerid:12] ExecIf("PJSIP/2101-0000008a", "0?Set(CALLERID(name)=)") in new stack
    -- Executing [s@macro-user-callerid:13] GotoIf("PJSIP/2101-0000008a", "0?report") in new stack
    -- Executing [s@macro-user-callerid:14] ExecIf("PJSIP/2101-0000008a", "1?Set(REALCALLERIDNUM=2101)") in new stack
    -- Executing [s@macro-user-callerid:15] Set("PJSIP/2101-0000008a", "AMPUSER=2101") in new stack
    -- Executing [s@macro-user-callerid:16] GotoIf("PJSIP/2101-0000008a", "0?limit") in new stack
    -- Executing [s@macro-user-callerid:17] Set("PJSIP/2101-0000008a", "AMPUSERCIDNAME=nilesh") in new stack
    -- Executing [s@macro-user-callerid:18] ExecIf("PJSIP/2101-0000008a", "0?Set(__CIDMASQUERADING=TRUE)") in new stack
    -- Executing [s@macro-user-callerid:19] GotoIf("PJSIP/2101-0000008a", "0?report") in new stack
    -- Executing [s@macro-user-callerid:20] Set("PJSIP/2101-0000008a", "AMPUSERCID=2101") in new stack
    -- Executing [s@macro-user-callerid:21] Set("PJSIP/2101-0000008a", "__DIAL_OPTIONS=HhTtr") in new stack
    -- Executing [s@macro-user-callerid:22] Set("PJSIP/2101-0000008a", "CALLERID(all)="nilesh" <2101>") in new stack
    -- Executing [s@macro-user-callerid:23] ExecIf("PJSIP/2101-0000008a", "0?Set(CUSDIAL=)") in new stack
    -- Executing [s@macro-user-callerid:24] ExecIf("PJSIP/2101-0000008a", "0?Set(CALLERID(all)="nilesh" <2101>)") in new stack
    -- Executing [s@macro-user-callerid:25] GotoIf("PJSIP/2101-0000008a", "0?limit") in new stack
    -- Executing [s@macro-user-callerid:26] ExecIf("PJSIP/2101-0000008a", "1?Set(GROUP(concurrency_limit)=2101)") in new stack
    -- Executing [s@macro-user-callerid:27] NoOp("PJSIP/2101-0000008a", "Macro Depth is 1") in new stack
    -- Executing [s@macro-user-callerid:28] GotoIf("PJSIP/2101-0000008a", "1?report2:macroerror") in new stack
    -- Goto (macro-user-callerid,s,29)
    -- Executing [s@macro-user-callerid:29] GotoIf("PJSIP/2101-0000008a", "1?continue") in new stack
    -- Goto (macro-user-callerid,s,47)
    -- Executing [s@macro-user-callerid:47] Set("PJSIP/2101-0000008a", "CALLERID(number)=2101") in new stack
    -- Executing [s@macro-user-callerid:48] Set("PJSIP/2101-0000008a", "CALLERID(name)=nilesh") in new stack
    -- Executing [s@macro-user-callerid:49] GotoIf("PJSIP/2101-0000008a", "0?cnum") in new stack
    -- Executing [s@macro-user-callerid:50] Set("PJSIP/2101-0000008a", "CDR(cnam)=nilesh") in new stack
    -- Executing [s@macro-user-callerid:51] Set("PJSIP/2101-0000008a", "CDR(cnum)=2101") in new stack
    -- Executing [s@macro-user-callerid:52] Set("PJSIP/2101-0000008a", "CHANNEL(language)=en_GB") in new stack
    -- Executing [XXXXXXXXXX@from-internal:2] Gosub("PJSIP/2101-0000008a", "sub-record-check,s,1(out,XXXXXXXXXX,dontcare)") in new stack
    -- Executing [s@sub-record-check:1] GotoIf("PJSIP/2101-0000008a", "0?initialized") in new stack
    -- Executing [s@sub-record-check:2] Set("PJSIP/2101-0000008a", "__REC_STATUS=INITIALIZED") in new stack
    -- Executing [s@sub-record-check:3] Set("PJSIP/2101-0000008a", "NOW=1636387193") in new stack
    -- Executing [s@sub-record-check:4] Set("PJSIP/2101-0000008a", "__DAY=08") in new stack
    -- Executing [s@sub-record-check:5] Set("PJSIP/2101-0000008a", "__MONTH=11") in new stack
    -- Executing [s@sub-record-check:6] Set("PJSIP/2101-0000008a", "__YEAR=2021") in new stack
    -- Executing [s@sub-record-check:7] Set("PJSIP/2101-0000008a", "__TIMESTR=20211108-105953") in new stack
    -- Executing [s@sub-record-check:8] Set("PJSIP/2101-0000008a", "__FROMEXTEN=2101") in new stack
    -- Executing [s@sub-record-check:9] Set("PJSIP/2101-0000008a", "__MON_FMT=wav") in new stack
    -- Executing [s@sub-record-check:10] NoOp("PJSIP/2101-0000008a", "Recordings initialized") in new stack
    -- Executing [s@sub-record-check:11] ExecIf("PJSIP/2101-0000008a", "0?Set(ARG3=dontcare)") in new stack
    -- Executing [s@sub-record-check:12] Set("PJSIP/2101-0000008a", "REC_POLICY_MODE_SAVE=") in new stack
    -- Executing [s@sub-record-check:13] ExecIf("PJSIP/2101-0000008a", "0?Set(REC_STATUS=NO)") in new stack
    -- Executing [s@sub-record-check:14] GotoIf("PJSIP/2101-0000008a", "3?checkaction") in new stack
    -- Goto (sub-record-check,s,17)
    -- Executing [s@sub-record-check:17] GotoIf("PJSIP/2101-0000008a", "1?sub-record-check,out,1") in new stack
    -- Goto (sub-record-check,out,1)
    -- Executing [out@sub-record-check:1] NoOp("PJSIP/2101-0000008a", "Outbound Recording Check from 2101 to XXXXXXXXXX") in new stack
    -- Executing [out@sub-record-check:2] Set("PJSIP/2101-0000008a", "RECMODE=dontcare") in new stack
    -- Executing [out@sub-record-check:3] ExecIf("PJSIP/2101-0000008a", "1?Goto(routewins)") in new stack
    -- Goto (sub-record-check,out,7)
    -- Executing [out@sub-record-check:7] Gosub("PJSIP/2101-0000008a", "recordcheck,1(dontcare,out,XXXXXXXXXX)") in new stack
    -- Executing [recordcheck@sub-record-check:1] NoOp("PJSIP/2101-0000008a", "Starting recording check against dontcare") in new stack
    -- Executing [recordcheck@sub-record-check:2] Goto("PJSIP/2101-0000008a", "dontcare") in new stack
    -- Goto (sub-record-check,recordcheck,3)
    -- Executing [recordcheck@sub-record-check:3] Return("PJSIP/2101-0000008a", "") in new stack
    -- Executing [out@sub-record-check:8] Return("PJSIP/2101-0000008a", "") in new stack
    -- Executing [XXXXXXXXXX@from-internal:3] Set("PJSIP/2101-0000008a", "_ROUTEID=1") in new stack
    -- Executing [XXXXXXXXXX@from-internal:4] Set("PJSIP/2101-0000008a", "_ROUTENAME=OutBound") in new stack
    -- Executing [XXXXXXXXXX@from-internal:5] Set("PJSIP/2101-0000008a", "MOHCLASS=default") in new stack
    -- Executing [XXXXXXXXXX@from-internal:6] Set("PJSIP/2101-0000008a", "_CALLERIDNAMEINTERNAL=nilesh") in new stack
    -- Executing [XXXXXXXXXX@from-internal:7] Set("PJSIP/2101-0000008a", "_CALLERIDNUMINTERNAL=2101") in new stack
    -- Executing [XXXXXXXXXX@from-internal:8] Set("PJSIP/2101-0000008a", "_EMAILNOTIFICATION=FALSE") in new stack
    -- Executing [XXXXXXXXXX@from-internal:9] Set("PJSIP/2101-0000008a", "_NODEST=") in new stack
    -- Executing [XXXXXXXXXX@from-internal:10] Macro("PJSIP/2101-0000008a", "dialout-trunk,3,XXXXXXXXXX,,off") in new stack
    -- Executing [s@macro-dialout-trunk:1] Set("PJSIP/2101-0000008a", "DIAL_TRUNK=3") in new stack
    -- Executing [s@macro-dialout-trunk:2] ExecIf("PJSIP/2101-0000008a", "0?Set(DIAL_OPTIONS=Hhtr)") in new stack
    -- Executing [s@macro-dialout-trunk:3] GosubIf("PJSIP/2101-0000008a", "0?sub-pincheck,s,1()") in new stack
    -- Executing [s@macro-dialout-trunk:4] ExecIf("PJSIP/2101-0000008a", "0?Set(CALLERID(num)=2101)") in new stack
    -- Executing [s@macro-dialout-trunk:5] GotoIf("PJSIP/2101-0000008a", "0?disabletrunk,1") in new stack
    -- Executing [s@macro-dialout-trunk:6] Set("PJSIP/2101-0000008a", "DIAL_NUMBER=XXXXXXXXXX") in new stack
    -- Executing [s@macro-dialout-trunk:7] Set("PJSIP/2101-0000008a", "DIAL_TRUNK_OPTIONS=HhTtr") in new stack
    -- Executing [s@macro-dialout-trunk:8] Set("PJSIP/2101-0000008a", "OUTBOUND_GROUP=OUT_3") in new stack
    -- Executing [s@macro-dialout-trunk:9] Set("PJSIP/2101-0000008a", "DIAL_TRUNK_OPTIONS=T") in new stack
    -- Executing [s@macro-dialout-trunk:10] GotoIf("PJSIP/2101-0000008a", "1?nomax") in new stack
    -- Goto (macro-dialout-trunk,s,12)
    -- Executing [s@macro-dialout-trunk:12] GotoIf("PJSIP/2101-0000008a", "0?skipoutcid") in new stack
    -- Executing [s@macro-dialout-trunk:13] Macro("PJSIP/2101-0000008a", "outbound-callerid,3") in new stack
    -- Executing [s@macro-outbound-callerid:1] NoOp("PJSIP/2101-0000008a", "2101") in new stack
    -- Executing [s@macro-outbound-callerid:2] NoOp("PJSIP/2101-0000008a", "") in new stack
    -- Executing [s@macro-outbound-callerid:3] NoOp("PJSIP/2101-0000008a", "off") in new stack
    -- Executing [s@macro-outbound-callerid:4] ExecIf("PJSIP/2101-0000008a", "0?Set(CALLERPRES(name-pres)=)") in new stack
    -- Executing [s@macro-outbound-callerid:5] ExecIf("PJSIP/2101-0000008a", "0?Set(CALLERPRES(num-pres)=)") in new stack
    -- Executing [s@macro-outbound-callerid:6] Set("PJSIP/2101-0000008a", "HOTDESCKCHAN=2101-0000008a") in new stack
    -- Executing [s@macro-outbound-callerid:7] Set("PJSIP/2101-0000008a", "HOTDESKEXTEN=2101") in new stack
    -- Executing [s@macro-outbound-callerid:8] Set("PJSIP/2101-0000008a", "HOTDESKCALL=0") in new stack
    -- Executing [s@macro-outbound-callerid:9] ExecIf("PJSIP/2101-0000008a", "0?Set(HOTDESKCALL=1)") in new stack
    -- Executing [s@macro-outbound-callerid:10] ExecIf("PJSIP/2101-0000008a", "0?Set(CALLERID(name)=)") in new stack
    -- Executing [s@macro-outbound-callerid:11] Set("PJSIP/2101-0000008a", "ALLOWTHISROUTE=NO") in new stack
    -- Executing [s@macro-outbound-callerid:12] ExecIf("PJSIP/2101-0000008a", "0?Set(ALLOWTHISROUTE=YES)") in new stack
    -- Executing [s@macro-outbound-callerid:13] ExecIf("PJSIP/2101-0000008a", "0?Hangup()") in new stack
    -- Executing [s@macro-outbound-callerid:14] ExecIf("PJSIP/2101-0000008a", "0?Set(REALCALLERIDNUM=2101)") in new stack
    -- Executing [s@macro-outbound-callerid:15] ExecIf("PJSIP/2101-0000008a", "0?Set(AMPUSER=2101)") in new stack
    -- Executing [s@macro-outbound-callerid:16] GotoIf("PJSIP/2101-0000008a", "1?normcid") in new stack
    -- Goto (macro-outbound-callerid,s,20)
    -- Executing [s@macro-outbound-callerid:20] Set("PJSIP/2101-0000008a", "USEROUTCID=XXXXXXXXXXX") in new stack
    -- Executing [s@macro-outbound-callerid:21] Set("PJSIP/2101-0000008a", "EMERGENCYCID=") in new stack
    -- Executing [s@macro-outbound-callerid:22] ExecIf("PJSIP/2101-0000008a", "0?Set(EMERGENCYCID=)") in new stack
    -- Executing [s@macro-outbound-callerid:23] Set("PJSIP/2101-0000008a", "TRUNKOUTCID=50022100") in new stack
    -- Executing [s@macro-outbound-callerid:24] GotoIf("PJSIP/2101-0000008a", "1?trunkcid") in new stack
    -- Goto (macro-outbound-callerid,s,30)
    -- Executing [s@macro-outbound-callerid:30] ExecIf("PJSIP/2101-0000008a", "1?Set(CALLERID(all)=50022100)") in new stack
    -- Executing [s@macro-outbound-callerid:31] ExecIf("PJSIP/2101-0000008a", "1?Set(CALLERID(all)=XXXXXXXXXXX)") in new stack
    -- Executing [s@macro-outbound-callerid:32] ExecIf("PJSIP/2101-0000008a", "0?Set(CALLERID(all)=)") in new stack
    -- Executing [s@macro-outbound-callerid:33] ExecIf("PJSIP/2101-0000008a", "0?Set(CALLERID(all)=2101)") in new stack
    -- Executing [s@macro-outbound-callerid:34] ExecIf("PJSIP/2101-0000008a", "0?Set(CALLERID(all)=2101)") in new stack
    -- Executing [s@macro-outbound-callerid:35] Set("PJSIP/2101-0000008a", "TIOHIDE=no") in new stack
    -- Executing [s@macro-outbound-callerid:36] ExecIf("PJSIP/2101-0000008a", "0?Set(CALLERPRES(name-pres)=prohib_passed_screen)") in new stack
    -- Executing [s@macro-outbound-callerid:37] ExecIf("PJSIP/2101-0000008a", "0?Set(CALLERPRES(num-pres)=prohib_passed_screen)") in new stack
    -- Executing [s@macro-outbound-callerid:38] ExecIf("PJSIP/2101-0000008a", "0?Set(CALLERPRES(name-pres)=prohib_passed_screen)") in new stack
    -- Executing [s@macro-outbound-callerid:39] ExecIf("PJSIP/2101-0000008a", "0?Set(CALLERPRES(num-pres)=prohib_passed_screen)") in new stack
    -- Executing [s@macro-outbound-callerid:40] Set("PJSIP/2101-0000008a", "CDR(outbound_cnum)=XXXXXXXXXXX") in new stack
    -- Executing [s@macro-outbound-callerid:41] Set("PJSIP/2101-0000008a", "CDR(outbound_cnam)=") in new stack
    -- Executing [s@macro-dialout-trunk:14] GosubIf("PJSIP/2101-0000008a", "0?sub-flp-3,s,1()") in new stack
    -- Executing [s@macro-dialout-trunk:15] Set("PJSIP/2101-0000008a", "OUTNUM=XXXXXXXXXX") in new stack
    -- Executing [s@macro-dialout-trunk:16] Set("PJSIP/2101-0000008a", "custom=PJSIP") in new stack
    -- Executing [s@macro-dialout-trunk:17] ExecIf("PJSIP/2101-0000008a", "0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)T)") in new stack
    -- Executing [s@macro-dialout-trunk:18] ExecIf("PJSIP/2101-0000008a", "0?Set(DIAL_TRUNK_OPTIONS=TM(confirm))") in new stack
    -- Executing [s@macro-dialout-trunk:19] Macro("PJSIP/2101-0000008a", "dialout-trunk-predial-hook,") in new stack
    -- Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit("PJSIP/2101-0000008a", "") in new stack
    -- Executing [s@macro-dialout-trunk:20] GotoIf("PJSIP/2101-0000008a", "0?bypass,1") in new stack
    -- Executing [s@macro-dialout-trunk:21] ExecIf("PJSIP/2101-0000008a", "1?Set(CONNECTEDLINE(num,i)=XXXXXXXXXX)") in new stack
    -- Executing [s@macro-dialout-trunk:22] ExecIf("PJSIP/2101-0000008a", "1?Set(CONNECTEDLINE(name,i)=CID:XXXXXXXXXXX)") in new stack
    -- Executing [s@macro-dialout-trunk:23] ExecIf("PJSIP/2101-0000008a", "0?Set(CONNECTEDLINE(name,i)=CID:(Hidden)XXXXXXXXXXX)") in new stack
    -- Executing [s@macro-dialout-trunk:24] GotoIf("PJSIP/2101-0000008a", "0?customtrunk") in new stack
    -- Executing [s@macro-dialout-trunk:25] ExecIf("PJSIP/2101-0000008a", "0?Set(DIAL_TRUNK_OPTIONS=)") in new stack
    -- Executing [s@macro-dialout-trunk:26] Set("PJSIP/2101-0000008a", "HASH(__SIPHEADERS,Alert-Info)=unset") in new stack
    -- Executing [s@macro-dialout-trunk:27] Dial("PJSIP/2101-0000008a", "PJSIP/XXXXXXXXXX@VodafoneOutbound,300,Tb(func-apply-sipheaders^s^1,(3))U(sub-send-obroute-email^XXXXXXXXXX^XXXXXXXXXX^3^1636387193^^XXXXXXXXXXX)") in new stack
    -- PJSIP/VodafoneOutbound-0000008b Internal Gosub(func-apply-sipheaders,s,1(3)) start
    -- Executing [s@func-apply-sipheaders:1] NoOp("PJSIP/VodafoneOutbound-0000008b", "Applying SIP Headers to channel PJSIP/VodafoneOutbound-0000008b") in new stack
    -- Executing [s@func-apply-sipheaders:2] Set("PJSIP/VodafoneOutbound-0000008b", "TECH=PJSIP") in new stack
    -- Executing [s@func-apply-sipheaders:3] Set("PJSIP/VodafoneOutbound-0000008b", "SIPHEADERKEYS=Alert-Info") in new stack
    -- Executing [s@func-apply-sipheaders:4] While("PJSIP/VodafoneOutbound-0000008b", "1") in new stack
    -- Executing [s@func-apply-sipheaders:5] Set("PJSIP/VodafoneOutbound-0000008b", "sipheader=unset") in new stack
    -- Executing [s@func-apply-sipheaders:6] ExecIf("PJSIP/VodafoneOutbound-0000008b", "0?SIPRemoveHeader(Alert-Info:)") in new stack
    -- Executing [s@func-apply-sipheaders:7] ExecIf("PJSIP/VodafoneOutbound-0000008b", "1?Set(PJSIP_HEADER(remove,Alert-Info)=)") in new stack
[2021-11-08 10:59:53] ERROR[207294]: res_pjsip_header_funcs.c:547 remove_header: No headers had been previously added to this session.
    -- Executing [s@func-apply-sipheaders:8] ExecIf("PJSIP/VodafoneOutbound-0000008b", "0?Set(sipheader=<http://127.0.0.1>;info=unset)") in new stack
    -- Executing [s@func-apply-sipheaders:9] ExecIf("PJSIP/VodafoneOutbound-0000008b", "0?Set(sipheader=<http://127.0.0.1>unset)") in new stack
    -- Executing [s@func-apply-sipheaders:10] ExecIf("PJSIP/VodafoneOutbound-0000008b", "0?SIPAddHeader(Alert-Info:unset)") in new stack
    -- Executing [s@func-apply-sipheaders:11] ExecIf("PJSIP/VodafoneOutbound-0000008b", "0?Set(PJSIP_HEADER(add,Alert-Info)=unset)") in new stack
    -- Executing [s@func-apply-sipheaders:12] EndWhile("PJSIP/VodafoneOutbound-0000008b", "") in new stack
    -- Executing [s@func-apply-sipheaders:4] While("PJSIP/VodafoneOutbound-0000008b", "0") in new stack
    -- Executing [s@func-apply-sipheaders:13] Return("PJSIP/VodafoneOutbound-0000008b", "") in new stack
  == Spawn extension (from-pstn, XXXXXXXXXX, 1) exited non-zero on 'PJSIP/VodafoneOutbound-0000008b'
    -- PJSIP/VodafoneOutbound-0000008b Internal Gosub(func-apply-sipheaders,s,1(3)) complete GOSUB_RETVAL=
    -- Called PJSIP/XXXXXXXXXX@VodafoneOutbound
       > 0x7f549c01fb50 -- Strict RTP learning after remote address set to: 10.229.38.180:21700
    -- PJSIP/VodafoneOutbound-0000008b is making progress passing it to PJSIP/2101-0000008a
       > 0x7f53a80401d0 -- Strict RTP learning after remote address set to: 103.233.140.37:55406
       > 0x7f53a80401d0 -- Strict RTP switching to RTP target address 103.233.140.37:55406 as source
       > 0x7f549c01fb50 -- Strict RTP switching to RTP target address 10.229.38.180:21700 as source
    -- PJSIP/VodafoneOutbound-0000008b is making progress passing it to PJSIP/2101-0000008a
    -- PJSIP/VodafoneOutbound-0000008b is making progress passing it to PJSIP/2101-0000008a
    -- PJSIP/VodafoneOutbound-0000008b is ringing
    -- PJSIP/VodafoneOutbound-0000008b answered PJSIP/2101-0000008a
    -- PJSIP/VodafoneOutbound-0000008b Internal Gosub(sub-send-obroute-email,s,1(XXXXXXXXXX,XXXXXXXXXX,3,1636387193,,XXXXXXXXXXX)) start
    -- Executing [s@sub-send-obroute-email:1] GotoIf("PJSIP/VodafoneOutbound-0000008b", "0?sendEmail") in new stack
    -- Executing [s@sub-send-obroute-email:2] NoOp("PJSIP/VodafoneOutbound-0000008b", "email notifications disabled..exiting.") in new stack
    -- Executing [s@sub-send-obroute-email:3] Return("PJSIP/VodafoneOutbound-0000008b", "") in new stack
  == Spawn extension (from-pstn, , 1) exited non-zero on 'PJSIP/VodafoneOutbound-0000008b'
    -- PJSIP/VodafoneOutbound-0000008b Internal Gosub(sub-send-obroute-email,s,1(XXXXXXXXXX,XXXXXXXXXX,3,1636387193,,XXXXXXXXXXX)) complete GOSUB_RETVAL=
[2021-11-08 10:59:58] WARNING[209574][C-00000077]: channel.c:6704 ast_channel_make_compatible_helper: No path to translate from PJSIP/VodafoneOutbound-0000008b to PJSIP/2101-0000008a
[2021-11-08 10:59:58] WARNING[209574][C-00000077]: app_dial.c:3300 dial_exec_full: Had to drop call because I couldn't make PJSIP/2101-0000008a compatible with PJSIP/VodafoneOutbound-0000008b
  == Spawn extension (macro-dialout-trunk, s, 27) exited non-zero on 'PJSIP/2101-0000008a' in macro 'dialout-trunk'
  == Spawn extension (from-internal, XXXXXXXXXX, 10) exited non-zero on 'PJSIP/2101-0000008a'
    -- Executing [h@from-internal:1] Macro("PJSIP/2101-0000008a", "hangupcall") in new stack
    -- Executing [s@macro-hangupcall:1] GotoIf("PJSIP/2101-0000008a", "1?theend") in new stack
    -- Goto (macro-hangupcall,s,3)
    -- Executing [s@macro-hangupcall:3] ExecIf("PJSIP/2101-0000008a", "0?Set(CDR(recordingfile)=)") in new stack
    -- Executing [s@macro-hangupcall:4] NoOp("PJSIP/2101-0000008a", "PJSIP/VodafoneOutbound-0000008b montior file= ") in new stack
    -- Executing [s@macro-hangupcall:5] GotoIf("PJSIP/2101-0000008a", "1?skipagi") in new stack
    -- Goto (macro-hangupcall,s,7)
    -- Executing [s@macro-hangupcall:7] Hangup("PJSIP/2101-0000008a", "") in new stack
  == Spawn extension (macro-hangupcall, s, 7) exited non-zero on 'PJSIP/2101-0000008a' in macro 'hangupcall'
  == Spawn extension (from-internal, h, 1) exited non-zero on 'PJSIP/2101-0000008a'

core show translation 
         Translation times between formats (in microseconds) for one second of data
          Source Format (Rows) Destination Format (Columns)

          codec2  ulaw  alaw   gsm  g726 g726aal2 adpcm slin8 slin12 slin16 slin24 slin32 slin44 slin48 slin96 slin192 lpc10  g729  ilbc  g722 testlaw
   codec2      - 15000 15000 15000 15000    15000 15000  9000  17000  17000  17000  17000  17000  17000  17000   17000 15000 15000 15000 17250   15000
     ulaw  15000     -  9150 15000 15000    15000 15000  9000  17000  17000  17000  17000  17000  17000  17000   17000 15000 15000 15000 17250   15000
     alaw  15000  9150     - 15000 15000    15000 15000  9000  17000  17000  17000  17000  17000  17000  17000   17000 15000 15000 15000 17250   15000
      gsm  15000 15000 15000     - 15000    15000 15000  9000  17000  17000  17000  17000  17000  17000  17000   17000 15000 15000 15000 17250   15000
     g726  15000 15000 15000 15000     -    15000 15000  9000  17000  17000  17000  17000  17000  17000  17000   17000 15000 15000 15000 17250   15000
 g726aal2  15000 15000 15000 15000 15000        - 15000  9000  17000  17000  17000  17000  17000  17000  17000   17000 15000 15000 15000 17250   15000
    adpcm  15000 15000 15000 15000 15000    15000     -  9000  17000  17000  17000  17000  17000  17000  17000   17000 15000 15000 15000 17250   15000
    slin8   6000  6000  6000  6000  6000     6000  6000     -   8000   8000   8000   8000   8000   8000   8000    8000  6000  6000  6000  8250    6000
   slin12  14500 14500 14500 14500 14500    14500 14500  8500      -   8000   8000   8000   8000   8000   8000    8000 14500 14500 14500 14000   14500
   slin16  14500 14500 14500 14500 14500    14500 14500  8500   8500      -   8000   8000   8000   8000   8000    8000 14500 14500 14500  6000   14500
   slin24  14500 14500 14500 14500 14500    14500 14500  8500   8500   8500      -   8000   8000   8000   8000    8000 14500 14500 14500 14500   14500
   slin32  14500 14500 14500 14500 14500    14500 14500  8500   8500   8500   8500      -   8000   8000   8000    8000 14500 14500 14500 14500   14500
   slin44  14500 14500 14500 14500 14500    14500 14500  8500   8500   8500   8500   8500      -   8000   8000    8000 14500 14500 14500 14500   14500
   slin48  14500 14500 14500 14500 14500    14500 14500  8500   8500   8500   8500   8500   8500      -   8000    8000 14500 14500 14500 14500   14500
   slin96  14500 14500 14500 14500 14500    14500 14500  8500   8500   8500   8500   8500   8500   8500      -    8000 14500 14500 14500 14500   14500
  slin192  14500 14500 14500 14500 14500    14500 14500  8500   8500   8500   8500   8500   8500   8500   8500       - 14500 14500 14500 14500   14500
    lpc10  15000 15000 15000 15000 15000    15000 15000  9000  17000  17000  17000  17000  17000  17000  17000   17000     - 15000 15000 17250   15000
     g729  15000 15000 15000 15000 15000    15000 15000  9000  17000  17000  17000  17000  17000  17000  17000   17000 15000     - 15000 17250   15000
     ilbc  15000 15000 15000 15000 15000    15000 15000  9000  17000  17000  17000  17000  17000  17000  17000   17000 15000 15000     - 17250   15000
     g722  15600 15600 15600 15600 15600    15600 15600  9600  17500   9000  17000  17000  17000  17000  17000   17000 15600 15600 15600     -   15600
  testlaw  15000 15000 15000 15000 15000    15000 15000  9000  17000  17000  17000  17000  17000  17000  17000   17000 15000 15000 15000 17250       -

I wasn’t expecting it to fix things, but it is an unnecessary complication normally only seen amongst FreePBX users.

Your trace has no SIP and SDP at all. I’m really not interested in the FreePBX dialplan. Any problem with that should be addressed on the FreePBX forum.

You do have a translation paths between G.729 and G.711, so should only be limited by available licences, if G.711 is actually being used.

Guys i was finally able to fix this. I was reluctant to buy more licenses since I was not sure if it was the reason for the calls to fail in one direction. I started searching for the opensource g729 codes and got it installed. I moved the existing licensed codec to a safe place and replaced the codes in this manner.

wget http://asterisk.hosting.lv/bin/codec_g729-ast160-gcc4-glibc-x86_64-core2-sse4.so
ll
cp codec_g729-ast160-gcc4-glibc-x86_64-core2-sse4.so /usr/lib64/asterisk/modules/codec_g729.so
chmod 777 /usr/lib64/asterisk/modules/codec_g729.so
service asterisk restart

Calls started working in both directions without problems. I am curious if having a licensed version of g729 codec will give me a better sound quality. I have no idea.

Make sure you do not use the optimised code, as the licence for that is incompatible with any licence meeting the open source definition. It’s basically provided by the chip manufacturer as evaluation code, with a no redistribution condition. I’m not sure if the Latvian one now includes code written in a clean room environment, as well, but it used to have the no commercial use code as the only option, and simultaneously claim to be licensed under the GPL, which simply possible.

I think it is Intel that owns the rights to the optimised code but I’d need to check that.