aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_mgcp.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-09 17:07:36 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-08-09 17:07:36 +0000
commit5448fa9f9e72c6bf08162480e39edb11e2754a9e (patch)
tree39e19a7ab54bc20ed756d9df396b5c0916c5c1ff /channels/chan_mgcp.c
parent91b102ecadbbae7ee2635727fb8eb61ce274a5dc (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: http://svn.digium.com/svn/asterisk/trunk@78747 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_mgcp.c')
-rw-r--r--channels/chan_mgcp.c17
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);
}