Hello !
Please let me know where to find all valid reason codes for AMI Event: OriginateResponse - the documentation Asterisk 16 ManagerEvent_OriginateResponse - Asterisk Project - Asterisk Project Wiki is very poor.
Unfortunately, I find most of the wiki documentation poor; it is generated from structured comments, but they tend to be written by programmers, and are thus rather terse and incomplete.
The reasons appear to be mapped from hangup cause codes, for the A leg, by:
}
/*!
* \brief Attempt to convert disconnect cause to old originate reason.
*
* \todo XXX The old originate reasons need to be trashed and replaced
* with normal disconnect cause codes if the call was not answered.
* The internal consumers of the reason values would also need to be
* updated: app_originate, call files, and AMI OriginateResponse.
*/
static enum ast_control_frame_type pbx_dial_reason(enum ast_dial_result dial_result, int cause)
{
enum ast_control_frame_type pbx_reason;
if (dial_result == AST_DIAL_RESULT_ANSWERED) {
/* Remote end answered. */
pbx_reason = AST_CONTROL_ANSWER;
} else if (dial_result == AST_DIAL_RESULT_HANGUP) {
/* Caller hungup */
pbx_reason = AST_CONTROL_HANGUP;
} else {
They are the internal control message codes (I think they may also be used for IAX), as defined in:
*
* \warning
* IAX2 sends these values out over the wire. To prevent future
* incompatibilities, pick the next value in the enum from whatever
* is on the current trunk. If you lose the merge race you need to
* fix the previous branches to match what is on trunk. In addition
* you need to change chan_iax2 to explicitly allow the control
* frame over the wire if it makes sense for the frame to be passed
* to another Asterisk instance.
*/
enum ast_control_frame_type {
AST_CONTROL_HANGUP = 1, /*!< Other end has hungup */
AST_CONTROL_RING = 2, /*!< Local ring */
AST_CONTROL_RINGING = 3, /*!< Remote end is ringing */
AST_CONTROL_ANSWER = 4, /*!< Remote end has answered */
AST_CONTROL_BUSY = 5, /*!< Remote end is busy */
AST_CONTROL_TAKEOFFHOOK = 6, /*!< Make it go off hook */
AST_CONTROL_OFFHOOK = 7, /*!< Line is off hook */
AST_CONTROL_CONGESTION = 8, /*!< Congestion (circuits busy) */
AST_CONTROL_FLASH = 9, /*!< Flash hook */
AST_CONTROL_WINK = 10, /*!< Wink */
and the hangup cause names are defined in:
${HANGUPCAUSE} channel variable after a call (after execution
of "dial").
In SIP, we have a conversion table to convert between SIP
return codes and Q.931 both ways. This is to improve SIP/ISDN
compatibility.
These are the current codes, based on the Q.850/Q.931
specification:
- AST_CAUSE_UNALLOCATED 1
- AST_CAUSE_NO_ROUTE_TRANSIT_NET 2
- AST_CAUSE_NO_ROUTE_DESTINATION 3
- AST_CAUSE_MISDIALLED_TRUNK_PREFIX 5
- AST_CAUSE_CHANNEL_UNACCEPTABLE 6
- AST_CAUSE_CALL_AWARDED_DELIVERED 7
- AST_CAUSE_PRE_EMPTED 8
- AST_CAUSE_NUMBER_PORTED_NOT_HERE 14
- AST_CAUSE_NORMAL_CLEARING 16
- AST_CAUSE_USER_BUSY 17
- AST_CAUSE_NO_USER_RESPONSE 18
In terms of what is valid, any in the last list could get used, although probably only those in the first code extract ever actually get used.
system
Closed
October 29, 2022, 2:17pm
3
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.