Extension - channels linked too?

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.

I am looking for something like this :smile:

Action: ShowLinkedChannels Channel: SIP/1234-a8de

Thanks.

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… :wink:

Thanks mate. I am not a C programmer but I will give it a try (Delphi). If it works good then I will submit it to CVS.

it will be very easy). i am not shure about CVS :wink:.
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

oops.)
sorry
this is it:
exten => 1,1,Noop(${CHANNEL}) ;works)))
sop no programing))

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 :smile:

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.