[asterisk-users] Re: Codec swap (reinvite)

Julian J. M. julianjm at gmail.com
Thu Jan 4 10:52:49 MST 2007


While I was trying to patch chan_sip.c to force a specific codec by
using a channel variable, I found out that this is already
implemented. It there even for asterisk 1.2

sip.conf:
allow=g729,gsm,ulaw

outbound call:
exten => _X.,1,Set(SIP_CODEC=ulaw)
exten => _X.,2,Dial(SIP/itsp/${EXTEN})

inbound call:
[from-pstn]
exten => _X,1,Set(SIP_CODEC=ulaw)
exten => _X,2,Answer()

Julian J. Menendez

On 10/15/06, Martin Joseph <ast at stillnewt.org> wrote:
> On 2006-10-14 20:00:30 -0700, "Julian J. M." <julianjm at gmail.com> said:
> > I've finally given up on trying to fax over my Digium TDM400 card.
> > I've found that fax over VoIP is quite more reliable (at least I can
> > receive the faxes).
> >
> > My ITSP supports G729 and alaw/ulaw. As I won't be receiving faxes
> > everyday (just ocasionally), i pretend on using g729, unless a fax is
> > detected.
> >
> > Is there any way to force asterisk to make a reinvite, and swap the
> > codec on the fly? Something like this would be great:
> >
> > exten => fax,1,CodecChange(ulaw)
> > exten => fax,2,rxfax(blablabla)
> I think the answer is no.  I am pretty sure this has been discussed
> multiple times and there is currently no way to change the codec once
> the call is established.


More information about the asterisk-users mailing list