Jerry Geis
2005-Apr-08 07:04 UTC
[Asterisk-Users] inquire about connected channel (show channels)
is there an easier way to ask through the manager api what the connected channel is for a given channel. Example: I dont know the session number for SIP/401 but I what to know what channel SIP/401 is connected to. SIP/401 is presently something like SIP/401-XXXX type session number and the response to the this command would be SIP/422-YYYY where SIP/422-YYYY is the channel and session information that SIP/401 is connected to. I know this information can be parsed out of "show channels" but I was just wondering if the is an easier way? Jerry
Josiah Bryan
2005-Apr-08 07:17 UTC
[Asterisk-Users] inquire about connected channel (show channels)
On Friday 08 April 2005 10:04 am, Jerry Geis wrote:> is there an easier way to ask through the manager api > what the connected channel is for a given channel. > > Example: I dont know the session number for SIP/401 > but I what to know what channel SIP/401 is connected to. > > SIP/401 is presently something like SIP/401-XXXX type session number > and the response to the this command would be > SIP/422-YYYY > > where SIP/422-YYYY is the channel and session information that SIP/401 > is connected to. > > I know this information can be parsed out of "show channels" > but I was just wondering if the is an easier way?Its rather simple with AGI + Asterisk Manager interface. I wrote a little AGI (perl) script that connects to * and parsers 'show channel X' and grabs the 'Direct Bridge' line for that channel. This would give you, say, SIP/422-xxx as the Direct Bridge for SIP/401-xxx. I use this for transfering calls for my receptionist. So, to answer your question, just parse the output of 'show channel SIP/401-XXXX' and grab the 'Direct Bridge' line. Thats about the easiest that I know of.. HTH - -josiah -- Josiah Bryan IT Coordinator Productive Concepts, Inc. jbryan@productiveconcepts.com (765) 964-6009, ext. 224
Nicolás Gudiño
2005-Apr-08 09:52 UTC
[Asterisk-Users] inquire about connected channel (show channels)
> I know this information can be parsed out of "show channels" > but I was just wondering if the is an easier way?Its easier to use 'Status' on the manager directly. Regards, -- Nicol?s Gudi?o Buenos Aires - Argentina