mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-09 22:45:49 +00:00
res_pjsip_mwi: Add voicemail extension and mwi_subscribe_replaces_unsolicited
res_pjsip_mwi was missing the chan_sip "vmexten" functionality which adds the Message-Account header to the MWI NOTIFY. Also, specifying mailboxes on endpoints for unsolicited mwi and on aors for subscriptions required that the admin know in advance which the client wanted. If you specified mailboxes on the endpoint, subscriptions were rejected even if you also specified mailboxes on the aor. Voicemail extension: * Added a global default_voicemail_extension which defaults to "". * Added voicemail_extension to both endpoint and aor. * Added ast_sip_subscription_get_dialog for support. * Added ast_sip_subscription_get_sip_uri for support. When an unsolicited NOTIFY is constructed, the From header is parsed, the voicemail extension from the endpoint is substituted for the user, and the result placed in the Message-Account field in the body. When a subscribed NOTIFY is constructed, the subscription dialog local uri is parsed, the voicemail_extension from the aor (looked up from the subscription resource name) is substituted for the user, and the result placed in the Message-Account field in the body. If no voicemail extension was defined, the Message-Account field is not added to the NOTIFY body. mwi_subscribe_replaces_unsolicited: * Added mwi_subscribe_replaces_unsolicited to endpoint. The previous behavior was to reject a subscribe if a previous internal subscription for unsolicited MWI was found for the mailbox. That remains the default. However, if there are mailboxes also set on the aor and the client subscribes and mwi_subscribe_replaces_unsolicited is set, the existing internal subscription is removed and replaced with the external subscription. This allows an admin to configure mailboxes on both the endpoint and aor and allows the client to select which to use. ASTERISK-25865 #close Reported-by: Ross Beer Change-Id: Ic15a9415091760539c7134a5ba3dc4a6a1217cea
This commit is contained in:
@@ -310,6 +310,8 @@ struct ast_sip_aor {
|
||||
unsigned int support_path;
|
||||
/*! Qualify timeout. 0 is diabled. */
|
||||
double qualify_timeout;
|
||||
/* Voicemail extension to set in Message-Account */
|
||||
char *voicemail_extension;
|
||||
};
|
||||
|
||||
/*!
|
||||
@@ -464,6 +466,10 @@ struct ast_sip_mwi_configuration {
|
||||
);
|
||||
/* Should mailbox states be combined into a single notification? */
|
||||
unsigned int aggregate;
|
||||
/* Should a subscribe replace unsolicited notifies? */
|
||||
unsigned int subscribe_replaces_unsolicited;
|
||||
/* Voicemail extension to set in Message-Account */
|
||||
char *voicemail_extension;
|
||||
};
|
||||
|
||||
/*!
|
||||
@@ -2163,6 +2169,16 @@ char *ast_sip_get_regcontext(void);
|
||||
*/
|
||||
char *ast_sip_get_endpoint_identifier_order(void);
|
||||
|
||||
/*!
|
||||
* \brief Retrieve the default voicemail extension.
|
||||
* \since 13.9.0
|
||||
*
|
||||
* \note returned string needs to be de-allocated by caller.
|
||||
*
|
||||
* \retval the default voicemail extension
|
||||
*/
|
||||
char *ast_sip_get_default_voicemail_extension(void);
|
||||
|
||||
/*!
|
||||
* \brief Retrieve the global default from user.
|
||||
*
|
||||
@@ -2302,4 +2318,5 @@ int ast_sip_set_tpselector_from_transport_name(const char *transport_name, pjsip
|
||||
void ast_sip_modify_id_header(pj_pool_t *pool, pjsip_fromto_hdr *id_hdr,
|
||||
const struct ast_party_id *id);
|
||||
|
||||
|
||||
#endif /* _RES_PJSIP_H */
|
||||
|
Reference in New Issue
Block a user