Forcing G722 codec

I’m trying to force protocol negotiation in some scenarios, in particular g722 when calling between extensions. I’m using Set(SIP_CODEC_INBOUND=g722) but the phones drop the connection saying “Bearer capability not available”. If I don’t set it and just set g722 at the highest priority for the peers then g722 works fine. The problem is then all outbound calls get transcoded from g722 to ulaw or g729 which I’m trying to avoid.

Any ideas what might be causing it? This is using an ael script to dial if that makes any difference.


<--- SIP read from UDP:endpointIP:1073 --->
INVITE sip:313@***.*****.com:5060;user=phone SIP/2.0
Via: SIP/2.0/UDP 10.1.11.19:5060;branch=z9hG4bK765da8e7BF565C0C
From: "312" <sip:312@***.*****.com>;tag=31C378D7-46C5FF1C
To: <sip:313@***.*****.com;user=phone>
CSeq: 1 INVITE
Call-ID: a00d4ef7-ca1122fc-dd38ab07@10.1.11.19
Contact: <sip:312@10.1.11.19:5060>
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
User-Agent: PolycomVVX-VVX_410-UA/4.1.6.5374
Accept-Language: en
Supported: 100rel,replaces
Allow-Events: conference,talk,hold
Max-Forwards: 70
Content-Type: application/sdp
Content-Length: 266

v=0
o=- 1405588010 1405588010 IN IP4 10.1.11.19
s=Polycom IP Phone
c=IN IP4 10.1.11.19
t=0 0
a=sendrecv
m=audio 2230 RTP/AVP 9 0 18 127
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:127 telephone-event/8000
<------------->
--- (15 headers 12 lines) ---
Sending to endpointIP:1073 (NAT)
Sending to endpointIP:1073 (NAT)
Using INVITE request as basis request - a00d4ef7-ca1122fc-dd38ab07@10.1.11.19
Found peer '312' for '312' from endpointIP:1073

<--- Reliably Transmitting (NAT) to endpointIP:1073 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 10.1.11.19:5060;branch=z9hG4bK765da8e7BF565C0C;received=endpointIP;rport=1073
From: "312" <sip:312@***.*****.com>;tag=31C378D7-46C5FF1C
To: <sip:313@***.*****.com;user=phone>;tag=as536610a2
Call-ID: a00d4ef7-ca1122fc-dd38ab07@10.1.11.19
CSeq: 1 INVITE
Server: Asterisk PBX 12.2.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="hunternet", nonce="26f08eef"
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog 'a00d4ef7-ca1122fc-dd38ab07@10.1.11.19' in 6400 ms (Method: INVITE)

<--- SIP read from UDP:endpointIP:1073 --->
ACK sip:313@***.*****.com:5060;user=phone SIP/2.0
Via: SIP/2.0/UDP 10.1.11.19:5060;branch=z9hG4bK765da8e7BF565C0C
From: "312" <sip:312@***.*****.com>;tag=31C378D7-46C5FF1C
To: <sip:313@***.*****.com;user=phone>;tag=as536610a2
CSeq: 1 ACK
Call-ID: a00d4ef7-ca1122fc-dd38ab07@10.1.11.19
Contact: <sip:312@10.1.11.19:5060>
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
User-Agent: PolycomVVX-VVX_410-UA/4.1.6.5374
Accept-Language: en
Max-Forwards: 70
Content-Length: 0

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

<--- SIP read from UDP:endpointIP:1073 --->
INVITE sip:313@***.*****.com:5060;user=phone SIP/2.0
Via: SIP/2.0/UDP 10.1.11.19:5060;branch=z9hG4bKc9a413ec7A5DFD17
From: "312" <sip:312@***.*****.com>;tag=31C378D7-46C5FF1C
To: <sip:313@***.*****.com;user=phone>
CSeq: 2 INVITE
Call-ID: a00d4ef7-ca1122fc-dd38ab07@10.1.11.19
Contact: <sip:312@10.1.11.19:5060>
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
User-Agent: PolycomVVX-VVX_410-UA/4.1.6.5374
Accept-Language: en
Supported: 100rel,replaces
Allow-Events: conference,talk,hold
Authorization: Digest username="312", realm="hunternet", nonce="26f08eef", uri="sip:313@***.*****.com:5060;user=phone", response="88ab37d91f4c8ea44f27fcf1c752d24f", algorithm=MD5
Max-Forwards: 70
Content-Type: application/sdp
Content-Length: 266

v=0
o=- 1405588010 1405588010 IN IP4 10.1.11.19
s=Polycom IP Phone
c=IN IP4 10.1.11.19
t=0 0
a=sendrecv
m=audio 2230 RTP/AVP 9 0 18 127
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:127 telephone-event/8000
<------------->
--- (16 headers 12 lines) ---
Sending to endpointIP:1073 (NAT)
Using INVITE request as basis request - a00d4ef7-ca1122fc-dd38ab07@10.1.11.19
Found peer '312' for '312-CORPaSIGNS' from endpointIP:1073
Found RTP audio format 9
Found RTP audio format 0
Found RTP audio format 18
Found RTP audio format 127
Found audio description format G722 for ID 9
Found audio description format PCMU for ID 0
Found audio description format G729 for ID 18
Found audio description format telephone-event for ID 127
Capabilities: us - (ulaw|g729|g722), peer - audio=(ulaw|g729|g722)/video=(nothing)/text=(nothing), combined - (ulaw|g729|g722)
Non-codec capabilities (dtmf): us - 0x0 (nothing), peer - 0x1 (telephone-event|), combined - 0x0 (nothing)
Peer audio RTP is at port 10.1.11.19:2230
Looking for 313 in authenticated (domain ***.*****.com)
list_route: route/path hop: <sip:312@10.1.11.19:5060>

