Asterisk Manager API Action Command

Asterisk Manager API Action: Command

Action: Command
Parameters: Command (Asterisk CLI command, not an application command), ActionID

Example (Show Channels) via Asterisk 1.0.9:
SEND:
ACTION: COMMAND
command: Show Channels


RECEIVE:
Response: Follows
Channel (Context Extension Pri ) State Appl. Data
0 active channel(s)
--END COMMAND--



Note

The sequence in the response event doesn't send a carriage return - line feed (\r\n), it only sends a line-feed (\n), if you write a handler who wait for a carriage return - line feed, the result sequence is ignored and send the respond that you mention.

Example
Response: Follows\r\n
Channel Location State Application(Data)\n
SIP/x7065551212b-1af (None) Ringing AppDial((Outgoing Line))\n
SIP/x7065551212c-2aa 29@default:2 Ring Dial(SIP/x7065551212b)\n
2 active channels\n
1 active call\r\n
--END COMMAND--\r\n
\r\n


(I'm not sure about the \r after "1 active call" at the moment, I can't check. - flobi)

Back

Asterisk Manager API

Asterisk Manager API Action: Command

Action: Command
Parameters: Command (Asterisk CLI command, not an application command), ActionID

Example (Show Channels) via Asterisk 1.0.9:
SEND:
ACTION: COMMAND
command: Show Channels


RECEIVE:
Response: Follows
Channel (Context Extension Pri ) State Appl. Data
0 active channel(s)
--END COMMAND--



Note

The sequence in the response event doesn't send a carriage return - line feed (\r\n), it only sends a line-feed (\n), if you write a handler who wait for a carriage return - line feed, the result sequence is ignored and send the respond that you mention.

Example
Response: Follows\r\n
Channel Location State Application(Data)\n
SIP/x7065551212b-1af (None) Ringing AppDial((Outgoing Line))\n
SIP/x7065551212c-2aa 29@default:2 Ring Dial(SIP/x7065551212b)\n
2 active channels\n
1 active call\r\n
--END COMMAND--\r\n
\r\n


(I'm not sure about the \r after "1 active call" at the moment, I can't check. - flobi)

Back

Asterisk Manager API

Created by: flobi, Last modification: Mon 22 of Jan, 2007 (16:41 UTC) by evanpetten
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+