[asterisk-commits] kharwell: branch kharwell/pimp_sip_diversion r386621 - in /team/kharwell/pimp...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Apr 26 13:38:18 CDT 2013
Author: kharwell
Date: Fri Apr 26 13:38:12 2013
New Revision: 386621
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=386621
Log:
Multiple revisions 386532,386545
........
r386532 | mmichelson | 2013-04-25 12:44:41 -0500 (Thu, 25 Apr 2013) | 8 lines
Merge SUBSCRIBE/NOTIFY support and MWI support.
(closes ASTERISK-21259)
(closes ASTERISK-21260)
Review: https://reviewboard.asterisk.org/r/2456
........
r386545 | root | 2013-04-25 14:17:50 -0500 (Thu, 25 Apr 2013) | 1 line
automerge cancel
........
Merged revisions 386532,386545 from http://svn.asterisk.org/svn/asterisk/team/group/pimp_my_sip
Added:
team/kharwell/pimp_sip_diversion/include/asterisk/res_sip_pubsub.h
- copied unchanged from r386545, team/group/pimp_my_sip/include/asterisk/res_sip_pubsub.h
team/kharwell/pimp_sip_diversion/res/res_sip_mwi.c
- copied unchanged from r386545, team/group/pimp_my_sip/res/res_sip_mwi.c
team/kharwell/pimp_sip_diversion/res/res_sip_pubsub.c
- copied unchanged from r386545, team/group/pimp_my_sip/res/res_sip_pubsub.c
team/kharwell/pimp_sip_diversion/res/res_sip_pubsub.exports.in
- copied unchanged from r386545, team/group/pimp_my_sip/res/res_sip_pubsub.exports.in
Modified:
team/kharwell/pimp_sip_diversion/ (props changed)
team/kharwell/pimp_sip_diversion/include/asterisk/res_sip.h
team/kharwell/pimp_sip_diversion/res/res_sip/location.c
team/kharwell/pimp_sip_diversion/res/res_sip/sip_configuration.c
team/kharwell/pimp_sip_diversion/res/res_sip/sip_distributor.c
Propchange: team/kharwell/pimp_sip_diversion/
------------------------------------------------------------------------------
automerge = *
Propchange: team/kharwell/pimp_sip_diversion/
------------------------------------------------------------------------------
--- pimp_sip_diversion-integrated (original)
+++ pimp_sip_diversion-integrated Fri Apr 26 13:38:12 2013
@@ -1,1 +1,1 @@
-/team/group/pimp_my_sip:1-386492
+/team/group/pimp_my_sip:1-386620
Modified: team/kharwell/pimp_sip_diversion/include/asterisk/res_sip.h
URL: http://svnview.digium.com/svn/asterisk/team/kharwell/pimp_sip_diversion/include/asterisk/res_sip.h?view=diff&rev=386621&r1=386620&r2=386621
==============================================================================
--- team/kharwell/pimp_sip_diversion/include/asterisk/res_sip.h (original)
+++ team/kharwell/pimp_sip_diversion/include/asterisk/res_sip.h Fri Apr 26 13:38:12 2013
@@ -155,6 +155,10 @@
struct ast_sip_aor {
/*! Sorcery object details, the id is the AOR name */
SORCERY_OBJECT(details);
+ AST_DECLARE_STRING_FIELDS(
+ /*! Voicemail boxes for this AOR */
+ AST_STRING_FIELD(mailboxes);
+ );
/*! Minimum expiration time */
unsigned int minimum_expiration;
/*! Maximum expiration time */
@@ -267,6 +271,8 @@
AST_STRING_FIELD(mohsuggest);
/*! Optional external media address to use in SDP */
AST_STRING_FIELD(external_media_address);
+ /*! Configured voicemail boxes for this endpoint. Used for MWI */
+ AST_STRING_FIELD(mailboxes);
);
/*! Identification information for this endpoint */
struct ast_party_id id;
@@ -330,6 +336,8 @@
unsigned int send_rpid;
/*! Do we add Diversion headers to applicable outgoing requests/responses? */
unsigned int send_diversion;
+ /*! Should unsolicited MWI be aggregated into a single NOTIFY? */
+ unsigned int aggregate_mwi;
};
/*!
@@ -781,6 +789,8 @@
/*!
* \brief Set a serializer on a SIP dialog so requests and responses are automatically serialized
*
+ * Passing a NULL serializer is a way to remove a serializer from a dialog.
+ *
* \param dlg The SIP dialog itself
* \param serializer The serializer to use
*/
Modified: team/kharwell/pimp_sip_diversion/res/res_sip/location.c
URL: http://svnview.digium.com/svn/asterisk/team/kharwell/pimp_sip_diversion/res/res_sip/location.c?view=diff&rev=386621&r1=386620&r2=386621
==============================================================================
--- team/kharwell/pimp_sip_diversion/res/res_sip/location.c (original)
+++ team/kharwell/pimp_sip_diversion/res/res_sip/location.c Fri Apr 26 13:38:12 2013
@@ -31,12 +31,18 @@
struct ast_sip_aor *aor = obj;
ao2_cleanup(aor->permanent_contacts);
+ ast_string_field_free_memory(aor);
}
/*! \brief Allocator for AOR */
static void *aor_alloc(const char *name)
{
- return ao2_alloc_options(sizeof(struct ast_sip_aor), aor_destroy, AO2_ALLOC_OPT_LOCK_NOLOCK);
+ struct ast_sip_aor *aor = ao2_alloc_options(sizeof(struct ast_sip_aor), aor_destroy, AO2_ALLOC_OPT_LOCK_NOLOCK);
+ if (!aor) {
+ return NULL;
+ }
+ ast_string_field_init(aor, 128);
+ return aor;
}
/*! \brief Destructor for contact */
@@ -250,6 +256,7 @@
ast_sorcery_object_field_register(sorcery, "aor", "max_contacts", "0", OPT_UINT_T, 0, FLDSET(struct ast_sip_aor, max_contacts));
ast_sorcery_object_field_register(sorcery, "aor", "remove_existing", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_aor, remove_existing));
ast_sorcery_object_field_register_custom(sorcery, "aor", "contact", "", permanent_uri_handler, NULL, 0, 0);
+ ast_sorcery_object_field_register(sorcery, "aor", "mailboxes", "", OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_sip_aor, mailboxes));
return 0;
}
Modified: team/kharwell/pimp_sip_diversion/res/res_sip/sip_configuration.c
URL: http://svnview.digium.com/svn/asterisk/team/kharwell/pimp_sip_diversion/res/res_sip/sip_configuration.c?view=diff&rev=386621&r1=386620&r2=386621
==============================================================================
--- team/kharwell/pimp_sip_diversion/res/res_sip/sip_configuration.c (original)
+++ team/kharwell/pimp_sip_diversion/res/res_sip/sip_configuration.c Fri Apr 26 13:38:12 2013
@@ -350,6 +350,8 @@
ast_sorcery_object_field_register(sip_sorcery, "endpoint", "send_pai", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, send_pai));
ast_sorcery_object_field_register(sip_sorcery, "endpoint", "send_rpid", "no", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, send_rpid));
ast_sorcery_object_field_register(sip_sorcery, "endpoint", "send_diversion", "yes", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, send_diversion));
+ ast_sorcery_object_field_register(sip_sorcery, "endpoint", "mailboxes", "", OPT_STRINGFIELD_T, 0, STRFLDSET(struct ast_sip_endpoint, mailboxes));
+ ast_sorcery_object_field_register(sip_sorcery, "endpoint", "aggregate_mwi", "yes", OPT_BOOL_T, 1, FLDSET(struct ast_sip_endpoint, aggregate_mwi));
if (ast_sip_initialize_sorcery_transport(sip_sorcery)) {
ast_log(LOG_ERROR, "Failed to register SIP transport support with sorcery\n");
Modified: team/kharwell/pimp_sip_diversion/res/res_sip/sip_distributor.c
URL: http://svnview.digium.com/svn/asterisk/team/kharwell/pimp_sip_diversion/res/res_sip/sip_distributor.c?view=diff&rev=386621&r1=386620&r2=386621
==============================================================================
--- team/kharwell/pimp_sip_diversion/res/res_sip/sip_distributor.c (original)
+++ team/kharwell/pimp_sip_diversion/res/res_sip/sip_distributor.c Fri Apr 26 13:38:12 2013
@@ -40,21 +40,27 @@
struct ast_sip_endpoint *endpoint;
};
+/*!
+ * \internal
+ *
+ * \note Call this with the dialog locked
+ */
static struct distributor_dialog_data *distributor_dialog_data_alloc(pjsip_dialog *dlg)
{
struct distributor_dialog_data *dist;
- pjsip_dlg_inc_lock(dlg);
dist = PJ_POOL_ZALLOC_T(dlg->pool, struct distributor_dialog_data);
pjsip_dlg_set_mod_data(dlg, distributor_mod.id, dist);
- pjsip_dlg_dec_lock(dlg);
return dist;
}
void ast_sip_dialog_set_serializer(pjsip_dialog *dlg, struct ast_taskprocessor *serializer)
{
- struct distributor_dialog_data *dist = pjsip_dlg_get_mod_data(dlg, distributor_mod.id);
+ struct distributor_dialog_data *dist;
+ SCOPED_LOCK(lock, dlg, pjsip_dlg_inc_lock, pjsip_dlg_dec_lock);
+
+ dist = pjsip_dlg_get_mod_data(dlg, distributor_mod.id);
if (!dist) {
dist = distributor_dialog_data_alloc(dlg);
}
@@ -63,7 +69,10 @@
void ast_sip_dialog_set_endpoint(pjsip_dialog *dlg, struct ast_sip_endpoint *endpoint)
{
- struct distributor_dialog_data *dist = pjsip_dlg_get_mod_data(dlg, distributor_mod.id);
+ struct distributor_dialog_data *dist;
+ SCOPED_LOCK(lock, dlg, pjsip_dlg_inc_lock, pjsip_dlg_dec_lock);
+
+ dist = pjsip_dlg_get_mod_data(dlg, distributor_mod.id);
if (!dist) {
dist = distributor_dialog_data_alloc(dlg);
}
@@ -72,7 +81,10 @@
struct ast_sip_endpoint *ast_sip_dialog_get_endpoint(pjsip_dialog *dlg)
{
- struct distributor_dialog_data *dist = pjsip_dlg_get_mod_data(dlg, distributor_mod.id);
+ struct distributor_dialog_data *dist;
+ SCOPED_LOCK(lock, dlg, pjsip_dlg_inc_lock, pjsip_dlg_dec_lock);
+
+ dist = pjsip_dlg_get_mod_data(dlg, distributor_mod.id);
if (!dist || !dist->endpoint) {
return NULL;
}
More information about the asterisk-commits
mailing list