<--- Transmitting (NAT) to endpointIP:1073 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.1.11.19:5060;branch=z9hG4bKc9a413ec7A5DFD17;received=endpointIP;rport=1073
From: "312" <sip:312@***.*****.com>;tag=31C378D7-46C5FF1C
To: <sip:313@***.*****.com;user=phone>
Call-ID: a00d4ef7-ca1122fc-dd38ab07@10.1.11.19
CSeq: 2 INVITE
Server: Asterisk PBX 12.2.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: <sip:313@asteriskpublicip:5060>
Content-Length: 0


<------------>
Audio is at 13428
Adding codec 100003 (ulaw) to SDP
Adding codec 100012 (g722) to SDP
Reliably Transmitting (NAT) to endpointIP:5060:
INVITE sip:313@10.1.11.20:5060 SIP/2.0
Via: SIP/2.0/UDP asteriskpublicip:5060;branch=z9hG4bK3b34d124;rport
Max-Forwards: 70
From: "312" <sip:312@asteriskpublicip>;tag=as18f26a87
To: <sip:313@10.1.11.20:5060>
Contact: <sip:312@asteriskpublicip:5060>
Call-ID: 53f3ebde1b6829bc6d5ef4f8097a77ab@asteriskpublicip:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 12.2.0
Date: Thu, 17 Jul 2014 02:06:15 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
X-TTL: 99
X-VoipMonitor-norecord: yes
X-VoipMonitor-Custom1: hunternet-1405562775.699
Remote-Party-ID: "312" <sip:312@asteriskpublicip>;party=calling;privacy=off;screen=no
Content-Type: application/sdp
Content-Length: 223

v=0
o=root 1223952052 1223952052 IN IP4 asteriskpublicip
s=Asterisk PBX 12.2.0
c=IN IP4 asteriskpublicip
t=0 0
m=audio 13428 RTP/AVP 0 9
a=rtpmap:0 PCMU/8000
a=rtpmap:9 G722/8000
a=ptime:20
a=maxptime:150
a=sendrecv

---

<--- SIP read from UDP:endpointIP:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP asteriskpublicip:5060;branch=z9hG4bK3b34d124;rport
From: "312" <sip:312@asteriskpublicip>;tag=as18f26a87
To: "313" <sip:313@10.1.11.20:5060>;tag=219A701-4AD81741
CSeq: 102 INVITE
Call-ID: 53f3ebde1b6829bc6d5ef4f8097a77ab@asteriskpublicip:5060
Contact: <sip:313@10.1.11.20:5060>
User-Agent: PolycomVVX-VVX_410-UA/4.1.6.5374
Accept-Language: en
Content-Length: 0

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

<--- SIP read from UDP:endpointIP:5060 --->
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP asteriskpublicip:5060;branch=z9hG4bK3b34d124;rport
From: "312" <sip:312@asteriskpublicip>;tag=as18f26a87
To: "313" <sip:313@10.1.11.20:5060>;tag=219A701-4AD81741
CSeq: 102 INVITE
Call-ID: 53f3ebde1b6829bc6d5ef4f8097a77ab@asteriskpublicip:5060
Contact: <sip:313@10.1.11.20:5060>
User-Agent: PolycomVVX-VVX_410-UA/4.1.6.5374
Allow-Events: conference,talk,hold
Accept-Language: en
Content-Length: 0

<------------->
--- (11 headers 0 lines) ---
list_route: route/path hop: <sip:313@10.1.11.20:5060>

<--- Transmitting (NAT) to endpointIP:1073 --->
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 10.1.11.19:5060;branch=z9hG4bKc9a413ec7A5DFD17;received=endpointIP;rport=1073
From: "312" <sip:312@***.*****.com>;tag=31C378D7-46C5FF1C
To: <sip:313@***.*****.com;user=phone>;tag=as2f404330
Call-ID: a00d4ef7-ca1122fc-dd38ab07@10.1.11.19
CSeq: 2 INVITE
Server: Asterisk PBX 12.2.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: <sip:313@asteriskpublicip:5060>
Remote-Party-ID: "313" <sip:313@***.*****.com>;party=called;privacy=off;screen=no
Content-Length: 0


<------------>

<--- SIP read from UDP:endpointIP:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP asteriskpublicip:5060;branch=z9hG4bK3b34d124;rport
From: "312" <sip:312@asteriskpublicip>;tag=as18f26a87
To: "313" <sip:313@10.1.11.20:5060>;tag=219A701-4AD81741
CSeq: 102 INVITE
Call-ID: 53f3ebde1b6829bc6d5ef4f8097a77ab@asteriskpublicip:5060
Contact: <sip:313@10.1.11.20:5060>
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
Supported: 100rel,replaces
User-Agent: PolycomVVX-VVX_410-UA/4.1.6.5374
Allow-Events: conference,talk,hold
Accept-Language: en
Content-Type: application/sdp
Content-Length: 168

