[svn-commits] oej: branch oej/sip-t140-red r116226 - in /team/oej/sip-t140-red: ./ channels...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed May 14 07:01:29 CDT 2008


Author: oej
Date: Wed May 14 07:01:28 2008
New Revision: 116226

URL: http://svn.digium.com/view/asterisk?view=rev&rev=116226
Log:
Update to trunk

Modified:
    team/oej/sip-t140-red/   (props changed)
    team/oej/sip-t140-red/channels/chan_sip.c
    team/oej/sip-t140-red/res/res_agi.c

Propchange: team/oej/sip-t140-red/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed May 14 07:01:28 2008
@@ -1,1 +1,1 @@
-/trunk:1-116218
+/trunk:1-116225

Modified: team/oej/sip-t140-red/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/sip-t140-red/channels/chan_sip.c?view=diff&rev=116226&r1=116225&r2=116226
==============================================================================
--- team/oej/sip-t140-red/channels/chan_sip.c (original)
+++ team/oej/sip-t140-red/channels/chan_sip.c Wed May 14 07:01:28 2008
@@ -25,15 +25,21 @@
  * See Also:
  * \arg \ref AstCREDITS
  *
- * Implementation of RFC 3261 - without S/MIME, TCP and TLS support
+ * Implementation of RFC 3261 - without S/MIME, and experimental TCP and TLS support
  * Configuration file \link Config_sip sip.conf \endlink
  *
+ * ********** IMPORTANT *
+ * \note TCP/TLS support is EXPERIMENTAL and WILL CHANGE. This applies to configuration
+ *	settings, dialplan commands and dialplans apps/functions
+ * 
  *
+ * TODO:s
  * \todo Better support of forking
  * \todo VIA branch tag transaction checking
  * \todo Transaction support
  * \todo We need to test TCP sessions with SIP proxies and in regards
  *       to the SIP outbound specs.
+ * \todo Fix TCP/TLS handling in dialplan, SRV records, transfers and much more
  *
  * \ingroup channel_drivers
  *
@@ -12022,7 +12028,7 @@
 	Reference: RFC 3428 */
 static void receive_message(struct sip_pvt *p, struct sip_request *req)
 {
-	char buf[1024];
+	char buf[1400];	
 	struct ast_frame f;
 	const char *content_type = get_header(req, "Content-Type");
 
@@ -12043,7 +12049,7 @@
 
 	if (p->owner) {
 		if (sip_debug_test_pvt(p))
-			ast_verbose("Message received: '%s'\n", buf);
+			ast_verbose("SIP Text message received: '%s'\n", buf);
 		memset(&f, 0, sizeof(f));
 		f.frametype = AST_FRAME_TEXT;
 		f.subclass = 0;
@@ -12052,11 +12058,13 @@
 		f.datalen = strlen(buf);
 		ast_queue_frame(p->owner, &f);
 		transmit_response(p, "202 Accepted", req); /* We respond 202 accepted, since we relay the message */
-	} else { /* Message outside of a call, we do not support that */
-		ast_log(LOG_WARNING, "Received message to %s from %s, dropped it...\n  Content-Type:%s\n  Message: %s\n", get_header(req, "To"), get_header(req, "From"), content_type, buf);
-		transmit_response(p, "405 Method Not Allowed", req);
-		sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
-	}
+		return;
+	}
+
+	/* Message outside of a call, we do not support that */
+	ast_log(LOG_WARNING, "Received message to %s from %s, dropped it...\n  Content-Type:%s\n  Message: %s\n", get_header(req, "To"), get_header(req, "From"), content_type, buf);
+	transmit_response(p, "405 Method Not Allowed", req);
+	sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT);
 	return;
 }
 

Modified: team/oej/sip-t140-red/res/res_agi.c
URL: http://svn.digium.com/view/asterisk/team/oej/sip-t140-red/res/res_agi.c?view=diff&rev=116226&r1=116225&r2=116226
==============================================================================
--- team/oej/sip-t140-red/res/res_agi.c (original)
+++ team/oej/sip-t140-red/res/res_agi.c Wed May 14 07:01:28 2008
@@ -811,15 +811,13 @@
 	if (res == 0) {
 		ast_agi_fdprintf(chan, agi->fd, "200 result=%d (timeout)\n", res);
 		return RESULT_SUCCESS;
-	}
+	} 
 	if (res > 0) {
 		ast_agi_fdprintf(chan, agi->fd, "200 result=%d\n", res);
 		return RESULT_SUCCESS;
 	}
