[asterisk-commits] russell: branch russell/ais r78748 - in /team/russell/ais: ./ apps/ channels/...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Aug 9 12:09:42 CDT 2007
Author: russell
Date: Thu Aug 9 12:09:41 2007
New Revision: 78748
URL: http://svn.digium.com/view/asterisk?view=rev&rev=78748
Log:
sync with trunk
Modified:
team/russell/ais/ (props changed)
team/russell/ais/apps/app_voicemail.c
team/russell/ais/channels/chan_iax2.c
team/russell/ais/channels/chan_mgcp.c
team/russell/ais/channels/chan_sip.c
team/russell/ais/channels/chan_zap.c
team/russell/ais/include/asterisk/event_defs.h
team/russell/ais/res/res_ais.c
Propchange: team/russell/ais/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Aug 9 12:09:41 2007
@@ -1,1 +1,1 @@
-/trunk:1-78740
+/trunk:1-78747
Modified: team/russell/ais/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/russell/ais/apps/app_voicemail.c?view=diff&rev=78748&r1=78747&r2=78748
==============================================================================
--- team/russell/ais/apps/app_voicemail.c (original)
+++ team/russell/ais/apps/app_voicemail.c Thu Aug 9 12:09:41 2007
@@ -3997,15 +3997,17 @@
static void queue_mwi_event(const char *mbox, int new, int old)
{
struct ast_event *event;
- char *mailbox;
+ char *mailbox, *context;
/* Strip off @default */
- mailbox = ast_strdupa(mbox);
- if (strstr(mailbox, "@default"))
- mailbox = strsep(&mailbox, "@");
+ context = mailbox = ast_strdupa(mbox);
+ strsep(&context, "@");
+ if (ast_strlen_zero(context))
+ context = "default";
if (!(event = ast_event_new(AST_EVENT_MWI,
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_UINT, new,
AST_EVENT_IE_OLDMSGS, AST_EVENT_IE_PLTYPE_UINT, old,
AST_EVENT_IE_END))) {
@@ -4016,6 +4018,7 @@
ast_event_queue_and_cache(event,
AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR,
+ AST_EVENT_IE_CONTEXT, AST_EVENT_IE_PLTYPE_STR,
AST_EVENT_IE_END);
}
Modified: team/russell/ais/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/russell/ais/channels/chan_iax2.c?view=diff&rev=78748&r1=78747&r2=78748
==============================================================================
--- team/russell/ais/channels/chan_iax2.c (original)
+++ team/russell/ais/channels/chan_iax2.c Thu Aug 9 12:09:41 2007
@@ -6054,9 +6054,16 @@
if (!ast_strlen_zero(p->mailbox)) {
struct ast_event *event;
int new, old;
+ 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_OLDMSGS, AST_EVENT_IE_PLTYPE_EXISTS,
AST_EVENT_IE_END);
@@ -9315,8 +9322,14 @@
ast_free_ha(oldha);
if (!ast_strlen_zero(peer->mailbox)) {
+ char *mailbox, *context;
+ mailbox = ast_strdupa(peer->mailbox);
+ strsep(&context, "@");
+ if (ast_strlen_zero(context))
+ context = "default";
peer->mwi_event_sub = ast_event_subscribe(AST_EVENT_MWI, mwi_event_cb, NULL,
- AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR, peer->mailbox,
+ AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR, mailbox,
+ AST_EVENT_IE_CONTEXT, AST_EVENT_IE_PLTYPE_STR, context,
AST_EVENT_IE_END);
}
Modified: team/russell/ais/channels/chan_mgcp.c
URL: http://svn.digium.com/view/asterisk/team/russell/ais/channels/chan_mgcp.c?view=diff&rev=78748&r1=78747&r2=78748
==============================================================================
--- team/russell/ais/channels/chan_mgcp.c (original)
+++ team/russell/ais/channels/chan_mgcp.c Thu Aug 9 12:09:41 2007
@@ -468,9 +468,16 @@
{
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 @@
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);
}
Modified: team/russell/ais/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/russell/ais/channels/chan_sip.c?view=diff&rev=78748&r1=78747&r2=78748
==============================================================================
--- team/russell/ais/channels/chan_sip.c (original)
+++ team/russell/ais/channels/chan_sip.c Thu Aug 9 12:09:41 2007
@@ -15756,8 +15756,14 @@
p->subscribed = MWI_NOTIFICATION;
if (ast_test_flag(&authpeer->flags[1], SIP_PAGE2_SUBSCRIBEMWIONLY)) {
+ char *mailbox, *context;
+ context = mailbox = ast_strdupa(authpeer->mailbox);
+ strsep(&context, "@");
+ if (ast_strlen_zero(context))
+ context = "default";
authpeer->mwi_event_sub = ast_event_subscribe(AST_EVENT_MWI, mwi_event_cb, authpeer,
- AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR, authpeer->mailbox,
+ AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR, mailbox,
+ AST_EVENT_IE_CONTEXT, AST_EVENT_IE_PLTYPE_STR, context,
AST_EVENT_IE_END);
}
if (authpeer->mwipvt && authpeer->mwipvt != p) /* Destroy old PVT if this is a new one */
@@ -16244,9 +16250,15 @@
return 0;
if (!event) {
+ char *mailbox, *context = NULL;
/* Check the event cache for the mailbox info */
+ context = mailbox = ast_strdupa(peer->mailbox);
+ strsep(&context, "@");
+ if (ast_strlen_zero(context))
+ context = "default";
event = cache_event = ast_event_get_cached(AST_EVENT_MWI,
- AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR, peer->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_OLDMSGS, AST_EVENT_IE_PLTYPE_EXISTS,
AST_EVENT_IE_END);
@@ -17488,8 +17500,14 @@
* subscribe to it now. */
if (!ast_test_flag(&peer->flags[1], SIP_PAGE2_SUBSCRIBEMWIONLY) &&
!ast_strlen_zero(peer->mailbox)) {
+ char *mailbox, *context;
+ context = mailbox = ast_strdupa(peer->mailbox);
+ strsep(&context, "@");
+ if (ast_strlen_zero(context))
+ context = "default";
peer->mwi_event_sub = ast_event_subscribe(AST_EVENT_MWI, mwi_event_cb, peer,
- AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR, peer->mailbox,
+ AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR, mailbox,
+ AST_EVENT_IE_CONTEXT, AST_EVENT_IE_PLTYPE_STR, context,
AST_EVENT_IE_END);
/* Send MWI from the event cache only. This is so we can send initial
* MWI if app_voicemail got loaded before chan_sip. If it is the other
Modified: team/russell/ais/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/russell/ais/channels/chan_zap.c?view=diff&rev=78748&r1=78747&r2=78748
==============================================================================
--- team/russell/ais/channels/chan_zap.c (original)
+++ team/russell/ais/channels/chan_zap.c Thu Aug 9 12:09:41 2007
@@ -1850,9 +1850,16 @@
{
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 @@
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);
}
Modified: team/russell/ais/include/asterisk/event_defs.h
URL: http://svn.digium.com/view/asterisk/team/russell/ais/include/asterisk/event_defs.h?view=diff&rev=78748&r1=78747&r2=78748
==============================================================================
--- team/russell/ais/include/asterisk/event_defs.h (original)
+++ team/russell/ais/include/asterisk/event_defs.h Thu Aug 9 12:09:41 2007
@@ -104,12 +104,18 @@
*/
AST_EVENT_IE_STATE = 0x08,
/*!
+ * \brief Context IE
+ * Used by AST_EVENT_MWI
+ * Payload type: str
+ */
+ AST_EVENT_IE_CONTEXT = 0x09,
+ /*!
* \brief Entity ID
* Used by All events
* Payload type: STR
* This IE indicates which server the event originated from
*/
- AST_EVENT_IE_EID = 0x09,
+ AST_EVENT_IE_EID = 0x0A,
};
/*!
Modified: team/russell/ais/res/res_ais.c
URL: http://svn.digium.com/view/asterisk/team/russell/ais/res/res_ais.c?view=diff&rev=78748&r1=78747&r2=78748
==============================================================================
--- team/russell/ais/res/res_ais.c (original)
+++ team/russell/ais/res/res_ais.c Thu Aug 9 12:09:41 2007
@@ -200,6 +200,7 @@
if (ast_event_get_type(ast_event) == AST_EVENT_MWI) {
ast_event_queue_and_cache(ast_event,
AST_EVENT_IE_MAILBOX, AST_EVENT_IE_PLTYPE_STR,
+ AST_EVENT_IE_CONTEXT, AST_EVENT_IE_PLTYPE_STR,
AST_EVENT_IE_END);
} else {
ast_event_queue(ast_event);
More information about the asterisk-commits
mailing list