v=0
o=- 1405588011 1405588011 IN IP4 10.1.11.20
s=Polycom IP Phone
c=IN IP4 10.1.11.20
t=0 0
a=sendrecv
m=audio 2254 RTP/AVP 0
a=rtpmap:0 PCMU/8000
a=sendrecv
<------------->
--- (14 headers 9 lines) ---
Found RTP audio format 0
Found audio description format PCMU for ID 0
Capabilities: us - (ulaw|g722), peer - audio=(ulaw)/video=(nothing)/text=(nothing), combined - (ulaw)
Non-codec capabilities (dtmf): us - 0x0 (nothing), peer - 0x0 (nothing), combined - 0x0 (nothing)
Peer audio RTP is at port 10.1.11.20:2254
list_route: route/path hop: <sip:313@10.1.11.20:5060>
Transmitting (NAT) to endpointIP:5060:
ACK sip:313@10.1.11.20:5060 SIP/2.0
Via: SIP/2.0/UDP asteriskpublicip:5060;branch=z9hG4bK63ce14ee;rport
Max-Forwards: 70
From: "312" <sip:312@asteriskpublicip>;tag=as18f26a87
To: <sip:313@10.1.11.20:5060>;tag=219A701-4AD81741
Contact: <sip:312@asteriskpublicip:5060>
Call-ID: 53f3ebde1b6829bc6d5ef4f8097a77ab@asteriskpublicip:5060
CSeq: 102 ACK
User-Agent: Asterisk PBX 12.2.0
Content-Length: 0


---
Audio is at 14288
Adding codec 100012 (g722) to SDP

<--- Reliably Transmitting (NAT) to endpointIP:1073 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.1.11.19:5060;branch=z9hG4bKc9a413ec7A5DFD17;received=endpointIP;rport=1073
From: "312" <sip:312@***.*****.com>;tag=31C378D7-46C5FF1C
To: <sip:313@***.*****.com;user=phone>;tag=as2f404330
Call-ID: a00d4ef7-ca1122fc-dd38ab07@10.1.11.19
CSeq: 2 INVITE
Server: Asterisk PBX 12.2.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Contact: <sip:313@asteriskpublicip:5060>
Remote-Party-ID: "313" <sip:313@***.*****.com>;party=called;privacy=off;screen=no
Content-Type: application/sdp
Content-Length: 199

v=0
o=root 2011106583 2011106583 IN IP4 asteriskpublicip
s=Asterisk PBX 12.2.0
c=IN IP4 asteriskpublicip
t=0 0
m=audio 14288 RTP/AVP 9
a=rtpmap:9 G722/8000
a=ptime:20
a=maxptime:150
a=sendrecv

<------------>
Audio is at 13428
Adding codec 100003 (ulaw) to SDP
Reliably Transmitting (NAT) to endpointIP:5060:
INVITE sip:313@10.1.11.20:5060 SIP/2.0
Via: SIP/2.0/UDP asteriskpublicip:5060;branch=z9hG4bK42e5a1df;rport
Max-Forwards: 70
From: "312" <sip:312@asteriskpublicip>;tag=as18f26a87
To: <sip:313@10.1.11.20:5060>;tag=219A701-4AD81741
Contact: <sip:312@asteriskpublicip:5060>
Call-ID: 53f3ebde1b6829bc6d5ef4f8097a77ab@asteriskpublicip:5060
CSeq: 103 INVITE
User-Agent: Asterisk PBX 12.2.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
X-asterisk-Info: SIP re-invite (External RTP bridge)
Remote-Party-ID: "312" <sip:312@asteriskpublicip>;party=calling;privacy=off;screen=no
Content-Type: application/sdp
Content-Length: 190

v=0
o=root 1223952052 1223952053 IN IP4 10.1.11.19
s=Asterisk PBX 12.2.0
c=IN IP4 10.1.11.19
t=0 0
m=audio 2230 RTP/AVP 0
a=rtpmap:0 PCMU/8000
a=ptime:20
a=maxptime:150
a=sendrecv

---

<--- SIP read from UDP:endpointIP:1073 --->
ACK sip:313@asteriskpublicip:5060 SIP/2.0
Via: SIP/2.0/UDP 10.1.11.19:5060;branch=z9hG4bK7c1173ccA3078337
From: "312" <sip:312@***.*****.com>;tag=31C378D7-46C5FF1C
To: <sip:313@***.*****.com;user=phone>;tag=as2f404330
CSeq: 2 ACK
Call-ID: a00d4ef7-ca1122fc-dd38ab07@10.1.11.19
Contact: <sip:312@10.1.11.19:5060>
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
User-Agent: PolycomVVX-VVX_410-UA/4.1.6.5374
Accept-Language: en
Max-Forwards: 70
Content-Length: 0

<------------->
--- (12 headers 0 lines) ---
Audio is at 14288
Reliably Transmitting (NAT) to endpointIP:1073:
INVITE sip:312@10.1.11.19:5060 SIP/2.0
Via: SIP/2.0/UDP asteriskpublicip:5060;branch=z9hG4bK3de068e1;rport
Max-Forwards: 70
From: <sip:313@***.*****.com;user=phone>;tag=as2f404330
To: "312" <sip:312@***.*****.com>;tag=31C378D7-46C5FF1C
Contact: <sip:313@asteriskpublicip:5060>
Call-ID: a00d4ef7-ca1122fc-dd38ab07@10.1.11.19
CSeq: 102 INVITE
User-Agent: Asterisk PBX 12.2.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
X-asterisk-Info: SIP re-invite (External RTP bridge)
Remote-Party-ID: "313" <sip:313@***.*****.com>;party=called;privacy=off;screen=no
Content-Type: application/sdp
Content-Length: 104

v=0
o=root 2011106583 2011106584 IN IP4 10.1.11.20
s=Asterisk PBX 12.2.0
c=IN IP4 10.1.11.20
t=0 0

