Set channel variable in sip.conf?

Hi,

Is it possible to set a channel variable in sip.conf?

I have a number of sip phones, and depending on which one makes a call I need to dial out via a different account.

At the moment, every SIP peer has its own context in the dialplan with an entry such as:

exten => _101XX,1,Set(SPACEACCOUNT=${THESPACE_OUT_ACCOUNT2}) exten => _101XX,2,Goto(thespace_dialout_people|${EXTEN}|1)

The macro “thespace_dialout_people” then does the dialling.

This works, but I need to copy the above two lines into each context, changing the account that is copied into the SPACEACCOUNT variable.

It would be much neater to be able to simply:

in every context but for this to work I need some way of being able to pre-set a channel variable in a given context. Is this possible? It would be fine to do this in sip.conf.

Alternatively, is there some magic exten => entry that will always be executed when a call enters a context before the more-accurate exten => _101XX is executed?

Thanks for any ideas!

Giles.

Hi

Yes you just have to use the

setvar=sipaccount=80014054

in the sip.conf

Ian

Ah, that’s brilliant. Should have really spotted that myself. Thanks for the pointer.

I can’t see anything similar in iax.conf, is this only supported for SIP peers?

Giles.

Hi Dont think there is

But you can set globals for example

iax1234=12345 ;variable for x 1234
iax2345=23456 ;variable for 2345

then on dialing out

set(var1=${iax${CALLERID(num)}})

or something similar

That’s a pretty neat trick! Thanks, will give it a go.

Giles.