mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-21 12:54:56 +00:00
chan_pjsip: Add PJSIPHangup dialplan app and manager action
See UserNote below. Exposed the existing Hangup AMI action in manager.c so we can use all of it's channel search and AMI protocol handling without duplicating that code in dialplan_functions.c. Added a lookup function to res_pjsip.c that takes in the string represenation of the pjsip_status_code enum and returns the actual status code. I.E. ast_sip_str2rc("DECLINE") returns 603. This allows the caller to specify PJSIPHangup(decline) in the dialplan, just like Hangup(call_rejected). Also extracted the XML documentation to its own file since it was almost as large as the code itself. UserNote: A new dialplan app PJSIPHangup and AMI action allows you to hang up an unanswered incoming PJSIP call with a specific SIP response code in the 400 -> 699 range.
This commit is contained in:
@@ -148,4 +148,24 @@ int pjsip_acf_dial_contacts_read(struct ast_channel *chan, const char *cmd, char
|
||||
*/
|
||||
int pjsip_acf_parse_uri_read(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t len);
|
||||
|
||||
#endif /* _PJSIP_DIALPLAN_FUNCTIONS */
|
||||
/*!
|
||||
* \brief Hang up an incoming PJSIP channel with a SIP response code
|
||||
* \param chan The channel the function is called on
|
||||
* \param data SIP response code or name
|
||||
*
|
||||
* \retval 0 on success
|
||||
* \retval -1 on failure
|
||||
*/
|
||||
int pjsip_app_hangup(struct ast_channel *chan, const char *data);
|
||||
|
||||
/*!
|
||||
* \brief Manager action to hang up an incoming PJSIP channel with a SIP response code
|
||||
* \param s session
|
||||
* \param m message
|
||||
*
|
||||
* \retval 0 on success
|
||||
* \retval -1 on failure
|
||||
*/
|
||||
int pjsip_action_hangup(struct mansession *s, const struct message *m);
|
||||
|
||||
#endif /* _PJSIP_DIALPLAN_FUNCTIONS */
|
||||
|
Reference in New Issue
Block a user