---
Retransmitting #1 (NAT) to endpointIP:5060:
INVITE sip:313@10.1.11.20:5060 SIP/2.0
Via: SIP/2.0/UDP asteriskpublicip:5060;branch=z9hG4bK42e5a1df;rport
Max-Forwards: 70
From: "312" <sip:312@asteriskpublicip>;tag=as18f26a87
To: <sip:313@10.1.11.20:5060>;tag=219A701-4AD81741
Contact: <sip:312@asteriskpublicip:5060>
Call-ID: 53f3ebde1b6829bc6d5ef4f8097a77ab@asteriskpublicip:5060
CSeq: 103 INVITE
User-Agent: Asterisk PBX 12.2.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
X-asterisk-Info: SIP re-invite (External RTP bridge)
Remote-Party-ID: "312" <sip:312@asteriskpublicip>;party=calling;privacy=off;screen=no
Content-Type: application/sdp
Content-Length: 190

v=0
o=root 1223952052 1223952053 IN IP4 10.1.11.19
s=Asterisk PBX 12.2.0
c=IN IP4 10.1.11.19
t=0 0
m=audio 2230 RTP/AVP 0
a=rtpmap:0 PCMU/8000
a=ptime:20
a=maxptime:150
a=sendrecv

---
Retransmitting #1 (NAT) to endpointIP:1073:
INVITE sip:312@10.1.11.19:5060 SIP/2.0
Via: SIP/2.0/UDP asteriskpublicip:5060;branch=z9hG4bK3de068e1;rport
Max-Forwards: 70
From: <sip:313@***.*****.com;user=phone>;tag=as2f404330
To: "312" <sip:312@***.*****.com>;tag=31C378D7-46C5FF1C
Contact: <sip:313@asteriskpublicip:5060>
Call-ID: a00d4ef7-ca1122fc-dd38ab07@10.1.11.19
CSeq: 102 INVITE
User-Agent: Asterisk PBX 12.2.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
X-asterisk-Info: SIP re-invite (External RTP bridge)
Remote-Party-ID: "313" <sip:313@***.*****.com>;party=called;privacy=off;screen=no
Content-Type: application/sdp
Content-Length: 104

v=0
o=root 2011106583 2011106584 IN IP4 10.1.11.20
s=Asterisk PBX 12.2.0
c=IN IP4 10.1.11.20
t=0 0

---

<--- SIP read from UDP:endpointIP:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP asteriskpublicip:5060;branch=z9hG4bK42e5a1df;rport
From: "312" <sip:312@asteriskpublicip>;tag=as18f26a87
To: "313" <sip:313@10.1.11.20:5060>;tag=219A701-4AD81741
CSeq: 103 INVITE
Call-ID: 53f3ebde1b6829bc6d5ef4f8097a77ab@asteriskpublicip:5060
Contact: <sip:313@10.1.11.20:5060>
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
Supported: 100rel,replaces
User-Agent: PolycomVVX-VVX_410-UA/4.1.6.5374
Allow-Events: conference,talk,hold
Accept-Language: en
Content-Type: application/sdp
Content-Length: 168

v=0
o=- 1405588011 1405588012 IN IP4 10.1.11.20
s=Polycom IP Phone
c=IN IP4 10.1.11.20
t=0 0
a=sendrecv
m=audio 2254 RTP/AVP 0
a=rtpmap:0 PCMU/8000
a=sendrecv
<------------->
--- (14 headers 9 lines) ---
Found RTP audio format 0
Found audio description format PCMU for ID 0
Capabilities: us - (ulaw|g722), peer - audio=(ulaw)/video=(nothing)/text=(nothing), combined - (ulaw)
Non-codec capabilities (dtmf): us - 0x0 (nothing), peer - 0x0 (nothing), combined - 0x0 (nothing)
Peer audio RTP is at port 10.1.11.20:2254
Transmitting (NAT) to endpointIP:5060:
ACK sip:313@10.1.11.20:5060 SIP/2.0
Via: SIP/2.0/UDP asteriskpublicip:5060;branch=z9hG4bK012828ba;rport
Max-Forwards: 70
From: "312" <sip:312@asteriskpublicip>;tag=as18f26a87
To: <sip:313@10.1.11.20:5060>;tag=219A701-4AD81741
Contact: <sip:312@asteriskpublicip:5060>
Call-ID: 53f3ebde1b6829bc6d5ef4f8097a77ab@asteriskpublicip:5060
CSeq: 103 ACK
User-Agent: Asterisk PBX 12.2.0
Content-Length: 0


---

<--- SIP read from UDP:endpointIP:1073 --->
SIP/2.0 488 Not Acceptable Here
Via: SIP/2.0/UDP asteriskpublicip:5060;branch=z9hG4bK3de068e1;rport
From: <sip:313@***.*****.com;user=phone>;tag=as2f404330
To: "312" <sip:312@***.*****.com>;tag=31C378D7-46C5FF1C
CSeq: 102 INVITE
Call-ID: a00d4ef7-ca1122fc-dd38ab07@10.1.11.19
Contact: <sip:312@10.1.11.19:5060>
User-Agent: PolycomVVX-VVX_410-UA/4.1.6.5374
Accept-Language: en
Content-Length: 0

