Any body aware how to obtain the channels that are linked to a current extension. For example if my extension is 1234 what is the best way to find out what is the current channel I am linked too. I can probably do it with show channels or the status command but that takes a lot of parsing.
you can create you own application , for example “get_channel”, language C
it receive as parameter the structure, this structure has channel name.
see source code).
if you want i can do it, but I am not need in it. so…
it will be very easy). i am not shure about CVS .
see ./apps/app_skel.c
and ./apps/app_dial.c
for all info you need in.
and this voip-info.org/wiki-Asterisk+variables
Predefined Channel Variables
Sorry I probably should have mentioned I am looking for a way via the Manager API. I am not in the Dialplan(extensions.conf) but in an external application. The only thing I have is the extension(username) defined in the sip.conf. Extension is probably the wrong word choice here
but you can use something like this
exten => 555,1,set(ch=${channel})
exten => 555,2,set(dtmp=smoeparse…)
exten => 555,4,DIAL(SIP/application, D(${dtmp});send dtmf to application
or something like this
exten => 555,1,system(/usr/sbin/informapplication ${ch} )
exten => 555,2,DIAL(SIP/user)
or use in call macro or agi.