[asterisk-users] Different codec for different type of calls

Danny Nicholas danny at debsinc.com
Fri Nov 2 12:57:10 CDT 2012


SIP_CODEC is only useable on a SIP channel.  You can specify DAHDI codecs in
users.conf.

 

From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Ali Pey
Sent: Friday, November 02, 2012 12:28 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Different codec for different type of calls

 

Qasim,

 

Thank you for your response. I tried it but still doesn't work. This is what
I have:

 

exten => _XXX.,1,NoOP(Set G711 codec)

exten => _XXX.,n,Set(SIP_CODEC=ulaw)

exten => _XXX.,n,Set(SIP_CODEC_OUTBOUND=ulaw)

exten => _XXX.,n,Dial(DAHDI/g1/$EXTEN)

 

Then I get this error:

 

WARNING[12156]: channel.c:5796 ast_request: No translator path exists for
channel type DAHDI (native (ulaw|alaw|slin)) to (h264|silk8)

WARNING[12156]: app_dial.c:2277 dial_exec_full: Unable to create channel of
type 'DAHDI' (cause 58 - Bearer capability not available)

 

I tried both g711 and ulaw with no luck. I read the SIP_CODEC value and it
is set properly. 

 

Any suggestions/ideas?

 

Thanks,

Ali Pey

 

 

On Thu, Nov 1, 2012 at 12:02 PM, qasimakhan at gmail.com <qasimakhan at gmail.com>
wrote:

exten => _X.,1,NoOP(G711 CoDec)
exten => _X.,n,Set(SIP_CODEC=g711)
exten => _X.,n,Dial(...)

${SIP_CODEC}: Set the SIP codec for the inbound (=first) call leg (see
channelvariables.txt or README.variables in 1.2); Asterisk 1.6.2 also comes
with SIP_CODEC_OUTBOUND <https://issues.asterisk.org/view.php?id=13243>  for
the remote (=second) call leg.

Hope this helps,

Regards,
Qasim

 

On Thu, Nov 1, 2012 at 8:49 PM, Ali Pey <alipey at gmail.com> wrote:

Hello,

 

Let's say I have a sip client that supports both G711 and G729 codecs and I
have them both enabled in sip.conf and G729 has higher priority.

 

Can I force the call to choose a different codec based on the dialed number
or other conditions?

 

For instance I would want to do G711 if the call was routed to T1 card over
Dahdi but G729 if the call was going to another sip client.

 

Thanks,

Ali Pey

 

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

 


--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20121102/45c60d88/attachment.htm>


More information about the asterisk-users mailing list