<------------->
--- (10 headers 0 lines) ---
Transmitting (NAT) to endpointIP:1073:
ACK sip:312@10.1.11.19:5060 SIP/2.0
Via: SIP/2.0/UDP asteriskpublicip:5060;branch=z9hG4bK3de068e1;rport
Max-Forwards: 70
From: <sip:313@***.*****.com;user=phone>;tag=as2f404330
To: "312" <sip:312@***.*****.com>;tag=31C378D7-46C5FF1C
Contact: <sip:313@asteriskpublicip:5060>
Call-ID: a00d4ef7-ca1122fc-dd38ab07@10.1.11.19
CSeq: 102 ACK
User-Agent: Asterisk PBX 12.2.0
Content-Length: 0


---
Audio is at 14288
Adding codec 100012 (g722) to SDP
Reliably Transmitting (NAT) to endpointIP:1073:
INVITE sip:312@10.1.11.19:5060 SIP/2.0
Via: SIP/2.0/UDP asteriskpublicip:5060;branch=z9hG4bK4ce3833c;rport
Max-Forwards: 70
From: <sip:313@***.*****.com;user=phone>;tag=as2f404330
To: "312" <sip:312@***.*****.com>;tag=31C378D7-46C5FF1C
Contact: <sip:313@asteriskpublicip:5060>
Call-ID: a00d4ef7-ca1122fc-dd38ab07@10.1.11.19
CSeq: 103 INVITE
User-Agent: Asterisk PBX 12.2.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
X-asterisk-Info: SIP re-invite (External RTP bridge)
Remote-Party-ID: "313" <sip:313@***.*****.com>;party=called;privacy=off;screen=no
Content-Type: application/sdp
Content-Length: 199

v=0
o=root 2011106583 2011106585 IN IP4 asteriskpublicip
s=Asterisk PBX 12.2.0
c=IN IP4 asteriskpublicip
t=0 0
m=audio 14288 RTP/AVP 9
a=rtpmap:9 G722/8000
a=ptime:20
a=maxptime:150
a=sendrecv

---
Audio is at 13428
Adding codec 100003 (ulaw) to SDP
Reliably Transmitting (NAT) to endpointIP:5060:
INVITE sip:313@10.1.11.20:5060 SIP/2.0
Via: SIP/2.0/UDP asteriskpublicip:5060;branch=z9hG4bK14b7c573;rport
Max-Forwards: 70
From: "312" <sip:312@asteriskpublicip>;tag=as18f26a87
To: <sip:313@10.1.11.20:5060>;tag=219A701-4AD81741
Contact: <sip:312@asteriskpublicip:5060>
Call-ID: 53f3ebde1b6829bc6d5ef4f8097a77ab@asteriskpublicip:5060
CSeq: 104 INVITE
User-Agent: Asterisk PBX 12.2.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
X-asterisk-Info: SIP re-invite (External RTP bridge)
Remote-Party-ID: "312" <sip:312@asteriskpublicip>;party=calling;privacy=off;screen=no
Content-Type: application/sdp
Content-Length: 199

v=0
o=root 1223952052 1223952054 IN IP4 asteriskpublicip
s=Asterisk PBX 12.2.0
c=IN IP4 asteriskpublicip
t=0 0
m=audio 13428 RTP/AVP 0
a=rtpmap:0 PCMU/8000
a=ptime:20
a=maxptime:150
a=sendrecv

---
Scheduling destruction of SIP dialog '53f3ebde1b6829bc6d5ef4f8097a77ab@asteriskpublicip:5060' in 6400 ms (Method: INVITE)
Scheduling destruction of SIP dialog 'a00d4ef7-ca1122fc-dd38ab07@10.1.11.19' in 6400 ms (Method: ACK)

<--- SIP read from UDP:endpointIP:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP asteriskpublicip:5060;branch=z9hG4bK42e5a1df;rport
From: "312" <sip:312@asteriskpublicip>;tag=as18f26a87
To: "313" <sip:313@10.1.11.20:5060>;tag=219A701-4AD81741
CSeq: 103 INVITE
Call-ID: 53f3ebde1b6829bc6d5ef4f8097a77ab@asteriskpublicip:5060
Contact: <sip:313@10.1.11.20:5060>
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
Supported: 100rel,replaces
User-Agent: PolycomVVX-VVX_410-UA/4.1.6.5374
Allow-Events: conference,talk,hold
Accept-Language: en
Content-Type: application/sdp
Content-Length: 168

v=0
o=- 1405588011 1405588012 IN IP4 10.1.11.20
s=Polycom IP Phone
c=IN IP4 10.1.11.20
t=0 0
a=sendrecv
m=audio 2254 RTP/AVP 0
a=rtpmap:0 PCMU/8000
a=sendrecv
<------------->
--- (14 headers 9 lines) ---
Transmitting (NAT) to endpointIP:5060:
ACK sip:313@10.1.11.20:5060 SIP/2.0
Via: SIP/2.0/UDP asteriskpublicip:5060;branch=z9hG4bK40e1c4ce;rport
Max-Forwards: 70
From: "312" <sip:312@asteriskpublicip>;tag=as18f26a87
To: <sip:313@10.1.11.20:5060>;tag=219A701-4AD81741
Contact: <sip:312@asteriskpublicip:5060>
Call-ID: 53f3ebde1b6829bc6d5ef4f8097a77ab@asteriskpublicip:5060
CSeq: 103 ACK
User-Agent: Asterisk PBX 12.2.0
Content-Length: 0


---

<--- SIP read from UDP:endpointIP:1073 --->
SIP/2.0 488 Not Acceptable Here
Via: SIP/2.0/UDP asteriskpublicip:5060;branch=z9hG4bK3de068e1;rport
From: <sip:313@***.*****.com;user=phone>;tag=as2f404330
To: "312" <sip:312@***.*****.com>;tag=31C378D7-46C5FF1C
CSeq: 102 INVITE
Call-ID: a00d4ef7-ca1122fc-dd38ab07@10.1.11.19
Contact: <sip:312@10.1.11.19:5060>
User-Agent: PolycomVVX-VVX_410-UA/4.1.6.5374
Accept-Language: en
Content-Length: 0

<------------->
--- (10 headers 0 lines) ---
Transmitting (NAT) to endpointIP:1073:
ACK sip:312@10.1.11.19:5060 SIP/2.0
Via: SIP/2.0/UDP asteriskpublicip:5060;branch=z9hG4bK4ce3833c;rport
Max-Forwards: 70
From: <sip:313@***.*****.com;user=phone>;tag=as2f404330
To: "312" <sip:312@***.*****.com>;tag=31C378D7-46C5FF1C
Contact: <sip:313@asteriskpublicip:5060>
Call-ID: a00d4ef7-ca1122fc-dd38ab07@10.1.11.19
CSeq: 102 ACK
User-Agent: Asterisk PBX 12.2.0
Content-Length: 0


---
Retransmitting #1 (NAT) to endpointIP:1073:
INVITE sip:312@10.1.11.19:5060 SIP/2.0
Via: SIP/2.0/UDP asteriskpublicip:5060;branch=z9hG4bK4ce3833c;rport
Max-Forwards: 70
From: <sip:313@***.*****.com;user=phone>;tag=as2f404330
To: "312" <sip:312@***.*****.com>;tag=31C378D7-46C5FF1C
Contact: <sip:313@asteriskpublicip:5060>
Call-ID: a00d4ef7-ca1122fc-dd38ab07@10.1.11.19
CSeq: 103 INVITE
User-Agent: Asterisk PBX 12.2.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
X-asterisk-Info: SIP re-invite (External RTP bridge)
Remote-Party-ID: "313" <sip:313@***.*****.com>;party=called;privacy=off;screen=no
Content-Type: application/sdp
Content-Length: 199

v=0
o=root 2011106583 2011106585 IN IP4 asteriskpublicip
s=Asterisk PBX 12.2.0
c=IN IP4 asteriskpublicip
t=0 0
m=audio 14288 RTP/AVP 9
a=rtpmap:9 G722/8000
a=ptime:20
a=maxptime:150
a=sendrecv

---
Retransmitting #1 (NAT) to endpointIP:5060:
INVITE sip:313@10.1.11.20:5060 SIP/2.0
Via: SIP/2.0/UDP asteriskpublicip:5060;branch=z9hG4bK14b7c573;rport
Max-Forwards: 70
From: "312" <sip:312@asteriskpublicip>;tag=as18f26a87
To: <sip:313@10.1.11.20:5060>;tag=219A701-4AD81741
Contact: <sip:312@asteriskpublicip:5060>
Call-ID: 53f3ebde1b6829bc6d5ef4f8097a77ab@asteriskpublicip:5060
CSeq: 104 INVITE
User-Agent: Asterisk PBX 12.2.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
X-asterisk-Info: SIP re-invite (External RTP bridge)
Remote-Party-ID: "312" <sip:312@asteriskpublicip>;party=calling;privacy=off;screen=no
Content-Type: application/sdp
Content-Length: 199

v=0
o=root 1223952052 1223952054 IN IP4 asteriskpublicip
s=Asterisk PBX 12.2.0
c=IN IP4 asteriskpublicip
t=0 0
m=audio 13428 RTP/AVP 0
a=rtpmap:0 PCMU/8000
a=ptime:20
a=maxptime:150
a=sendrecv

---

<--- SIP read from UDP:endpointIP:1073 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP asteriskpublicip:5060;branch=z9hG4bK4ce3833c;rport
From: <sip:313@***.*****.com;user=phone>;tag=as2f404330
To: "312" <sip:312@***.*****.com>;tag=31C378D7-46C5FF1C
CSeq: 103 INVITE
Call-ID: a00d4ef7-ca1122fc-dd38ab07@10.1.11.19
Contact: <sip:312@10.1.11.19:5060>
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
Supported: 100rel,replaces
User-Agent: PolycomVVX-VVX_410-UA/4.1.6.5374
Allow-Events: conference,talk,hold
Accept-Language: en
Content-Type: application/sdp
Content-Length: 168

v=0
o=- 1405588010 1405588012 IN IP4 10.1.11.19
s=Polycom IP Phone
c=IN IP4 10.1.11.19
t=0 0
a=sendrecv
m=audio 2230 RTP/AVP 9
a=rtpmap:9 G722/8000
a=sendrecv
<------------->
--- (14 headers 9 lines) ---
Found RTP audio format 9
Found audio description format G722 for ID 9
Capabilities: us - (g722), peer - audio=(g722)/video=(nothing)/text=(nothing), combined - (g722)
Non-codec capabilities (dtmf): us - 0x0 (nothing), peer - 0x0 (nothing), combined - 0x0 (nothing)
Peer audio RTP is at port 10.1.11.19:2230
Transmitting (NAT) to endpointIP:1073:
ACK sip:312@10.1.11.19:5060 SIP/2.0
Via: SIP/2.0/UDP asteriskpublicip:5060;branch=z9hG4bK66d9c5ae;rport
Max-Forwards: 70
From: <sip:313@***.*****.com;user=phone>;tag=as2f404330
To: "312" <sip:312@***.*****.com>;tag=31C378D7-46C5FF1C
Contact: <sip:313@asteriskpublicip:5060>
Call-ID: a00d4ef7-ca1122fc-dd38ab07@10.1.11.19
CSeq: 103 ACK
User-Agent: Asterisk PBX 12.2.0
Content-Length: 0


