[asterisk-commits] kaii: branch kaii/1.8-multicall r365571 - /team/kaii/1.8-multicall/channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue May 8 03:52:58 CDT 2012


Author: kaii
Date: Tue May  8 03:52:52 2012
New Revision: 365571

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=365571
Log:
fix broken build with unsolicited MWI storage in eventlist + astdb


Modified:
    team/kaii/1.8-multicall/channels/chan_sip.c

Modified: team/kaii/1.8-multicall/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/kaii/1.8-multicall/channels/chan_sip.c?view=diff&rev=365571&r1=365570&r2=365571
==============================================================================
--- team/kaii/1.8-multicall/channels/chan_sip.c (original)
+++ team/kaii/1.8-multicall/channels/chan_sip.c Tue May  8 03:52:52 2012
@@ -1270,7 +1270,7 @@
 static void copy_request(struct sip_request *dst, const struct sip_request *src);
 static void receive_message(struct sip_pvt *p, struct sip_request *req);
 static void parse_moved_contact(struct sip_pvt *p, struct sip_request *req, char **name, char **number, int set_call_forward);
-static int sip_send_mwi_to_peer(struct sip_peer *peer, int cache_only);
+static int sip_send_mwi_to_peer(struct sip_peer *peer, const struct ast_event *event, int cache_only);
 
 /* Misc dialog routines */
 static int __sip_autodestruct(const void *data);
@@ -14495,7 +14495,7 @@
 {
 	struct sip_peer *peer = userdata;
 
-	sip_send_mwi_to_peer(peer, 0);
+	sip_send_mwi_to_peer(peer, event, 0);
 }
 
 static void network_change_event_subscribe(void)
@@ -21691,10 +21691,13 @@
 	/* Mostly created to return proper answers on notifications on outbound REFER's */
 	int res = 0;
 	const char *event = get_header(req, "Event");
+	char *eventid = NULL;
 	char *sep;
+	int cache_to_db = FALSE;
 
 	if( (sep = strchr(event, ';')) ) {	/* XXX bug here - overwriting string ? */
 		*sep++ = '\0';
+		eventid = sep;
 	}
 	
 	if (sipdebug)
@@ -21904,7 +21907,7 @@
 
 			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, "SIP_Remote",
+						   AST_EVENT_IE_CONTEXT, AST_EVENT_IE_PLTYPE_STR, context,
 						   AST_EVENT_IE_NEWMSGS, AST_EVENT_IE_PLTYPE_UINT, atoi(new),
 						   AST_EVENT_IE_OLDMSGS, AST_EVENT_IE_PLTYPE_UINT, atoi(old),
 						   AST_EVENT_IE_END))) {
@@ -24927,7 +24930,7 @@
 				struct sip_peer *peer = p->relatedpeer;
 				ref_peer(peer, "ensure a peer ref is held during MWI sending");
 				ao2_unlock(p);
-				sip_send_mwi_to_peer(peer, 0);
+				sip_send_mwi_to_peer(peer, NULL, 0);
 				ao2_lock(p);
 				unref_peer(peer, "release a peer ref now that MWI is sent");
 			}
@@ -25651,7 +25654,7 @@
 /*! \brief Send message waiting indication to alert peer that they've got voicemail
  *  \note Both peer and associated sip_pvt must be unlocked prior to calling this function
 */
-static int sip_send_mwi_to_peer(struct sip_peer *peer, int cache_only)
+static int sip_send_mwi_to_peer(struct sip_peer *peer, const struct ast_event *event, int cache_only)
 {
 	/* Called with peer lock, but releases it */
 	struct sip_pvt *p;
@@ -25710,7 +25713,7 @@
 						   AST_EVENT_IE_END))) {
 					ast_event_queue_and_cache(event);
 				}
-				ast_debug(4, "restored unsolicited MWI from ast_db to event cache. mailbox '%s' has %s new, %s old messages\n", mailbox_str->str, newmsgs, oldmsgs);
+				ast_debug(4, "restored unsolicited MWI from ast_db to event cache. mailbox '%s' has %i new, %i old messages\n", mailbox_str->str, newmsgs, oldmsgs);
 			}
 		}
 		ao2_lock(peer);
@@ -27932,7 +27935,7 @@
 		/* 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
 		 * way, then we will get events when app_voicemail gets loaded. */
-		sip_send_mwi_to_peer(peer, 1);
+		sip_send_mwi_to_peer(peer, NULL, 1);
 	}
 
 	peer->the_mark = 0;




More information about the asterisk-commits mailing list