Summary:ASTERISK-08122: Codec in SDP
Reporter:dario (dario)Labels:
Date Opened:2006-11-13 05:27:31.000-0600Date Closed:2007-03-06 10:02:02.000-0600
Versions:Frequency of
Environment:Attachments:( 0) debug.txt
( 1) SDP_log.txt
( 2) sip.conf
Description:When I try make a connection from VoIP to PSTN, asterisk always put only one codec in SPD. It gets only first codec from globals section in sip.conf. Pleas find my logs: sip.conf and SDP_log.txt
Comments:By: Joshua C. Colp (jcolp) 2006-11-13 10:47:22.000-0600

This is a configuration issue. You are not using the peer entry in sip.conf to dial out, so it is using the global codec settings (which appear to be only g729).  To fix this use the peer entry to dial out, and for further configuration issues please use an alternate support medium such as the asterisk-users mailing list. Thank you.

By: dario (dario) 2006-11-14 02:02:09.000-0600

No it isn't. I attach my sip.conf.

By: Joshua C. Colp (jcolp) 2006-11-15 14:48:25.000-0600

Reassigned to Anthony since he has a branch open now on fixing this issue.

By: Anthony LaMantia (alamantia) 2006-11-15 17:15:30.000-0600

I have been workin gon a patch for this issue, i should be able to upload it later tonight or early tommrow for testing,

By: Anthony LaMantia (alamantia) 2006-11-16 17:26:49.000-0600

the patch for this issue is not yet in working order. i will update you soon in the mean time you can check my branch on this in my team directory /asterisk/team/anthonyl/8350-codec-2  

for updates as i commit them. when that happens i will also update this bug ticket

By: Anthony LaMantia (alamantia) 2006-11-17 12:28:32.000-0600

i have added some logging to my branch for this bug located at

can you please check it out and return the logging output with debugging turned on?

By: dario (dario) 2006-11-21 01:54:32.000-0600


There is a log (debug.txt)


By: Olle Johansson (oej) 2006-11-30 01:26:56.000-0600

Let's see
1. The INVITE from Asterisk has ilbc and alaw
2. Cisco responds with only ALAW
- We have an ALAW call

I don't see the problem you are reporting here - Asterisk has several codecs in invites and 200 OK. alamantia and file: where do you see an error? I might be missing something...

By: dario (dario) 2006-11-30 08:13:42.000-0600


Could you explain me why asterisk send INVITE without g729 codec?


By: Olle Johansson (oej) 2006-11-30 10:47:05.000-0600

Can you please copy that INVITE. The asterisk invite in debug.txt is this, which
includes alaw and ilbc.

INVITE sip:8344@ SIP/2.0
Via: SIP/2.0/UDP;branch=z9hG4bK3aef7a86;rport
Max-Forwards: 70
From: "9971" <sip:9971@>;tag=as0ce8b33f
To: <sip:8344@>
Contact: <sip:9971@>
Call-ID: 412f6751271edc7931c93b4437801a99@
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Date: Mon, 20 Nov 2006 21:33:00 GMT
Supported: replaces
Content-Type: application/sdp
Content-Length: 289

o=root 2483 2483 IN IP4
c=IN IP4
t=0 0
m=audio 16442 RTP/AVP 8 97 101
a=rtpmap:8 PCMA/8000
a=rtpmap:97 iLBC/8000
a=fmtp:97 mode=30
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -

By: Anthony LaMantia (alamantia) 2006-12-06 17:28:38.000-0600

hi dario,

i have updated my branch with one more line of debugging, can you test it with this one and paste the results, this should be the last bit of debugging information that i will need to continue work on this issue.

By: Olle Johansson (oej) 2006-12-07 02:03:16.000-0600

alamantia: What's the issue???

By: Anthony LaMantia (alamantia) 2006-12-07 04:13:02.000-0600

it seems the sdp from the invite you pasted above should include a mapping for g729

By: Olle Johansson (oej) 2007-02-01 15:30:00.000-0600

dario: Do you have g.729 licenses installed in your asterisk?

By: dario (dario) 2007-02-05 09:28:56.000-0600

Yes, I have.

By: Serge Vecher (serge-v) 2007-02-06 12:35:38.000-0600

alright, this bug seems to be going nowhere ... Let's see, the problem is that "it gets only first codec from globals section in sip.conf". Ok, let's look at the respective entries from you sip.conf. We have "allow=g729,alaw". Now, I'm not sure if that's a supported way of allowing codecs. If you look in sip.conf.sample, you should be using:


By: Brian West (bkw918) 2007-02-06 13:06:29.000-0600

yes allow=codec,codec,codec is supported.


By: Serge Vecher (serge-v) 2007-02-21 15:07:40.000-0600

dario, can you please include a new debug log from the latest (r > 55900) 1.4?

By: Serge Vecher (serge-v) 2007-03-06 10:02:01.000-0600

no response from reporter; if still an issue with 1.4.1, please reopen the report with debugging information as requested.