---
Reliably Transmitting (NAT) to endpointIP:1073:
BYE sip:312@10.1.11.19:5060 SIP/2.0
Via: SIP/2.0/UDP asteriskpublicip:5060;branch=z9hG4bK4ff96a25;rport
Max-Forwards: 70
From: <sip:313@***.*****.com;user=phone>;tag=as2f404330
To: "312" <sip:312@***.*****.com>;tag=31C378D7-46C5FF1C
Call-ID: a00d4ef7-ca1122fc-dd38ab07@10.1.11.19
CSeq: 104 BYE
User-Agent: Asterisk PBX 12.2.0
Proxy-Authorization: Digest username="312", realm="hunternet", algorithm=MD5, uri="sip:***.*****.com", nonce="26f08eef", response="f8533f80896ec5ffb9509596991294d6"
X-Asterisk-HangupCause: Bearer capability not available
X-Asterisk-HangupCauseCode: 58
Content-Length: 0


---
Scheduling destruction of SIP dialog 'a00d4ef7-ca1122fc-dd38ab07@10.1.11.19' in 6400 ms (Method: ACK)

<--- SIP read from UDP:endpointIP:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP asteriskpublicip:5060;branch=z9hG4bK14b7c573;rport
From: "312" <sip:312@asteriskpublicip>;tag=as18f26a87
To: "313" <sip:313@10.1.11.20:5060>;tag=219A701-4AD81741
CSeq: 104 INVITE
Call-ID: 53f3ebde1b6829bc6d5ef4f8097a77ab@asteriskpublicip:5060
Contact: <sip:313@10.1.11.20:5060>
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
Supported: 100rel,replaces
User-Agent: PolycomVVX-VVX_410-UA/4.1.6.5374
Allow-Events: conference,talk,hold
Accept-Language: en
Content-Type: application/sdp
Content-Length: 168

v=0
o=- 1405588011 1405588013 IN IP4 10.1.11.20
s=Polycom IP Phone
c=IN IP4 10.1.11.20
t=0 0
a=sendrecv
m=audio 2254 RTP/AVP 0
a=rtpmap:0 PCMU/8000
a=sendrecv
<------------->
--- (14 headers 9 lines) ---
Found RTP audio format 0
Found audio description format PCMU for ID 0
Capabilities: us - (ulaw|g722), peer - audio=(ulaw)/video=(nothing)/text=(nothing), combined - (ulaw)
Non-codec capabilities (dtmf): us - 0x0 (nothing), peer - 0x0 (nothing), combined - 0x0 (nothing)
Peer audio RTP is at port 10.1.11.20:2254
Transmitting (NAT) to endpointIP:5060:
ACK sip:313@10.1.11.20:5060 SIP/2.0
Via: SIP/2.0/UDP asteriskpublicip:5060;branch=z9hG4bK6c28cdc7;rport
Max-Forwards: 70
From: "312" <sip:312@asteriskpublicip>;tag=as18f26a87
To: <sip:313@10.1.11.20:5060>;tag=219A701-4AD81741
Contact: <sip:312@asteriskpublicip:5060>
Call-ID: 53f3ebde1b6829bc6d5ef4f8097a77ab@asteriskpublicip:5060
CSeq: 104 ACK
User-Agent: Asterisk PBX 12.2.0
Content-Length: 0


---
Reliably Transmitting (NAT) to endpointIP:5060:
BYE sip:313@10.1.11.20:5060 SIP/2.0
Via: SIP/2.0/UDP asteriskpublicip:5060;branch=z9hG4bK06b4d00a;rport
Max-Forwards: 70
From: "312" <sip:312@asteriskpublicip>;tag=as18f26a87
To: <sip:313@10.1.11.20:5060>;tag=219A701-4AD81741
Call-ID: 53f3ebde1b6829bc6d5ef4f8097a77ab@asteriskpublicip:5060
CSeq: 105 BYE
User-Agent: Asterisk PBX 12.2.0
X-Asterisk-HangupCause: Bearer capability not available
X-Asterisk-HangupCauseCode: 58
Content-Length: 0


---
Scheduling destruction of SIP dialog '53f3ebde1b6829bc6d5ef4f8097a77ab@asteriskpublicip:5060' in 6400 ms (Method: INVITE)

<--- SIP read from UDP:endpointIP:1073 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP asteriskpublicip:5060;branch=z9hG4bK4ce3833c;rport
From: <sip:313@***.*****.com;user=phone>;tag=as2f404330
To: "312" <sip:312@***.*****.com>;tag=31C378D7-46C5FF1C
CSeq: 103 INVITE
Call-ID: a00d4ef7-ca1122fc-dd38ab07@10.1.11.19
Contact: <sip:312@10.1.11.19:5060>
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
Supported: 100rel,replaces
User-Agent: PolycomVVX-VVX_410-UA/4.1.6.5374
Allow-Events: conference,talk,hold
Accept-Language: en
Content-Type: application/sdp
Content-Length: 168

