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_zap.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_zap.c')
-rw-r--r-- | channels/chan_zap.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c index 1426f456a..4152f0e19 100644 --- a/channels/chan_zap.c +++ b/channels/chan_zap.c @@ -1850,9 +1850,16 @@ static int has_voicemail(struct zt_pvt *p) { int new_msgs; struct ast_event *event; + char *mailbox, *context; + + mailbox = context = 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); @@ -7850,8 +7857,14 @@ static struct zt_pvt *mkintf(int channel, struct zt_chan_conf conf, struct zt_pr ast_copy_string(tmp->cid_name, conf.chan.cid_name, sizeof(tmp->cid_name)); ast_copy_string(tmp->mailbox, conf.chan.mailbox, sizeof(tmp->mailbox)); if (!ast_strlen_zero(tmp->mailbox)) { + char *mailbox, *context; + mailbox = context = ast_strdupa(tmp->mailbox); + strsep(&context, "@"); + if (ast_strlen_zero(context)) + context = "default"; tmp->mwi_event_sub = ast_event_subscribe(AST_EVENT_MWI, mwi_event_cb, NULL, - AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR, tmp->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); } |