[asterisk-users] AMI getting related channels in Ringing state

Daniel Tryba daniel at tryba.nl
Wed Oct 6 06:56:55 CDT 2010


Issuing the AMI Status command results in a list of active channels. But
how to figure out which channels are related before the call is
answered? 2 channels below are somehow associated, but how can I be 100%
sure they are related in order to implement a redirect of the incoming
call to another phone ("attended" call pickup respecting
call/pickupgroups).

Uniqueid seems to be a timestamp, an IVR menu will render it useless for
this purpose. Same with the "random" part of the SIP channels
(0000177f/00001780), this will not be sequential when multiple calls
occur with IVRs.

'SIP/922-00001780' => array 
(
   'Privilege' => 'Call',
   'Channel' => 'SIP/922-00001780',
   'CallerIDNum' => '922',
   'CallerIDName' => '<unknown>',
   'Account' => '',
   'State' => 'Ringing',
   'Uniqueid' => '1286364290.8475',
)
'SIP/trunk-0000177f' => array 
(
   'Privilege' => 'Call',
   'Channel' => 'SIP/trunk-0000177f',
   'CallerIDNum' => 'trunk',
   'CallerIDName' => '0031234567890',
   'Accountcode' => '',
   'ChannelState' => '4',
   'ChannelStateDesc' => 'Ring',
   'Context' => 'macro-dial-one',
   'Extension' => 's',
   'Priority' => '37',
   'Seconds' => '3',
   'Uniqueid' => '1286364290.8474',
)

-- 

   Daniel Tryba



More information about the asterisk-users mailing list