Upgrade 3CX to v18 and get it hosted free!

Asterisk Manager API Action ExtensionState

Author image

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 */
};

Related Posts:

Get 3CX - Absolutely Free!
Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.