[Asterisk-Users] Changing Codecs when dialing out...

etiennep at kingsley.co.za etiennep at kingsley.co.za
Mon Apr 18 05:13:47 MST 2005


Hello all,

For the g723.1 pass-through the incoming call works fine, I have been playing
around a bit and was wandering if you can dynamically change the channel and
the associated devices using the channel to change their codecs for the
outbound call.

I have the following setup in extensions.conf
exten => _9NXXNXXXXXX,1,SetVar(SIP_CODEC=g723.1)
exten => _9NXXNXXXXXX,n,Dial(SIP/net2phone/*72${EXTEN:1}) ;net2phone via
net2phone
exten => _9NXXNXXXXXX,n,SetVar(SIP_CODEC=ulaw)

This works fine if under sip.conf [general] the first codec is g723.1 but say I
would like the devices (GS BudgeTone 100) to first register with a diffrent
codec and when entering the dialplan to change to the appropiate codec.

The output is as follows CLI:

  == Parsing '/etc/asterisk/sip_notify.conf': Not found (No such file or
directory)
    -- Executing SetVar("SIP/Reception-fddb", "SIP_CODEC=g723.1") in new stack
    -- Executing Dial("SIP/Reception-fddb", "SIP/net2phone/*72[edited_out]") in
new stack
    -- Called net2phone/*72[edited_out]
    -- SIP/net2phone-438d answered SIP/Reception-fddb
Apr 18 13:49:39 NOTICE[3318]: chan_sip.c:1995 sip_answer: Changing codec to
'g723.1' for this call because of ${SIP_CODEC) variable
    -- Attempting native bridge of SIP/Reception-fddb and SIP/net2phone-438d
Apr 18 13:49:39 NOTICE[3318]: channel.c:1845 ast_set_read_format: Unable to find
a path from g723 to alaw
Apr 18 13:49:39 NOTICE[3318]: channel.c:1812 ast_set_write_format: Unable to
find a path from ulaw to g723
Apr 18 13:49:39 WARNING[3318]: channel.c:2251 ast_channel_make_compatible: No
path to translate from SIP/Reception-fddb(8) to SIP/net2phone-438d(1)
Apr 18 13:49:39 WARNING[3318]: channel.c:3064 ast_channel_bridge: Can't make
SIP/Reception-fddb and SIP/net2phone-438d compatible
Apr 18 13:49:39 WARNING[3318]: res_features.c:976 ast_bridge_call: Bridge failed
on channels SIP/Reception-fddb and SIP/net2phone-438d
  == Spawn extension (sip, 9[edited_out], 2) exited non-zero on
'SIP/Reception-fddb'
    -- Got SIP response 481 "Call Leg/Transaction Does Not Exist" back from
66.33.157.12

As you can see the GS BudgeTone 100 hasn't changed its codec when the channel
was set to g723.1. Is there a command that I must pass through to ask the GS
BudgeTone 100 to change its codec to g723.1?

Thank you.

Kindly,
Etienne Pretorius




More information about the asterisk-users mailing list