summaryrefslogtreecommitdiff
path: root/include/asterisk
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2014-06-12 11:34:36 +0000
committerJoshua Colp <jcolp@digium.com>2014-06-12 11:34:36 +0000
commit58f4c18ab692ad0c43d9cb4418fc2b680bb17b80 (patch)
treed718320702c43bf77a048defeab91d1cc9c8e1c8 /include/asterisk
parent3b0ad74e1741c78afbab229cb38965280744f76d (diff)
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/ ........ Merged revisions 415766 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@415767 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk')
-rw-r--r--include/asterisk/res_pjsip.h17
-rw-r--r--include/asterisk/res_pjsip_pubsub.h12
2 files changed, 29 insertions, 0 deletions
diff --git a/include/asterisk/res_pjsip.h b/include/asterisk/res_pjsip.h
index 36d25fbec..c7e99aded 100644
--- a/include/asterisk/res_pjsip.h
+++ b/include/asterisk/res_pjsip.h
@@ -1221,6 +1221,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
*
* Its typical use would be to create one-off requests such as an out of dialog
diff --git a/include/asterisk/res_pjsip_pubsub.h b/include/asterisk/res_pjsip_pubsub.h
index 0b0a49e66..d46cbae30 100644
--- a/include/asterisk/res_pjsip_pubsub.h
+++ b/include/asterisk/res_pjsip_pubsub.h
@@ -456,6 +456,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
*
* Callers of this function should take care to do so within a SIP servant