-	else {
-		ast_agi_fdprintf(chan, agi->fd, "200 result=%d (hangup)\n", res);
-		return RESULT_FAILURE;
-	}
+	ast_agi_fdprintf(chan, agi->fd, "200 result=%d (hangup)\n", res);
+	return RESULT_FAILURE;
 }
 
 static int handle_recvtext(struct ast_channel *chan, AGI *agi, int argc, char *argv[])
@@ -829,7 +827,7 @@
 	if (argc != 3)
 		return RESULT_SHOWUSAGE;
 
-	buf = ast_recvtext(chan,atoi(argv[2]));
+	buf = ast_recvtext(chan, atoi(argv[2]));
 	if (buf) {
 		ast_agi_fdprintf(chan, agi->fd, "200 result=1 (%s)\n", buf);
 		ast_free(buf);
@@ -846,19 +844,23 @@
 	if (argc != 3)
 		return RESULT_SHOWUSAGE;
 
-	if (!strncasecmp(argv[2],"on",2)) 
+	if (!strncasecmp(argv[2],"on",2)) {
 		x = 1; 
-	else 
+	} else  {
 		x = 0;
-	if (!strncasecmp(argv[2],"mate",4)) 
+	}
+	if (!strncasecmp(argv[2],"mate",4))  {
 		x = 2;
-	if (!strncasecmp(argv[2],"tdd",3))
+	}
+	if (!strncasecmp(argv[2],"tdd",3)) {
 		x = 1;
+	}
 	res = ast_channel_setoption(chan, AST_OPTION_TDD, &x, sizeof(char), 0);
-	if (res != RESULT_SUCCESS)
+	if (res != RESULT_SUCCESS) {
 		ast_agi_fdprintf(chan, agi->fd, "200 result=0\n");
-	else
+	} else {
 		ast_agi_fdprintf(chan, agi->fd, "200 result=1\n");
+	}
 	return RESULT_SUCCESS;
 }
 
@@ -866,12 +868,14 @@
 {
 	int res;
 
-	if (argc != 3)
-		return RESULT_SHOWUSAGE;
+	if (argc != 3) {
+		return RESULT_SHOWUSAGE;
+	}
 
 	res = ast_send_image(chan, argv[2]);
-	if (!ast_check_hangup(chan))
+	if (!ast_check_hangup(chan)) {
 		res = 0;
+	}
 	ast_agi_fdprintf(chan, agi->fd, "200 result=%d\n", res);
 	return (res >= 0) ? RESULT_SUCCESS : RESULT_FAILURE;
 }
@@ -879,33 +883,31 @@
 static int handle_controlstreamfile(struct ast_channel *chan, AGI *agi, int argc, char *argv[])
 {
 	int res = 0, skipms = 3000;
-	char *fwd = NULL, *rev = NULL, *pause = NULL, *stop = NULL;
-
-	if (argc < 5 || argc > 9)
-		return RESULT_SHOWUSAGE;
-
-	if (!ast_strlen_zero(argv[4]))
+	char *fwd = "#", *rev = "*", *pause = NULL, *stop = NULL;	/* Default values */
+
+	if (argc < 5 || argc > 9) {
+		return RESULT_SHOWUSAGE;
+	}
+
+	if (!ast_strlen_zero(argv[4])) {
 		stop = argv[4];
-	else
-		stop = NULL;
-	
-	if ((argc > 5) && (sscanf(argv[5], "%d", &skipms) != 1))
-		return RESULT_SHOWUSAGE;
-
-	if (argc > 6 && !ast_strlen_zero(argv[6]))
+	}
+	
+	if ((argc > 5) && (sscanf(argv[5], "%d", &skipms) != 1)) {
+		return RESULT_SHOWUSAGE;
+	}
+
+	if (argc > 6 && !ast_strlen_zero(argv[6])) {
 		fwd = argv[6];
-	else
-		fwd = "#";
-
-	if (argc > 7 && !ast_strlen_zero(argv[7]))
+	} 
+
+	if (argc > 7 && !ast_strlen_zero(argv[7])) {
 		rev = argv[7];
-	else
-		rev = "*";
-	
-	if (argc > 8 && !ast_strlen_zero(argv[8]))
+	}
+	
+	if (argc > 8 && !ast_strlen_zero(argv[8])) {
 		pause = argv[8];
-	else
-		pause = NULL;
+	} 
 	
 	res = ast_control_streamfile(chan, argv[3], fwd, rev, stop, pause, NULL, skipms, NULL);
 	




More information about the svn-commits mailing list