res_pjsip_pubsub: Persist subscriptions in sorcery so they are recreated on startup.

This change makes res_pjsip_pubsub persist inbound subscriptions in sorcery. By default
this uses the local astdb but it can also be configured to store within an outside
database. When Asterisk is started these subscriptions are recreated if they have not
expired. Notifications are sent to the devices which have subscribed and they are none
the wiser that the system has restarted.

Review: https://reviewboard.asterisk.org/r/3598/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@415766 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Joshua Colp
2014-06-12 11:33:13 +00:00
parent 3673d2978b
commit 197505339d
8 changed files with 542 additions and 37 deletions

View File

@@ -1223,6 +1223,23 @@ pjsip_dialog *ast_sip_create_dialog_uac(const struct ast_sip_endpoint *endpoint,
*/
pjsip_dialog *ast_sip_create_dialog_uas(const struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata);
/*!
* \brief General purpose method for creating an rdata structure using specific information
*
* \param rdata[out] The rdata structure that will be populated
* \param packet A SIP message
* \param src_name The source IP address of the message
* \param src_port The source port of the message
* \param transport_type The type of transport the message was received on
* \param local_name The local IP address the message was received on
* \param local_port The local port the message was received on
*
* \retval 0 success
* \retval -1 failure
*/
int ast_sip_create_rdata(pjsip_rx_data *rdata, char *packet, const char *src_name, int src_port, char *transport_type,
const char *local_name, int local_port);
/*!
* \brief General purpose method for creating a SIP request
*

View File

@@ -455,6 +455,18 @@ pjsip_evsub *ast_sip_subscription_get_evsub(struct ast_sip_subscription *sub);
*/
pjsip_dialog *ast_sip_subscription_get_dlg(struct ast_sip_subscription *sub);
/*!
* \brief Accept a subscription request
*
* \param sub The subscription to be accepted
* \param rdata The received subscription request
* \param response The response code to send
*
* \retval 0 Success
* \retval non-zero Failure
*/
int ast_sip_subscription_accept(struct ast_sip_subscription *sub, pjsip_rx_data *rdata, int response);
/*!
* \brief Send a request created via a PJSIP evsub method
*