diff options
author | Mark Michelson <mmichelson@digium.com> | 2014-02-13 18:52:08 +0000 |
---|---|---|
committer | Mark Michelson <mmichelson@digium.com> | 2014-02-13 18:52:08 +0000 |
commit | 584f9bafa0bddef3862cbe08412082a2f0d3db4f (patch) | |
tree | ecd0d82ada3601821ff5c56a1de08670efeb6b16 /res/res_pjsip_pubsub.c | |
parent | db0d0363af93968ce4c80195572cddda053dfbd1 (diff) |
Remove all PJSIP MWI-specific use from our MWI code.
PJSIP has built-in MWI code that could be useful to some
degree, but our utilization of the API actually made our
code a bit more cluttered since we had to have special
cases peppered throughout.
With this change, we move to using the pjsip_evsub API
instead, which streamlines the code by removing special
cases.
Review: https://reviewboard.asterisk.org/r/3205
........
Merged revisions 408005 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@408006 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip_pubsub.c')
-rw-r--r-- | res/res_pjsip_pubsub.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c index f10bf41fc..857d21eab 100644 --- a/res/res_pjsip_pubsub.c +++ b/res/res_pjsip_pubsub.c @@ -373,19 +373,11 @@ static pjsip_evsub *allocate_evsub(const char *event, enum ast_sip_subscription_ * built-in events */ if (role == AST_SIP_NOTIFIER) { - if (!strcmp(event, "message-summary")) { - pjsip_mwi_create_uas(dlg, &pubsub_cb, rdata, &evsub); - } else { - pjsip_evsub_create_uas(dlg, &pubsub_cb, rdata, 0, &evsub); - } + pjsip_evsub_create_uas(dlg, &pubsub_cb, rdata, 0, &evsub); } else { - if (!strcmp(event, "message-summary")) { - pjsip_mwi_create_uac(dlg, &pubsub_cb, 0, &evsub); - } else { - pj_str_t pj_event; - pj_cstr(&pj_event, event); - pjsip_evsub_create_uac(dlg, &pubsub_cb, &pj_event, 0, &evsub); - } + pj_str_t pj_event; + pj_cstr(&pj_event, event); + pjsip_evsub_create_uac(dlg, &pubsub_cb, &pj_event, 0, &evsub); } return evsub; } @@ -678,11 +670,7 @@ int ast_sip_register_subscription_handler(struct ast_sip_subscription_handler *h pj_cstr(&event, handler->event_name); - if (!strcmp(handler->event_name, "message-summary")) { - pjsip_mwi_init_module(ast_sip_get_pjsip_endpoint(), pjsip_evsub_instance()); - } else { - pjsip_evsub_register_pkg(&pubsub_module, &event, DEFAULT_EXPIRES, i, accept); - } + pjsip_evsub_register_pkg(&pubsub_module, &event, DEFAULT_EXPIRES, i, accept); sub_add_handler(handler); return 0; |