diff options
author | Russell Bryant <russell@russellbryant.com> | 2007-08-09 17:07:36 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2007-08-09 17:07:36 +0000 |
commit | 9d1acad76b611cc2400d00da0b60fd75d07d6263 (patch) | |
tree | 39e19a7ab54bc20ed756d9df396b5c0916c5c1ff /channels/chan_mgcp.c | |
parent | eb649f932b46a10f8ec26107462183ad12759691 (diff) |
Fix a problem that I had introduced into MWI handling. I had ignored
the mailbox context. Now, all related MWI event dealings pay attention
to the context as well.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@78747 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_mgcp.c')
-rw-r--r-- | channels/chan_mgcp.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c index 198c964ad..f5e38ddf1 100644 --- a/channels/chan_mgcp.c +++ b/channels/chan_mgcp.c @@ -468,9 +468,16 @@ static int has_voicemail(struct mgcp_endpoint *p) { int new_msgs; struct ast_event *event; + char *mailbox, *context; + + context = mailbox = ast_strdupa(p->mailbox); + strsep(&context, "@"); + if (ast_strlen_zero(context)) + context = "default"; event = ast_event_get_cached(AST_EVENT_MWI, - AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR, p->mailbox, + AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR, mailbox, + AST_EVENT_IE_CONTEXT, AST_EVENT_IE_PLTYPE_STR, context, AST_EVENT_IE_NEWMSGS, AST_EVENT_IE_PLTYPE_EXISTS, AST_EVENT_IE_END); @@ -3692,8 +3699,14 @@ static struct mgcp_gateway *build_gateway(char *cat, struct ast_variable *v) ast_copy_string(e->musicclass, musicclass, sizeof(e->musicclass)); ast_copy_string(e->mailbox, mailbox, sizeof(e->mailbox)); if (!ast_strlen_zero(e->mailbox)) { + char *mailbox, *context; + context = mailbox = ast_strdupa(e->mailbox); + strsep(&context, "@"); + if (ast_strlen_zero(context)) + context = "default"; e->mwi_event_sub = ast_event_subscribe(AST_EVENT_MWI, mwi_event_cb, NULL, - AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR, e->mailbox, + AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR, mailbox, + AST_EVENT_IE_CONTEXT, AST_EVENT_IE_PLTYPE_STR, context, AST_EVENT_IE_NEWMSGS, AST_EVENT_IE_PLTYPE_EXISTS, AST_EVENT_IE_END); } |