* 1.2.1 - rtpmap propagated incorrectly by Asterisk

I’m using external FXO/FXS for VoIP, and Asterisk 1.2.1 as call router. Our FXO/FXS are supposed to be using G723 as Coder, and when connected directly, they do. However, when I use Asterisk to route the calls, it passes on a different list than it received from the FXS, with PCMU as the first Coder listed. As a result, the call goes thru using PCMU, which is not what we want (it has much higher bandwidth requirement).

Do I have to configure something differently in Asterisk, in order to get it to use the list it was actually given??

Initial packets from FXS and Asterisk:

<-- SIP read from 172.18.51.23:5060:
INVITE sip:80201@172.18.100.5;user=phone SIP/2.0
Via: SIP/2.0/UDP 172.18.51.23;branch=z9hG4bKac1054729380
Max-Forwards: 70
From: sip:64601@172.18.51.23;tag=1c1054667330
To: sip:80201@172.18.100.5;user=phone
Call-ID: 1054666979212000191039@172.18.51.23
CSeq: 2 INVITE
Proxy-Authorization: Digest username=“sanluisobispo”,realm=“asterisk”,nonce=“0290416d”,uri="sip:80201@172.18.100.5",algorithm=MD5,response="92fe0bf989fcce3db9dff9e15f547431"
Contact: sip:64601@172.18.51.23
Supported: em,100rel,timer,replaces,path
Allow: REGISTER,OPTIONS,INVITE,ACK,CANCEL,BYE,NOTIFY,PRACK,REFER,INFO,SUBSCRIBE,UPDATE
User-Agent: Audiocodes-Sip-Gateway-MP-104 FXS/v.4.40.227.420
Content-Type: application/sdp
Content-Length: 301

v=0
o=AudiocodesGW 1054660120 1054660038 IN IP4 172.18.51.23
s=Phone-Call
c=IN IP4 172.18.51.23
t=0 0
m=audio 4000 RTP/AVP 4 18 0 96
a=rtpmap:4 g723/8000
a=rtpmap:18 g729/8000
a=fmtp:18 annexb=no
a=rtpmap:0 pcmu/8000
a=rtpmap:96 telephone-event/8000
a=fmtp:96 0-15
a=ptime:30
a=sendrecv

— (14 headers 14 lines)—
Using INVITE request as basis request - 1054666979212000191039@172.18.51.23
Sending to 172.18.51.23 : 5060 (non-NAT)
Found peer 'sanluisobispo’
Found RTP audio format 4
Found RTP audio format 18
Found RTP audio format 0
Found RTP audio format 96
Peer audio RTP is at port 172.18.51.23:4000
Found description format g723
Found description format g729
Found description format pcmu
Found description format telephone-event
Capabilities: us - 0x8000e (gsm|ulaw|alaw|h263), peer - audio=0x105 (g723|ulaw|g729)/video=0x0 (nothing), combined - 0x4 (ulaw)
Non-codec capabilities: us - 0x1 (telephone-event), peer - 0x1 (telephone-event), combined - 0x1 (telephone-event)
Looking for 80201 in outgoing (domain 172.18.100.5)
list_route: hop: sip:64601@172.18.51.23
Transmitting (no NAT) to 172.18.51.23:5060:
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 172.18.51.23;branch=z9hG4bKac1054729380;received=172.18.51.23
From: sip:64601@172.18.51.23;tag=1c1054667330
To: sip:80201@172.18.100.5;user=phone
Call-ID: 1054666979212000191039@172.18.51.23
CSeq: 2 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Max-Forwards: 70
Contact: sip:80201@172.18.100.5
Content-Length: 0


 -- Executing Dial("SIP/sanluisobispo-5180", "SIP/80201@squirrel") in new stack

We’re at 172.18.100.5 port 17924
Adding codec 0x4 (ulaw) to SDP
Adding codec 0x2 (gsm) to SDP
Adding codec 0x8 (alaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
13 headers, 12 lines
Reliably Transmitting (no NAT) to 172.18.100.23:5060:
INVITE sip:80201@172.18.100.23 SIP/2.0
Via: SIP/2.0/UDP 172.18.100.5:5060;branch=z9hG4bK616aea3a;rport
From: “64601” sip:64601@172.18.100.5;tag=as09da295d
To: sip:80201@172.18.100.23
Contact: sip:64601@172.18.100.5
Call-ID: 537a344c2772134a2f74ba3d77275327@172.18.100.5
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Max-Forwards: 70
Date: Thu, 26 Jan 2006 18:57:50 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Content-Type: application/sdp
Content-Length: 261

v=0
o=root 3357 3357 IN IP4 172.18.100.5
s=session
c=IN IP4 172.18.100.5
t=0 0
m=audio 17924 RTP/AVP 0 3 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:3 GSM/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -