[asterisk-users] Channel Variable

razu asterisk at razu.pri.ee
Thu Nov 26 00:58:55 CST 2009


I believe ${IAXPEER(CURRENTCHANNEL)} should help you with the current
IAX2 name ... you can make DumpChan() to understand what kind of channel
variables you can use there.

--
razu

On 11/25/2009 09:57 PM, Nic Colledge wrote:
> Hi
>
> I have been using the CHANNEL variable as a way of checking if a user is allowed to make outgoing calls, and what their source caller ID should be (these values are in a database).
> This works all of the time with SIP and most of the time with IAX, however sometimes with IAX the channel variable seems to be wrong.
> I have been using Zoiper as my IAX client and Asterisk 1.6.2.0-rc6.
>
> For the sake of debugging I have "Verbose(1,Outgoing Call Handler ${CUT(CHANNEL,-,1)})" in the (internal - not default) dial plan.
>
> Most of the time the channel variable is "IAX2/10007" which is the desired behaviour (with 10007 being the IAX username) but some of the time "IAX2/192.168.1.111:4569" is shown instead.
>
> I would like to know why this is happening and if there is anything that can be done to make it show the "IAX2/10007" form every time?
>
> I realise that I could use ${CDR(accountcode)} instead, and as it happens this returns the correct account code value in both cases. However, I wanted to be able to do this on a per-channel basis and multiple channels currently share a common accountcode.
>
> Any ideas what's going on here, is there something obvious I'm missing?
>
> Thanks in advance.
>
> Regards,
> Nic
>   




More information about the asterisk-users mailing list