Asterisk - pass audio from carrier directly to endpoint

Hi,
I am trying to set up my Asterisk 1.6.2.6 as just a switch and let it pass audio from the carrier to my customers. This works great when directrtpsetup is set to yes in sip.conf and canreinvite=yes is present in the provider’s and peer’s trunk.

In the provider trunks I commented out disallow=all and all the “allow” stuff so that it can be set by the peer. The problem is that if the peer sends out, for example, g729, somehow, asterisk is saying “I like ulaw better” and ends up using ulaw for the provider. This of course causes one way audio. sip.conf has no codec preference established. There are no values at all that have disallow=all and allow=whatever.

Can someone point out what I am doing wrong?

I even tried completely taking away the codec from the peer settings as well, but that made no difference at all. I tried other combinations too, like putting back the codec preferences in the trunk, but still no luck. Unless I am forcing just one codec, what I am trying to accomplish is not working. I thought that this would be simple since a lot of carriers have success with doing this and working with multiple codecs.

Thank you in advance for any help

bump

The default codec set is empty. You need an allow.

Thanks

I set the trunks to allow ulaw and g729 and it does the same thing. I tried it with and without “disallow=all” and it did not seem to make a difference. The endpoint is still unable to choose their own codec without having any issues :frowning:
is there anything else I can look into?

no one?

My guess is that none of the few people who follow the forum have seen the problem themselves. You need to provide detailed debugging information, so that one can see what is actually happening. At the least, sip set debug on with reasonable debug and verbosity levels.

Here is a debug of my “wannabe” switch to my voip provider and trunk settings. I did also try type=peer:

[voipinnovations]
;disallow=all
type=friend
qualify=yes
insecure=invite
host=x
fromdomain=x
trustrpid=yes
sendrpid=yes
context=inbound
canreinvite=yes
;allow=ulaw
;allow=g729


SIP Debugging Enabled for IP: 64.136.x.x:5060
  == Using SIP RTP CoS mark 5
    -- Executing [1718xxxxxxx@a2billing-sip:1] NoOp("SIP/066159787944-00001ca7", "") in new stack
    -- Executing [1718xxxxxxx@a2billing-sip:2] DeadAGI("SIP/066159787944-00001ca7", "a2billing.php,4") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/a2billing.php
    -- AGI Script Executing Application: (DIAL) Options: (SIP/voipinnovations/+1718xxxxxxx,180,RL(24000000:61000:30000))
    -- Limit Data for this call:
  == Using SIP RTP CoS mark 5