v=0
o=- 1405588010 1405588012 IN IP4 10.1.11.19
s=Polycom IP Phone
c=IN IP4 10.1.11.19
t=0 0
a=sendrecv
m=audio 2230 RTP/AVP 9
a=rtpmap:9 G722/8000
a=sendrecv
<------------->
--- (14 headers 9 lines) ---
Transmitting (NAT) to endpointIP:1073:
ACK sip:312@10.1.11.19:5060 SIP/2.0
Via: SIP/2.0/UDP asteriskpublicip:5060;branch=z9hG4bK239a5df0;rport
Max-Forwards: 70
From: <sip:313@***.*****.com;user=phone>;tag=as2f404330
To: "312" <sip:312@***.*****.com>;tag=31C378D7-46C5FF1C
Contact: <sip:313@asteriskpublicip:5060>
Call-ID: a00d4ef7-ca1122fc-dd38ab07@10.1.11.19
CSeq: 103 ACK
User-Agent: Asterisk PBX 12.2.0
Content-Length: 0


---

<--- SIP read from UDP:endpointIP:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP asteriskpublicip:5060;branch=z9hG4bK14b7c573;rport
From: "312" <sip:312@asteriskpublicip>;tag=as18f26a87
To: "313" <sip:313@10.1.11.20:5060>;tag=219A701-4AD81741
CSeq: 104 INVITE
Call-ID: 53f3ebde1b6829bc6d5ef4f8097a77ab@asteriskpublicip:5060
Contact: <sip:313@10.1.11.20:5060>
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, UPDATE, REFER
Supported: 100rel,replaces
User-Agent: PolycomVVX-VVX_410-UA/4.1.6.5374
Allow-Events: conference,talk,hold
Accept-Language: en
Content-Type: application/sdp
Content-Length: 168

v=0
o=- 1405588011 1405588013 IN IP4 10.1.11.20
s=Polycom IP Phone
c=IN IP4 10.1.11.20
t=0 0
a=sendrecv
m=audio 2254 RTP/AVP 0
a=rtpmap:0 PCMU/8000
a=sendrecv
<------------->
--- (14 headers 9 lines) ---
Transmitting (NAT) to endpointIP:5060:
ACK sip:313@10.1.11.20:5060 SIP/2.0
Via: SIP/2.0/UDP asteriskpublicip:5060;branch=z9hG4bK7478ae3f;rport
Max-Forwards: 70
From: "312" <sip:312@asteriskpublicip>;tag=as18f26a87
To: <sip:313@10.1.11.20:5060>;tag=219A701-4AD81741
Contact: <sip:312@asteriskpublicip:5060>
Call-ID: 53f3ebde1b6829bc6d5ef4f8097a77ab@asteriskpublicip:5060
CSeq: 104 ACK
User-Agent: Asterisk PBX 12.2.0
Content-Length: 0


---

<--- SIP read from UDP:endpointIP:1073 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP asteriskpublicip:5060;branch=z9hG4bK4ff96a25;rport
From: <sip:313@***.*****.com;user=phone>;tag=as2f404330
To: "312" <sip:312@***.*****.com>;tag=31C378D7-46C5FF1C
CSeq: 104 BYE
Call-ID: a00d4ef7-ca1122fc-dd38ab07@10.1.11.19
Contact: <sip:312@10.1.11.19:5060>
User-Agent: PolycomVVX-VVX_410-UA/4.1.6.5374
Accept-Language: en
Content-Length: 0

<------------->
--- (10 headers 0 lines) ---
Really destroying SIP dialog 'a00d4ef7-ca1122fc-dd38ab07@10.1.11.19' Method: ACK

<--- SIP read from UDP:endpointIP:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP asteriskpublicip:5060;branch=z9hG4bK06b4d00a;rport
From: "312" <sip:312@asteriskpublicip>;tag=as18f26a87
To: "313" <sip:313@10.1.11.20:5060>;tag=219A701-4AD81741
CSeq: 105 BYE
Call-ID: 53f3ebde1b6829bc6d5ef4f8097a77ab@asteriskpublicip:5060
Contact: <sip:313@10.1.11.20:5060>
User-Agent: PolycomVVX-VVX_410-UA/4.1.6.5374
Accept-Language: en
Content-Length: 0

<------------->
--- (10 headers 0 lines) ---
Really destroying SIP dialog '53f3ebde1b6829bc6d5ef4f8097a77ab@asteriskpublicip:5060' Method: INVITE

Not without either the dialplan or a verbose trace, although I would point out that the destination has rejected G.722.

Thanks for the help David.

I can’t post the dialplan, I’m using mirtapbx and it’s not my code to post. The debug log is also filled with a bunch of clutter, I’m trying to clean that up to post the relevant parts here.

It seems like the calling extension uses the highest priority codec listed for that peer, typically ulaw. Then when the phones start trying to talk directly but the first phone is using ulaw and the second is forced to use G722.

Is it possible to set the codec used by the calling party in the dialplan? I’ve found the dial string for extension to extension calls in the ael file and put Set(SIP_CODEC_OUTBOUND=g722) and Set(SIP_CODEC=g722) right before it. Seems like you’d need a reinvite from asterisk to change the codec but that’s not happening?

If you are dealing with a proprietary dialplan, you need to get support from its owner.

I don’t believe there is any way of forcing the party A codec once the call has been answered.

Your party B is not using G.722. They replied:

m=audio 2254 RTP/AVP 0
a=rtpmap:0 PCMU/8000

which means they are only prepared to accept mu-Law.

The second phone only seems to accept g722 if that’s the first codec in the peer configuration. I’m not sure there’s a solution to this but since g722 to g711 transcoding doesn’t seem to have much of a performance hit I won’t worry about it. For sites where I need g729 I’ll just configure that as the first priority for the peer and I’ve worked out making sure inbound and outbound calls are g729 on both sides of the call in that situation.

Thanks for the help David.