Asterisk Manager API Action ExtensionState

Action: ExtensionState
Parameters: Exten, Context, ActionID

SEND:
ACTION: ExtensionState
Context: default
Exten: idonno
ActionID: 1


RECEIVE:
Response: Success
ActionID: 1
Message: Extension Status
Exten: idonno
Context: default
Hint:
Status: -1


Status codes:
-1 = Extension not found
0 = Idle
1 = In Use
2 = Busy
4 = Unavailable
8 = Ringing
16 = On Hold

Back

Asterisk Manager API



NOTE:
Status codes are BIT SHIFTED and can be COMBINED, ie you could receive a 9 indicating Ringing (8) and In use (1)

see source in /include/asterisk/pbx.h

/*! \brief Extension states
\note States can be combined
- \ref AstExtState
  • /
enum ast_extension_states {
AST_EXTENSION_REMOVED = -2, /*!< Extension removed */
AST_EXTENSION_DEACTIVATED = -1, /*!< Extension hint removed */
AST_EXTENSION_NOT_INUSE = 0, /*!< No device INUSE or BUSY */
AST_EXTENSION_INUSE = 1 << 0, /*!< One or more devices INUSE */
AST_EXTENSION_BUSY = 1 << 1, /*!< All devices BUSY */
AST_EXTENSION_UNAVAILABLE = 1 << 2, /*!< All devices UNAVAILABLE/UNREGISTERED */
AST_EXTENSION_RINGING = 1 << 3, /*!< All devices RINGING */
AST_EXTENSION_ONHOLD = 1 << 4, /*!< All devices ONHOLD */
};

Action: ExtensionState
Parameters: Exten, Context, ActionID

SEND:
ACTION: ExtensionState
Context: default
Exten: idonno
ActionID: 1


RECEIVE:
Response: Success
ActionID: 1
Message: Extension Status
Exten: idonno
Context: default
Hint:
Status: -1


Status codes:
-1 = Extension not found
0 = Idle
1 = In Use
2 = Busy
4 = Unavailable
8 = Ringing
16 = On Hold

Back

Asterisk Manager API



NOTE:
Status codes are BIT SHIFTED and can be COMBINED, ie you could receive a 9 indicating Ringing (8) and In use (1)

see source in /include/asterisk/pbx.h

/*! \brief Extension states
\note States can be combined
- \ref AstExtState
  • /
enum ast_extension_states {
AST_EXTENSION_REMOVED = -2, /*!< Extension removed */
AST_EXTENSION_DEACTIVATED = -1, /*!< Extension hint removed */
AST_EXTENSION_NOT_INUSE = 0, /*!< No device INUSE or BUSY */
AST_EXTENSION_INUSE = 1 << 0, /*!< One or more devices INUSE */
AST_EXTENSION_BUSY = 1 << 1, /*!< All devices BUSY */
AST_EXTENSION_UNAVAILABLE = 1 << 2, /*!< All devices UNAVAILABLE/UNREGISTERED */
AST_EXTENSION_RINGING = 1 << 3, /*!< All devices RINGING */
AST_EXTENSION_ONHOLD = 1 << 4, /*!< All devices ONHOLD */
};

Created by: flobi, Last modification: Tue 25 of Nov, 2014 (14:43 UTC) by verishare
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+