How do I get the bit like "IAX2/white_phone" in extensions.conf eg
from
pre-defined variables or variants thereof ?
What I *do* get is strings like this "IAX2/white_phone@white_phone-4"
from ${CHANNEL}, but that's the full channel name.
What am I missing here ?
Thanks,
Thomas
Try using the Cut application. For your example channel you can use the
following.
exten => whatever,n,Cut(my_variable=CHANNEL,@,1)
That should give you your IAX2/white_phone. For more info, take a look at
either the wiki or CLI help.
B. J.
-----Original Message-----
From: Thomas Andrews [mailto:tandrews@grok.co.za]
Sent: Thursday, March 17, 2005 12:22
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: [Asterisk-Users] Channel name (and substring)
How do I get the bit like "IAX2/white_phone" in extensions.conf eg
from
pre-defined variables or variants thereof ?
What I *do* get is strings like this "IAX2/white_phone@white_phone-4"
from ${CHANNEL}, but that's the full channel name.
What am I missing here ?
Thanks,
Thomas
Thomas Andrews wrote:>How do I get the bit like "IAX2/white_phone" in extensions.conf eg from >pre-defined variables or variants thereof ? > >What I *do* get is strings like this "IAX2/white_phone@white_phone-4" >from ${CHANNEL}, but that's the full channel name. > >What am I missing here ? > >Thanks, >Thomas >_______________________________________________ > >This should help:http://www.voip-info.org/wiki-Asterisk+variables Look especially at the substring section. Sean
I too have a doubt regarding the variables:
currently, to forward a call to a SIP proxy, I use
exten => _0.,1,Dial(SIP/${EXTEN:1}@sipproxy)
where 'sipproxy' is defined as a peer in sip.conf. Using this, I can
only
use the 'name' part of the URI as anything after @ is removed.
But how can I retain the 'domain' part and still forward the calls to
the
proxy?.
i.e. I have to send the whole string ${EXTEN:1}@${SIPDOMAIN} to
the peer sipproxy. Can this be done?
---------------------------------
Do you Yahoo!?
Make Yahoo! your home page
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.digium.com/pipermail/asterisk-users/attachments/20050317/bc89c4db/attachment.htm