forked from SimplesIP/pabx-app
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
154 lines
4.0 KiB
154 lines
4.0 KiB
phpAMI 1.0 |
|
|
|
coreShowChannels |
|
Envia "ManagerAction_CoreShowChannels" |
|
|
|
Lista todos los canales activos |
|
|
|
return: Ver listEvent() |
|
link: https://wiki.asterisk.org/wiki/display/AST/ManagerAction_CoreShowChannels |
|
access: public |
|
array coreShowChannels () |
|
|
|
-------------Interface AMI------------- |
|
Action: CoreShowChannels |
|
|
|
Response: Success |
|
EventList: start |
|
Message: Channels will follow |
|
|
|
Event: CoreShowChannel |
|
Channel: SIP/ipphone-00000013 |
|
UniqueID: 1330109123.52 |
|
Context: home |
|
Extension: 500 |
|
Priority: 2 |
|
ChannelState: 6 |
|
ChannelStateDesc: Up |
|
Application: Dial |
|
ApplicationData: IAX2/guest@pbx.digium.com/s@default |
|
CallerIDnum: 11 |
|
CallerIDname: Cuarto Tito |
|
ConnectedLineNum: |
|
ConnectedLineName: |
|
Duration: 00:00:23 |
|
AccountCode: |
|
BridgedChannel: IAX2/216.207.245.8:4569-1938 |
|
BridgedUniqueID: 1330109138.53 |
|
|
|
Event: CoreShowChannel |
|
Channel: IAX2/216.207.245.8:4569-1938 |
|
UniqueID: 1330109138.53 |
|
Context: |
|
Extension: |
|
Priority: 1 |
|
ChannelState: 6 |
|
ChannelStateDesc: Up |
|
Application: AppDial |
|
ApplicationData: (Outgoing Line) |
|
CallerIDnum: 500 |
|
CallerIDname: |
|
ConnectedLineNum: 11 |
|
ConnectedLineName: Cuarto Tito |
|
Duration: 00:00:08 |
|
AccountCode: |
|
BridgedChannel: SIP/ipphone-00000013 |
|
BridgedUniqueID: 1330109123.52 |
|
|
|
Event: CoreShowChannelsComplete |
|
EventList: Complete |
|
ListItems: 2 |
|
--------------------------------------- |
|
|
|
----------------Ejemplo---------------- |
|
include "phpAMI.php"; |
|
$ami=new phpAMI("admin","admin"); |
|
$login=$ami->login(); |
|
if($login["Response"]=="Success"){ |
|
print_r($ami->coreShowChannels()); |
|
$ami->logoff(); |
|
} |
|
--------------------------------------- |
|
|
|
----------Respuesta de phpAMI---------- |
|
Array |
|
( |
|
[Response] => Success |
|
[EventList] => start |
|
[Message] => Channels will follow |
|
[List] => Array |
|
( |
|
[IAX2/216.207.245.8:4569-1164] => Array |
|
( |
|
[Event] => CoreShowChannel |
|
[Channel] => IAX2/216.207.245.8:4569-1164 |
|
[UniqueID] => 1330459157.58 |
|
[Context] => |
|
[Extension] => |
|
[Priority] => 1 |
|
[ChannelState] => 6 |
|
[ChannelStateDesc] => Up |
|
[Application] => AppDial |
|
[ApplicationData] => (Outgoing Line) |
|
[CallerIDnum] => 500 |
|
[CallerIDname] => |
|
[ConnectedLineNum] => 11 |
|
[ConnectedLineName] => Cuarto Tito |
|
[Duration] => 00:00:05 |
|
[AccountCode] => |
|
[BridgedChannel] => SIP/ipphone-00000019 |
|
[BridgedUniqueID] => 1330459142.57 |
|
) |
|
|
|
[SIP/ipphone-00000019] => Array |
|
( |
|
[Event] => CoreShowChannel |
|
[Channel] => SIP/ipphone-00000019 |
|
[UniqueID] => 1330459142.57 |
|
[Context] => home |
|
[Extension] => 500 |
|
[Priority] => 2 |
|
[ChannelState] => 6 |
|
[ChannelStateDesc] => Up |
|
[Application] => Dial |
|
[ApplicationData] => IAX2/guest@pbx.digium.com/s@default |
|
[CallerIDnum] => 11 |
|
[CallerIDname] => Cuarto Tito |
|
[ConnectedLineNum] => |
|
[ConnectedLineName] => |
|
[Duration] => 00:00:21 |
|
[AccountCode] => |
|
[BridgedChannel] => IAX2/216.207.245.8:4569-1164 |
|
[BridgedUniqueID] => 1330459157.58 |
|
) |
|
|
|
) |
|
|
|
[ListInfo] => Array |
|
( |
|
[Event] => CoreShowChannelsComplete |
|
[EventList] => Complete |
|
[ListItems] => 2 |
|
) |
|
|
|
) |
|
|
|
Si No hay Canales activos Responde: |
|
Array |
|
( |
|
[Response] => Success |
|
[EventList] => start |
|
[Message] => Channels will follow |
|
[List] => Array |
|
( |
|
) |
|
|
|
[ListInfo] => Array |
|
( |
|
[Event] => CoreShowChannelsComplete |
|
[EventList] => Complete |
|
[ListItems] => 0 |
|
) |
|
|
|
) |
|
---------------------------------------
|
|
|