[asterisk-users] sip.conf setvar option

Johansson Olle E oej at edvina.net
Fri Mar 28 10:57:23 CDT 2008


Ok,

Now I have a friday afternoon patch for the community.

In the branch
http://svn.digium.com/view/asterisk/team/oej/peer-chanvars/

there's an addition to the SIPPEER() dialplan function where you can  
retrieve a setvar= channel variable defined in sip.conf for the peer.  
The branch is based on 1.4 and the patch will soon be included in the  
1.6 trunk.

This way, you can for example add a variable called "CELLPHONE" with  
the peer's cell phone number. If dial(sip/olle) fails, I can now do

	dial(zap/${SIPPEER(olle,chanvar[CELLPHONE])})

This is something I came up with a few weeks ago when I created a PBX  
based on Asterisk for a company, something that I don't do much, since  
I normally use Asterisk in carrier environments with SIP proxys. Doing  
this little PBX project was a lot of fun and I learned a lot.

Have a nice weekend!

/O


---
* Olle E. Johansson - oej at edvina.net
* Asterisk Training http://edvina.net/training/
* Asterisk SIP Masterclass, Orlando Florida April 21-25 2008. Register  
today!




More information about the asterisk-users mailing list