diff options
author | Joshua Colp <jcolp@digium.com> | 2015-06-17 07:04:39 -0300 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2015-06-23 08:15:05 -0500 |
commit | 7846f73432224cc78e0687e32fcf220b37844afe (patch) | |
tree | 173e77bd99f8db95b9c3a7f41515f7ab67fb55a7 /res/res_pjsip | |
parent | 1ad9a6b6b60e841b3cadda31fc786ac42f74133f (diff) |
res_pjsip_mwi: Set up unsolicited MWI upon registration.
The res_pjsip_mwi previously required a reload to set up the proper
subscriptions to allow unsolicited MWI to work. This change
makes it so the act of registering will also cause this to occur.
This is particularly useful if realtime is involved as no reload
needs to occur within Asterisk to cause the MWI information
to get sent.
ASTERISK-25180 #close
Change-Id: Id847b47de4b8b3ab8858455ccc2f07b0f915f252
Diffstat (limited to 'res/res_pjsip')
-rw-r--r-- | res/res_pjsip/location.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/res/res_pjsip/location.c b/res/res_pjsip/location.c index 37f39ba30..d87410d3b 100644 --- a/res/res_pjsip/location.c +++ b/res/res_pjsip/location.c @@ -53,6 +53,7 @@ static void contact_destroy(void *obj) struct ast_sip_contact *contact = obj; ast_string_field_free_memory(contact); + ao2_cleanup(contact->endpoint); } /*! \brief Allocator for contact */ @@ -228,7 +229,8 @@ struct ast_sip_contact *ast_sip_location_retrieve_contact(const char *contact_na } int ast_sip_location_add_contact(struct ast_sip_aor *aor, const char *uri, - struct timeval expiration_time, const char *path_info, const char *user_agent) + struct timeval expiration_time, const char *path_info, const char *user_agent, + struct ast_sip_endpoint *endpoint) { char name[MAX_OBJECT_FIELD * 2 + 3]; RAII_VAR(struct ast_sip_contact *, contact, NULL, ao2_cleanup); @@ -256,6 +258,8 @@ int ast_sip_location_add_contact(struct ast_sip_aor *aor, const char *uri, ast_string_field_set(contact, user_agent, user_agent); } + contact->endpoint = ao2_bump(endpoint); + return ast_sorcery_create(ast_sip_get_sorcery(), contact); } |