Audio is at 184.106.x.x port 14534
Adding codec 0x100 (g729) to SDP
Adding codec 0x4 (ulaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (no NAT) to 64.136.x.x:5060:
INVITE sip:+1718xxxxxxx@64.136.x.x SIP/2.0
Via: SIP/2.0/UDP 184.106.x.x:5060;branch=z9hG4bK520877b9;rport
Max-Forwards: 70
From: "Junction Connections" <sip:1212796xxxx@64.136.x.x>;tag=as4b4cecc8
To: <sip:+1718xxxxxxx@64.136.x.x>
Contact: <sip:1212796xxxx@184.106.x.x>
Call-ID: 61d16d823a9dfca02768180765923d11@64.136.x.x
CSeq: 102 INVITE
User-Agent: Asterisk PBX 1.6.2.6
Remote-Party-ID: "Junction Connections" <sip:1212796xxxx@64.136.x.x>;privacy=off;screen=no
Date: Tue, 25 Jan 2011 23:59:18 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 316

v=0
o=root 1060843801 1060843801 IN IP4 184.106.228.165
s=Asterisk PBX 1.6.2.6
c=IN IP4 184.106.228.165
t=0 0
m=audio 11674 RTP/AVP 18 0 101
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

---
    -- Called voipinnovations/+1718xxxxxxx
sip4*CLI> 
<--- SIP read from UDP:64.136.x.x:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 184.106.x.x:5060;branch=z9hG4bK520877b9;rport=5060
To: <sip:+1718xxxxxxx@64.136.x.x>
From: "Junction Connections" <sip:1212796xxxx@64.136.x.x>;tag=as4b4cecc8
Call-ID: 61d16d823a9dfca02768180765923d11@64.136.x.x
CSeq: 102 INVITE
Content-Length: 0


<------------->
--- (7 headers 0 lines) ---
sip4*CLI> 
<--- SIP read from UDP:64.136.x.x:5060 --->
SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP 184.106.x.x:5060;branch=z9hG4bK520877b9;rport=5060
Record-Route: <sip:sansay484083311rdb1487@64.136.x.x:5060;lr;transport=udp>
To: <sip:+1718xxxxxxx@64.136.x.x>;tag=sansay484083311rdb1487
From: "Junction Connections" <sip:1212796xxxx@64.136.x.x>;tag=as4b4cecc8
Call-ID: 61d16d823a9dfca02768180765923d11@64.136.x.x
CSeq: 102 INVITE
Contact: <sip:+1718xxxxxxx@64.136.x.x:5060>
Content-Type: application/sdp
Content-Length: 226

v=0
o=Sansay-VSXi 188 1 IN IP4 64.136.x.x
s=Session Controller
c=IN IP4 208.93.226.5
t=0 0
m=audio 24746 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
a=ptime:20

<------------->
--- (10 headers 11 lines) ---
Found RTP audio format 0
Found RTP audio format 101
Found audio description format PCMU for ID 0
Found audio description format telephone-event for ID 101
Capabilities: us - 0x104 (ulaw|g729), peer - audio=0x4 (ulaw)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0x4 (ulaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x1 (telephone-event), combined - 0x1 (telephone-event)
Peer audio RTP is at port 208.93.226.5:24746
    -- SIP/voipinnovations-00001ca8 is making progress passing it to SIP/066159787944-00001ca7
sip4*CLI> sip show channels
Peer             User/ANR         Call ID          Format           Hold     Last Message    Expiry
64.136.x.x    +1718xxxxxxx     61d16d823a9dfca  0x4 (ulaw)       No       Init: INVITE              
72.69.140.x    (None)           11a13d2168b840d  0x0 (nothing)    No       Rx: OPTIONS               
216.254.x.x  (None)           6f7b04087b8d77f  0x0 (nothing)    No       Rx: REGISTER              
184.106.x.x  066159787944     64e362fd56b6133  0x100 (g729)     No       Rx: INVITE                
97.91.77.x     (None)           51993a4a253498a  0x0 (nothing)    No       Rx: REGISTER              
69.117.55.x     (None)           3ae331a93681b35  0x0 (nothing)    No       Rx: REGISTER              
7 active SIP dialogs
Scheduling destruction of SIP dialog '61d16d823a9dfca02768180765923d11@64.136.x.x' in 6400 ms (Method: INVITE)
Reliably Transmitting (no NAT) to 64.136.x.x:5060:
CANCEL sip:+1718xxxxxxx@64.136.x.x SIP/2.0
Via: SIP/2.0/UDP 184.106.x.x:5060;branch=z9hG4bK520877b9;rport
Max-Forwards: 70
From: "Junction Connections" <sip:1212796xxxx@64.136.x.x>;tag=as4b4cecc8
To: <sip:+1718xxxxxxx@64.136.x.x>
Call-ID: 61d16d823a9dfca02768180765923d11@64.136.x.x
CSeq: 102 CANCEL
User-Agent: Asterisk PBX 1.6.2.6
Remote-Party-ID: "Junction Connections" <sip:1212796xxxx@64.136.x.x>;privacy=off;screen=no
Content-Length: 0


---
Scheduling destruction of SIP dialog '61d16d823a9dfca02768180765923d11@64.136.x.x' in 6400 ms (Method: INVITE)
    -- <SIP/066159787944-00001ca7>AGI Script a2billing.php completed, returning -1
sip4*CLI> 
<--- SIP read from UDP:64.136.x.x:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 184.106.x.x:5060;branch=z9hG4bK520877b9;rport=5060
To: <sip:+1718xxxxxxx@64.136.x.x>;tag=sansay484083311rdb1487
From: "Junction Connections" <sip:1212796xxxx@64.136.x.x>;tag=as4b4cecc8
Call-ID: 61d16d823a9dfca02768180765923d11@64.136.x.x
CSeq: 102 CANCEL
Content-Length: 0


<------------->
--- (7 headers 0 lines) ---
sip4*CLI> 
<--- SIP read from UDP:64.136.x.x:5060 --->
SIP/2.0 487 transaction terminated
Via: SIP/2.0/UDP 184.106.x.x:5060;branch=z9hG4bK520877b9;rport=5060
To: <sip:+1718xxxxxxx@64.136.x.x>;tag=sansay484083311rdb1487
From: "Junction Connections" <sip:1212796xxxx@64.136.x.x>;tag=as4b4cecc8
Call-ID: 61d16d823a9dfca02768180765923d11@64.136.x.x
CSeq: 102 INVITE
Content-Length: 0


<------------->
--- (7 headers 0 lines) ---
Transmitting (no NAT) to 64.136.x.x:5060:
ACK sip:+1718xxxxxxx@64.136.x.x SIP/2.0
Via: SIP/2.0/UDP 184.106.x.x:5060;branch=z9hG4bK520877b9;rport
Max-Forwards: 70
From: "Junction Connections" <sip:1212796xxxx@64.136.x.x>;tag=as4b4cecc8
To: <sip:+1718xxxxxxx@64.136.x.x>;tag=sansay484083311rdb1487
Contact: <sip:1212796xxxx@184.106.x.x>
Call-ID: 61d16d823a9dfca02768180765923d11@64.136.x.x
CSeq: 102 ACK
User-Agent: Asterisk PBX 1.6.2.6
Remote-Party-ID: "Junction Connections" <sip:1212796xxxx@64.136.x.x>;privacy=off;screen=no
Content-Length: 0


---
Really destroying SIP dialog '61d16d823a9dfca02768180765923d11@64.136.x.x' Method: INVITE
sip4*CLI> sip set debug off

Here is a debug from my PBX with asterisk 1.4


pbx1*CLI> sip set debug peer JunctionConnections
SIP Debugging Enabled for IP: 184.106.x.170:5060
    -- Executing [1718637xxxx@from-internal:1] Macro("SIP/334-0000057b", "user-callerid|SKIPTTL|") in new stack
    -- Executing [s@macro-user-callerid:1] Set("SIP/334-0000057b", "AMPUSER=334") in new stack
    -- Executing [s@macro-user-callerid:2] GotoIf("SIP/334-0000057b", "0?report") in new stack
    -- Executing [s@macro-user-callerid:3] ExecIf("SIP/334-0000057b", "1|Set|REALCALLERIDNUM=334") in new stack
    -- Executing [s@macro-user-callerid:4] Set("SIP/334-0000057b", "AMPUSER=334") in new stack
    -- Executing [s@macro-user-callerid:5] Set("SIP/334-0000057b", "AMPUSERCIDNAME=Test") in new stack
    -- Executing [s@macro-user-callerid:6] GotoIf("SIP/334-0000057b", "0?report") in new stack
    -- Executing [s@macro-user-callerid:7] Set("SIP/334-0000057b", "AMPUSERCID=334") in new stack
    -- Executing [s@macro-user-callerid:8] Set("SIP/334-0000057b", "CALLERID(all)="Test" <334>") in new stack
    -- Executing [s@macro-user-callerid:9] GotoIf("SIP/334-0000057b", "1?continue") in new stack
    -- Goto (macro-user-callerid,s,18)
    -- Executing [s@macro-user-callerid:18] NoOp("SIP/334-0000057b", "Using CallerID "Test" <334>") in new stack
    -- Executing [1718637xxxx@from-internal:2] ExecIf("SIP/334-0000057b", "1|Set|TRUNKCIDOVERRIDE="Junction Connections" <1212796xxxx>") in new stack
    -- Executing [1718637xxxx@from-internal:3] Set("SIP/334-0000057b", "_NODEST=") in new stack
    -- Executing [1718637xxxx@from-internal:4] Macro("SIP/334-0000057b", "record-enable|334|OUT|") in new stack
    -- Executing [s@macro-record-enable:1] GotoIf("SIP/334-0000057b", "1?check") in new stack
    -- Goto (macro-record-enable,s,4)
    -- Executing [s@macro-record-enable:4] ExecIf("SIP/334-0000057b", "0|MacroExit|") in new stack
    -- Executing [s@macro-record-enable:5] GotoIf("SIP/334-0000057b", "0?Group:OUT") in new stack
    -- Goto (macro-record-enable,s,15)
    -- Executing [s@macro-record-enable:15] GotoIf("SIP/334-0000057b", "0?IN") in new stack
    -- Executing [s@macro-record-enable:16] ExecIf("SIP/334-0000057b", "1|MacroExit|") in new stack
    -- Executing [1718637xxxx@from-internal:5] Macro("SIP/334-0000057b", "dialout-trunk|2|1718637xxxx||") in new stack
    -- Executing [s@macro-dialout-trunk:1] Set("SIP/334-0000057b", "DIAL_TRUNK=2") in new stack
    -- Executing [s@macro-dialout-trunk:2] GosubIf("SIP/334-0000057b", "0?sub-pincheck|s|1") in new stack
    -- Executing [s@macro-dialout-trunk:3] GotoIf("SIP/334-0000057b", "0?disabletrunk|1") in new stack
    -- Executing [s@macro-dialout-trunk:4] Set("SIP/334-0000057b", "DIAL_NUMBER=1718637xxxx") in new stack
    -- Executing [s@macro-dialout-trunk:5] Set("SIP/334-0000057b", "DIAL_TRUNK_OPTIONS=tr") in new stack
    -- Executing [s@macro-dialout-trunk:6] Set("SIP/334-0000057b", "OUTBOUND_GROUP=OUT_2") in new stack
    -- Executing [s@macro-dialout-trunk:7] GotoIf("SIP/334-0000057b", "1?nomax") in new stack
    -- Goto (macro-dialout-trunk,s,9)
    -- Executing [s@macro-dialout-trunk:9] GotoIf("SIP/334-0000057b", "0?skipoutcid") in new stack
    -- Executing [s@macro-dialout-trunk:10] Set("SIP/334-0000057b", "DIAL_TRUNK_OPTIONS=") in new stack
    -- Executing [s@macro-dialout-trunk:11] Macro("SIP/334-0000057b", "outbound-callerid|2") in new stack
    -- Executing [s@macro-outbound-callerid:1] ExecIf("SIP/334-0000057b", "0|SetCallerPres|") in new stack
    -- Executing [s@macro-outbound-callerid:2] ExecIf("SIP/334-0000057b", "0|Set|REALCALLERIDNUM=334") in new stack
    -- Executing [s@macro-outbound-callerid:3] GotoIf("SIP/334-0000057b", "1?normcid") in new stack
    -- Goto (macro-outbound-callerid,s,6)
    -- Executing [s@macro-outbound-callerid:6] Set("SIP/334-0000057b", "USEROUTCID=") in new stack
    -- Executing [s@macro-outbound-callerid:7] Set("SIP/334-0000057b", "EMERGENCYCID=") in new stack
    -- Executing [s@macro-outbound-callerid:8] Set("SIP/334-0000057b", "TRUNKOUTCID=") in new stack
    -- Executing [s@macro-outbound-callerid:9] GotoIf("SIP/334-0000057b", "1?trunkcid") in new stack
    -- Goto (macro-outbound-callerid,s,12)
    -- Executing [s@macro-outbound-callerid:12] ExecIf("SIP/334-0000057b", "0|Set|CALLERID(all)=") in new stack
    -- Executing [s@macro-outbound-callerid:13] ExecIf("SIP/334-0000057b", "0|Set|CALLERID(all)=") in new stack
    -- Executing [s@macro-outbound-callerid:14] ExecIf("SIP/334-0000057b", "1|Set|CALLERID(all)=Junction Connections <1212796xxxx>") in new stack
    -- Executing [s@macro-outbound-callerid:15] ExecIf("SIP/334-0000057b", "0|SetCallerPres|prohib_passed_screen") in new stack
    -- Executing [s@macro-dialout-trunk:12] ExecIf("SIP/334-0000057b", "1|AGI|fixlocalprefix") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/fixlocalprefix
    -- AGI Script fixlocalprefix completed, returning 0
    -- Executing [s@macro-dialout-trunk:13] Set("SIP/334-0000057b", "OUTNUM=1718637xxxx") in new stack
    -- Executing [s@macro-dialout-trunk:14] Set("SIP/334-0000057b", "custom=SIP/JunctionConnections") in new stack
    -- Executing [s@macro-dialout-trunk:15] ExecIf("SIP/334-0000057b", "0|Set|DIAL_TRUNK_OPTIONS=M(setmusic^)") in new stack
    -- Executing [s@macro-dialout-trunk:16] Macro("SIP/334-0000057b", "dialout-trunk-predial-hook|") in new stack
    -- Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit("SIP/334-0000057b", "") in new stack
    -- Executing [s@macro-dialout-trunk:17] GotoIf("SIP/334-0000057b", "0?bypass|1") in new stack
    -- Executing [s@macro-dialout-trunk:18] GotoIf("SIP/334-0000057b", "0?customtrunk") in new stack
    -- Executing [s@macro-dialout-trunk:19] Dial("SIP/334-0000057b", "SIP/JunctionConnections/1718637xxxx|300|") in new stack
Audio is at 184.106.228.x port 11674
Adding codec 0x100 (g729) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 184.106.x.170:5060:
INVITE sip:1718637xxxx@sip4.jcnt.net SIP/2.0
Via: SIP/2.0/UDP 184.106.228.x:5060;branch=z9hG4bK223d58df;rport
From: "Junction Connections" <sip:1212796xxxx@184.106.228.x>;tag=as310196c5
To: <sip:1718637xxxx@sip4.jcnt.net>
Contact: <sip:1212796xxxx@184.106.228.x>
Call-ID: 64e362fd56b6133e4dcb9f0c3e29454e@184.106.228.x
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Max-Forwards: 70
Remote-Party-ID: "Junction Connections" <sip:1212796xxxx@184.106.228.x>;privacy=off;screen=no
Date: Tue, 25 Jan 2011 23:59:19 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces
Content-Type: application/sdp
Content-Length: 240

v=0
o=root 1259 1259 IN IP4 184.106.228.x
s=session
c=IN IP4 184.106.228.x
t=0 0
m=audio 11674 RTP/AVP 18 101
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv

---
    -- Called JunctionConnections/1718637xxxx

<--- SIP read from 184.106.x.170:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 184.106.228.x:5060;branch=z9hG4bK223d58df;received=184.106.228.x;rport=5060
From: "Junction Connections" <sip:1212796xxxx@184.106.228.x>;tag=as310196c5
To: <sip:1718637xxxx@sip4.jcnt.net>;tag=as2f700bff
Call-ID: 64e362fd56b6133e4dcb9f0c3e29454e@184.106.228.x
CSeq: 102 INVITE
Server: Asterisk PBX 1.6.2.6
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="038fb4bc"
Content-Length: 0


<------------->
--- (11 headers 0 lines) ---
Transmitting (NAT) to 184.106.x.170:5060:
ACK sip:1718637xxxx@sip4.jcnt.net SIP/2.0
Via: SIP/2.0/UDP 184.106.228.x:5060;branch=z9hG4bK223d58df;rport
From: "Junction Connections" <sip:1212796xxxx@184.106.228.x>;tag=as310196c5
To: <sip:1718637xxxx@sip4.jcnt.net>;tag=as2f700bff
Contact: <sip:1212796xxxx@184.106.228.x>
Call-ID: 64e362fd56b6133e4dcb9f0c3e29454e@184.106.228.x
CSeq: 102 ACK
User-Agent: Asterisk PBX
Max-Forwards: 70
Remote-Party-ID: "Junction Connections" <sip:1212796xxxx@184.106.228.x>;privacy=off;screen=no
Content-Length: 0


---
Audio is at 184.106.228.x port 11674
Adding codec 0x100 (g729) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 184.106.x.170:5060:
INVITE sip:1718637xxxx@sip4.jcnt.net SIP/2.0
Via: SIP/2.0/UDP 184.106.228.x:5060;branch=z9hG4bK134e8f72;rport
From: "Junction Connections" <sip:1212796xxxx@184.106.228.x>;tag=as310196c5
To: <sip:1718637xxxx@sip4.jcnt.net>
Contact: <sip:1212796xxxx@184.106.228.x>
Call-ID: 64e362fd56b6133e4dcb9f0c3e29454e@184.106.228.x
CSeq: 103 INVITE
User-Agent: Asterisk PBX
Max-Forwards: 70
Remote-Party-ID: "Junction Connections" <sip:1212796xxxx@184.106.228.x>;privacy=off;screen=no
Authorization: Digest username="066159787944", realm="asterisk", algorithm=MD5, uri="sip:1718637xxxx@sip4.jcnt.net", nonce="038fb4bc", response="feb0144c804894a0170dd2ae4ef8d3d3"
Date: Tue, 25 Jan 2011 23:59:19 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces
Content-Type: application/sdp
Content-Length: 240

v=0
o=root 1259 1260 IN IP4 184.106.228.x
s=session
c=IN IP4 184.106.228.x
t=0 0
m=audio 11674 RTP/AVP 18 101
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv

---

<--- SIP read from 184.106.x.170:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 184.106.228.x:5060;branch=z9hG4bK134e8f72;received=184.106.228.x;rport=5060
From: "Junction Connections" <sip:1212796xxxx@184.106.228.x>;tag=as310196c5
To: <sip:1718637xxxx@sip4.jcnt.net>
Call-ID: 64e362fd56b6133e4dcb9f0c3e29454e@184.106.228.x
CSeq: 103 INVITE
Server: Asterisk PBX 1.6.2.6
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Contact: <sip:1718637xxxx@184.106.x.170>
Content-Length: 0


<------------->
--- (11 headers 0 lines) ---

<--- SIP read from 184.106.x.170:5060 --->
SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP 184.106.228.x:5060;branch=z9hG4bK134e8f72;received=184.106.228.x;rport=5060
From: "Junction Connections" <sip:1212796xxxx@184.106.228.x>;tag=as310196c5
To: <sip:1718637xxxx@sip4.jcnt.net>;tag=as69a9922e
Call-ID: 64e362fd56b6133e4dcb9f0c3e29454e@184.106.228.x
CSeq: 103 INVITE
Server: Asterisk PBX 1.6.2.6
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Contact: <sip:1718637xxxx@184.106.x.170>
Content-Type: application/sdp
Content-Length: 292

v=0
o=root 1500199009 1500199009 IN IP4 184.106.x.170
s=Asterisk PBX 1.6.2.6
c=IN IP4 184.106.x.170
t=0 0
m=audio 13644 RTP/AVP 18 101
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

<------------->
--- (12 headers 13 lines) ---
Found RTP audio format 18
Found RTP audio format 101
Found audio description format G729 for ID 18
Found audio description format telephone-event for ID 101
Capabilities: us - 0x100 (g729), peer - audio=0x100 (g729)/video=0x0 (nothing), combined - 0x100 (g729)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x1 (telephone-event), combined - 0x1 (telephone-event)
Peer audio RTP is at port 184.106.x.170:13644
    -- SIP/JunctionConnections-0000057c is making progress passing it to SIP/334-0000057b
pbx1*CLI> sip show channels
Peer             User/ANR         Call ID      Seq (Tx/Rx)  Format           Hold     Last Message   
184.106.x.170  1718637xxxx      64e362fd56b  00103/00000  0x100 (g729)     No       Tx: INVITE                
24.185.0.150     334              MDRhMWVmMGQ  00101/00002  0x4 (ulaw)       No       Rx: INVITE                
2 active SIP channels
Scheduling destruction of SIP dialog '64e362fd56b6133e4dcb9f0c3e29454e@184.106.228.x' in 6400 ms (Method: INVITE)
Reliably Transmitting (NAT) to 184.106.x.170:5060:
CANCEL sip:1718637xxxx@sip4.jcnt.net SIP/2.0
Via: SIP/2.0/UDP 184.106.228.x:5060;branch=z9hG4bK134e8f72;rport
From: "Junction Connections" <sip:1212796xxxx@184.106.228.x>;tag=as310196c5
To: <sip:1718637xxxx@sip4.jcnt.net>
Call-ID: 64e362fd56b6133e4dcb9f0c3e29454e@184.106.228.x
CSeq: 103 CANCEL
User-Agent: Asterisk PBX
Max-Forwards: 70
Remote-Party-ID: "Junction Connections" <sip:1212796xxxx@184.106.228.x>;privacy=off;screen=no
Content-Length: 0


---
Scheduling destruction of SIP dialog '64e362fd56b6133e4dcb9f0c3e29454e@184.106.228.x' in 6400 ms (Method: INVITE)
  == Spawn extension (macro-dialout-trunk, s, 19) exited non-zero on 'SIP/334-0000057b' in macro 'dialout-trunk'
  == Spawn extension (from-internal, 1718637xxxx, 5) exited non-zero on 'SIP/334-0000057b'
    -- Executing [h@macro-dialout-trunk:1] Macro("SIP/334-0000057b", "hangupcall|") in new stack
    -- Executing [s@macro-hangupcall:1] GotoIf("SIP/334-0000057b", "1?skiprg") in new stack
    -- Goto (macro-hangupcall,s,4)

<--- SIP read from 184.106.x.170:5060 --->
SIP/2.0 487 Request Terminated
Via: SIP/2.0/UDP 184.106.228.x:5060;branch=z9hG4bK134e8f72;received=184.106.228.x;rport=5060
From: "Junction Connections" <sip:1212796xxxx@184.106.228.x>;tag=as310196c5
To: <sip:1718637xxxx@sip4.jcnt.net>;tag=as69a9922e
Call-ID: 64e362fd56b6133e4dcb9f0c3e29454e@184.106.228.x
CSeq: 103 INVITE
Server: Asterisk PBX 1.6.2.6
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Content-Length: 0


<------------->
--- (10 headers 0 lines) ---
Transmitting (NAT) to 184.106.x.170:5060:
ACK sip:1718637xxxx@sip4.jcnt.net SIP/2.0
Via: SIP/2.0/UDP 184.106.228.x:5060;branch=z9hG4bK134e8f72;rport
From: "Junction Connections" <sip:1212796xxxx@184.106.228.x>;tag=as310196c5
To: <sip:1718637xxxx@sip4.jcnt.net>;tag=as69a9922e
Contact: <sip:1212796xxxx@184.106.228.x>
Call-ID: 64e362fd56b6133e4dcb9f0c3e29454e@184.106.228.x
CSeq: 103 ACK
User-Agent: Asterisk PBX
Max-Forwards: 70
Remote-Party-ID: "Junction Connections" <sip:1212796xxxx@184.106.228.x>;privacy=off;screen=no
Content-Length: 0


---

<--- SIP read from 184.106.x.170:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 184.106.228.x:5060;branch=z9hG4bK134e8f72;received=184.106.228.x;rport=5060
From: "Junction Connections" <sip:1212796xxxx@184.106.228.x>;tag=as310196c5
To: <sip:1718637xxxx@sip4.jcnt.net>;tag=as69a9922e
Call-ID: 64e362fd56b6133e4dcb9f0c3e29454e@184.106.228.x
CSeq: 103 CANCEL
Server: Asterisk PBX 1.6.2.6
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Content-Length: 0


<------------->
--- (10 headers 0 lines) ---
    -- Executing [s@macro-hangupcall:4] GotoIf("SIP/334-0000057b", "1?skipblkvm") in new stack
    -- Goto (macro-hangupcall,s,7)
    -- Executing [s@macro-hangupcall:7] GotoIf("SIP/334-0000057b", "1?theend") in new stack
    -- Goto (macro-hangupcall,s,9)
    -- Executing [s@macro-hangupcall:9] Hangup("SIP/334-0000057b", "") in new stack
  == Spawn extension (macro-hangupcall, s, 9) exited non-zero on 'SIP/334-0000057b' in macro 'hangupcall'
  == Spawn extension (macro-dialout-trunk, h, 1) exited non-zero on 'SIP/334-0000057b'
Really destroying SIP dialog '64e362fd56b6133e4dcb9f0c3e29454e@184.106.228.x' Method: INVITE
pbx1*CLI> sip set debug off
SIP Debugging Disabled
pbx1*CLI> 
Disconnected from Asterisk server
Executing last minute cleanups

In 1.6, Asterisk is offering a choice of both G.729 and G.711 Mu-law. There appears to be a preference for G.729. The peer is restricting this to G.711. I’d say the problem lies with the peer, as it should offer all the compatible ones it supports, which would then allow the codec to be changed, mid-call, at the RTP level.

On 1.4, it is only offering G.729, which is probably wrong.

Thanks
What if the peer only wants to use g729?

There are no codecs defined in the peer settings, yet for some reason it chooses ulaw as a preference

Even with the codec preferences filtered out, sip set peer voipinnovations shows ulaw and g729 but doesn’t specify a preferred codec

Codecs : 0x104 (ulaw|g729)
Codec Order : (none)

I don’t want a “preferred” codec I just want the endpoint to choose whatever codec they feel comfortable with or even play around with different codecs for different destinations.

Thanks again

Then it should only offer that codec. It appears that it only wants to use G.711.

What’s “it”? Asterisk has preferred G.729, but also given G.711 as an alternative. The remote system has preferred G.711, and given no alternative.

The end point has; it is most comfortable with G.711 Mu-Law.

What would be the “best way” to program both asterisk machines so I can have this working as expected?
On 1.4, disallow=all followed by allow=g729 is set and for some reason asterisk is still seeing ulaw first. If I can be guided to specific instructions, hopefully that will solve everything

I do want to point out that when I forced g729 on the 1.6 side (on the peer’s interconnect settings), voip innovations was sending incoming calls as ulaw even though the peer only showed g729 as an option. When I set disallow=all and allow=g729 on the voip innovations trunk, everything works as expected, but then of course it messes up the calls for those trying to use ulaw.

Thank you again

You didn’t mention 1.4 until you provided the traces, and even later you seem to imply you have a 1.4 connected to a 1.6. We seem to be missing some topology information.

Are you maybe missing half the traces. The 1.4 trace only shows one leg. On that leg, Asterisk only offers G.729 and the remote party only offers G.729. The 1.6 trace also only shows one leg, in which 64.136.x.x:5060 is offered a choice of both codecs, but chooses to only use G.711.

For 1.6 Asterisk’s offer is

m=audio 11674 RTP/AVP 18 0 101
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000

and the remote counter offer is

m=audio 24746 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000

Clearly it is the remote system that is constraining the choice of codecs.

I understand now
Is there anything else on the 1.4 that I can check out except trunks settings and sip.conf to see why ulaw is being requested?