[asterisk-commits] oej: branch oej/bring-in-the-early-media-1.4 r314016 - in /team/oej/bring-in-...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Apr 18 07:05:16 CDT 2011


Author: oej
Date: Mon Apr 18 07:05:09 2011
New Revision: 314016

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=314016
Log:
Adding a newstate state for call progress

	Event: Newstate
	Privilege: call,all
	Channel: SIP/olle-00000000
	State: progress
	CallerID: olle
	CallerIDName: Olle Johansson
	Uniqueid: 1303126495.0

(This includes a fix in chan_sip that is handled in reviewboard/issues.asterisk.org)

Modified:
    team/oej/bring-in-the-early-media-1.4/apps/app_dial.c
    team/oej/bring-in-the-early-media-1.4/channels/chan_sip.c
    team/oej/bring-in-the-early-media-1.4/main/pbx.c

Modified: team/oej/bring-in-the-early-media-1.4/apps/app_dial.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/bring-in-the-early-media-1.4/apps/app_dial.c?view=diff&rev=314016&r1=314015&r2=314016
==============================================================================
--- team/oej/bring-in-the-early-media-1.4/apps/app_dial.c (original)
+++ team/oej/bring-in-the-early-media-1.4/apps/app_dial.c Mon Apr 18 07:05:09 2011
@@ -419,6 +419,26 @@
 			   dst->uniqueid);
 }
 
+/*! \brief Send manager progress event */
+static void dial_manager_progress_event(struct ast_channel *chan)
+{
+	if (chan->_state == AST_STATE_UP) {
+		return;
+	}
+
+	manager_event(EVENT_FLAG_CALL,
+      		"Newstate",
+     		"Channel: %s\r\n"
+      		"State: progress\r\n"
+      		"CallerID: %s\r\n"
+      		"CallerIDName: %s\r\n"
+      		"Uniqueid: %s\r\n",
+      		chan->name, 
+      		S_OR(chan->cid.cid_num, "<unknown>"),
+      		S_OR(chan->cid.cid_name, "<unknown>"),
+      		chan->uniqueid);
+}
+
 static struct ast_channel *wait_for_answer(struct ast_channel *in, struct dial_localuser *outgoing, int *to, struct ast_flags *peerflags, int *sentringing, char *status, size_t statussize, int busystart, int nochanstart, int congestionstart, int priority_jump, int *result)
 {
 	int numbusy = busystart;
@@ -672,6 +692,9 @@
 				case AST_CONTROL_PROGRESS:
 					if (option_verbose > 2)
 						ast_verbose (VERBOSE_PREFIX_3 "%s is making progress passing it to %s\n", c->name, in->name);
+					dial_manager_progress_event(c);
+					dial_manager_progress_event(in);
+
 					/* Setup early media if appropriate */
 					if (single && CAN_EARLY_BRIDGE(peerflags, in, c))
 						ast_rtp_early_bridge(in, c);

Modified: team/oej/bring-in-the-early-media-1.4/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/bring-in-the-early-media-1.4/channels/chan_sip.c?view=diff&rev=314016&r1=314015&r2=314016
==============================================================================
--- team/oej/bring-in-the-early-media-1.4/channels/chan_sip.c (original)
+++ team/oej/bring-in-the-early-media-1.4/channels/chan_sip.c Mon Apr 18 07:05:09 2011
@@ -4061,6 +4061,10 @@
 			return 0;
 		}
 		if (p) {
+			if (p->t38.state == T38_ENABLED && !p->t38.direct) {
+				/* drop frame, can't sent VOICE frames while in T.38 mode */
+				break;
+			}
 			ast_mutex_lock(&p->lock);
 			if (p->rtp) {
 				/* If channel is not up, activate early media session */
@@ -4073,12 +4077,9 @@
 						transmit_provisional_response(p, "183 Session Progress", &p->initreq, 1);
 						ast_set_flag(&p->flags[0], SIP_PROGRESS_SENT);
 					}
-				} else if (p->t38.state == T38_ENABLED && !p->t38.direct) {
-					/* drop frame, can't sent VOICE frames while in T.38 mode */
-				} else {
-					p->lastrtptx = time(NULL);
-					res = ast_rtp_write(p->rtp, frame);
-				}
+				} 
+				p->lastrtptx = time(NULL);
+				res = ast_rtp_write(p->rtp, frame);
 			}
 			ast_mutex_unlock(&p->lock);
 		}

Modified: team/oej/bring-in-the-early-media-1.4/main/pbx.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/bring-in-the-early-media-1.4/main/pbx.c?view=diff&rev=314016&r1=314015&r2=314016
==============================================================================
--- team/oej/bring-in-the-early-media-1.4/main/pbx.c (original)
+++ team/oej/bring-in-the-early-media-1.4/main/pbx.c Mon Apr 18 07:05:09 2011
@@ -5504,6 +5504,20 @@
  */
 static int pbx_builtin_progress(struct ast_channel *chan, void *data)
 {
+	if (chan->_state != AST_STATE_UP) {
+		manager_event(EVENT_FLAG_CALL,
+			"Newstate",
+			"Channel: %s\r\n"
+			"State: Progress\r\n"
+			"CallerID: %s\r\n"
+			"CallerIDName: %s\r\n"
+		      	"Uniqueid: %s\r\n",
+		      	chan->name, 
+		      	S_OR(chan->cid.cid_num, "<unknown>"),
+		      	S_OR(chan->cid.cid_name, "<unknown>"),
+		      	chan->uniqueid);
+	}
+
 	ast_indicate(chan, AST_CONTROL_PROGRESS);
 	return 0;
 }




More information about the asterisk-commits mailing list