[asterisk-commits] oej: branch oej/sip-callpickup-1.2 r73666 - in /team/oej/sip-callpickup-1.2: ...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jul 6 04:42:40 CDT 2007


Author: oej
Date: Fri Jul  6 04:42:39 2007
New Revision: 73666

URL: http://svn.digium.com/view/asterisk?view=rev&rev=73666
Log:
Just checking...

Modified:
    team/oej/sip-callpickup-1.2/channels/chan_sip.c
    team/oej/sip-callpickup-1.2/include/asterisk/devicestate.h

Modified: team/oej/sip-callpickup-1.2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/sip-callpickup-1.2/channels/chan_sip.c?view=diff&rev=73666&r1=73665&r2=73666
==============================================================================
--- team/oej/sip-callpickup-1.2/channels/chan_sip.c (original)
+++ team/oej/sip-callpickup-1.2/channels/chan_sip.c Fri Jul  6 04:42:39 2007
@@ -930,7 +930,7 @@
 static int determine_firstline_parts(struct sip_request *req);
 static void sip_dump_history(struct sip_pvt *dialog);	/* Dump history to LOG_DEBUG at end of dialog, before destroying data */
 static const struct cfsubscription_types *find_subscription_type(enum subscriptiontype subtype);
-static int transmit_state_notify(struct sip_pvt *p, int state, int full, int substate, int timeout);
+static int transmit_state_notify(struct sip_pvt *p, int state, int full, int substate, int timeout, const char *channel);
 static char *gettag(struct sip_request *req, char *header, char *tagbuf, int tagbufsize);
 
 /*! \brief Definition of this channel for PBX channel registration */
@@ -1324,7 +1324,7 @@
 
 	/* If this is a subscription, tell the phone that we got a timeout */
 	if (p->subscribed) {
-		transmit_state_notify(p, AST_EXTENSION_DEACTIVATED, 1, 1, 1);	/* Send first notification */
+		transmit_state_notify(p, AST_EXTENSION_DEACTIVATED, 1, 1, 1, NULL);	/* Send first notification */
 		p->subscribed = NONE;
 		append_history(p, "Subscribestatus", "timeout");
 		return 10000;	/* Reschedule this destruction so that we know that it's gone */
@@ -5177,7 +5177,7 @@
 }
 
 /*! \brief  transmit_state_notify: Used in the SUBSCRIBE notification subsystem ----*/
-static int transmit_state_notify(struct sip_pvt *p, int state, int full, int substate, int timeout)
+static int transmit_state_notify(struct sip_pvt *p, int state, int full, int substate, int timeout, const char *channel)
 {
 	char tmp[4000], from[256], to[256];
 	char *t = tmp, *c, *a, *mfrom, *mto;
@@ -5327,6 +5327,8 @@
 		ast_build_string(&t, &maxbytes, "<dialog-info xmlns=\"urn:ietf:params:xml:ns:dialog-info\" version=\"%d\" state=\"%s\" entity=\"%s\">\n", p->dialogver++, full ? "full":"partial", mto);
 		if ((state & AST_EXTENSION_RINGING) && global_notifyringing)
 			ast_build_string(&t, &maxbytes, "<dialog id=\"%s\" direction=\"recipient\">\n", p->exten);
+			if (channel)
+				ast_build_string(&t, &maxbytes, "<!-- Asterisk channel %s -->\n", channel);
 		else
 			ast_build_string(&t, &maxbytes, "<dialog id=\"%s\">\n", p->exten);
 		ast_build_string(&t, &maxbytes, "<state>%s</state>\n", statestring);
@@ -6556,7 +6558,7 @@
 /*! \brief  cb_extensionstate: Callback for the devicestate notification (SUBSCRIBE) support subsystem ---*/
 /*    If you add an "hint" priority to the extension in the dial plan,
       you will get notifications on device state changes */
-static int cb_extensionstate(char *context, char* exten, int state, void *data)
+static int cb_extensionstate(char *context, char* exten, int state, void *data, const char *channel)
 {
 	struct sip_pvt *p = data;
 
@@ -6577,7 +6579,7 @@
 		p->laststate = state;
 		break;
 	}
-	transmit_state_notify(p, state, 1, 1, 0);
+	transmit_state_notify(p, state, 1, 1, 0, channel);
 
 	if (option_verbose > 1)
 		ast_verbose(VERBOSE_PREFIX_1 "Extension Changed %s new state %s for Notify User %s\n", exten, ast_extension_state2str(state), p->username);
@@ -11223,7 +11225,7 @@
 			struct sip_pvt *p_old;
 
 			transmit_response(p, "200 OK", req);
-			transmit_state_notify(p, firststate, 1, 1, 0);	/* Send first notification */
+			transmit_state_notify(p, firststate, 1, 1, 0, NULL);	/* Send first notification */
 			append_history(p, "Subscribestatus", ast_extension_state2str(firststate));
 
 			/* remove any old subscription from this peer for the same exten/context,

Modified: team/oej/sip-callpickup-1.2/include/asterisk/devicestate.h
URL: http://svn.digium.com/view/asterisk/team/oej/sip-callpickup-1.2/include/asterisk/devicestate.h?view=diff&rev=73666&r1=73665&r2=73666
==============================================================================
--- team/oej/sip-callpickup-1.2/include/asterisk/devicestate.h (original)
+++ team/oej/sip-callpickup-1.2/include/asterisk/devicestate.h Fri Jul  6 04:42:39 2007
@@ -42,6 +42,7 @@
 /*! Device is ringing */
 #define AST_DEVICE_RINGING	6
 
+/* The channel name will only be there if this is a channel-related event, like "ringing" */
 typedef int (*ast_devstate_cb_type)(const char *dev, int state, void *data, const char *channelname);
 
 /*! \brief Convert device state to text string for output 




More information about the asterisk-commits mailing list