Finding uniqueid of call channel

1.1k Views Asked by At

I use Asterisk 16.5 and sip trunk.

If known sip channel can i find uniqueid of call?

Note: I want do it with Asterisk AMI actions and events.

2

There are 2 best solutions below

0
ShadeBob On
Action: Command
Command: core show channels concise

give you a list of : Channel:Context:Exten:Priority:Stats:Application:Data:CallerID:Accountcode:Amaflags:Duration:Bridged

You have to pick the correct channel with the "Channel" field and make a

Action: Command
Command: core show channel YOUR_CHANNEL
0
arheops On

If you expect do events, correct way is use event. I.e collect NewChannel events and build map(for example, in memcached).

https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+ManagerEvent_Newchannel

Running too many commands sometimes result problem with ami connection.

As an example of such code you can check FOP opensource or FOP2 project(no source now). https://www.fop2.com/about.php