[asterisk-commits] jdixon: branch jdixon/chan_usbradio-1.4 r141625 - /team/jdixon/chan_usbradio-...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Sep 6 18:46:55 CDT 2008


Author: jdixon
Date: Sat Sep  6 18:46:55 2008
New Revision: 141625

URL: http://svn.digium.com/view/asterisk?view=rev&rev=141625
Log:
Fixed IRLP announcement destination, hopefully

Modified:
    team/jdixon/chan_usbradio-1.4/dev-1.0/channels/chan_irlp.c

Modified: team/jdixon/chan_usbradio-1.4/dev-1.0/channels/chan_irlp.c
URL: http://svn.digium.com/view/asterisk/team/jdixon/chan_usbradio-1.4/dev-1.0/channels/chan_irlp.c?view=diff&rev=141625&r1=141624&r2=141625
==============================================================================
--- team/jdixon/chan_usbradio-1.4/dev-1.0/channels/chan_irlp.c (original)
+++ team/jdixon/chan_usbradio-1.4/dev-1.0/channels/chan_irlp.c Sat Sep  6 18:46:55 2008
@@ -158,6 +158,7 @@
 static char mycall[IRLP_CALL_SIZE + 1];
 static char mynode[IRLP_NODE_SIZE + 1];
 static char astnode[20];
+static char astnode1[20];
 static short rtcptimeout = 10;
 static short localispeakerport = 2174;
 static int radmode = 0;
@@ -435,7 +436,7 @@
 
 	fd_set fds[3];
 	struct timeval tmout;
-	int i,myaud,myctl,x;
+	int i,myaud,myctl,x,was_outbound;
 
 	char buf[LARGEST_PACKET_SIZE + 1];
 	struct sockaddr_in sin;
@@ -445,6 +446,7 @@
 	ssize_t recvlen;
         size_t len;
 	struct stat statbuf;
+	static int play_outbound = 0;
 
 	ast_log(LOG_NOTICE, "IRLP reader thread started.\n");
 	while(run_forever)
@@ -455,8 +457,19 @@
 		{
 			char mystr[60];
 
-			snprintf(mystr,sizeof(mystr) - 1,IRLP_AST_PLAYFILE,astnode);
-			if (!playing) ast_cli_command(nullfd,mystr);
+			if (!playing)
+			{
+				was_outbound = 0;
+				if (((curcall != NULL)) != play_outbound)
+				{
+					was_outbound = play_outbound;
+					play_outbound = ((curcall != NULL));
+				}
+				snprintf(mystr,sizeof(mystr) - 1,
+				    IRLP_AST_PLAYFILE,(play_outbound || 
+					was_outbound) ? astnode1 : astnode);
+				ast_cli_command(nullfd,mystr);
+			}
 			playing = i;
 		}
 		myaud = (alt_audio_sock != -1) ? alt_audio_sock : audio_sock;
@@ -656,12 +669,14 @@
 	struct sockaddr_in si_me;
         
 	AST_DECLARE_APP_ARGS(args,
+		AST_APP_ARG(astnode);
 		AST_APP_ARG(nodenum);
 	);
 
 	args.nodenum = NULL;
+	args.astnode = NULL;
 	if (!ast_strlen_zero(data)) 
-		AST_STANDARD_APP_ARGS(args,data);
+		AST_NONSTANDARD_APP_ARGS(args,data,'/');
 
 	p = ast_malloc(sizeof(struct irlp_pvt));
 	if (p) {
@@ -671,6 +686,10 @@
 		rxqast.qe_back = &rxqast;
 		sprintf(stream,"%d",audio_port);
 		tx_audio_port = audio_port_cfg;
+		if ((!radmode) && args.astnode && *args.astnode)
+		{
+			strncpy(astnode1,args.astnode,sizeof(astnode1) - 1);
+		}
 		if ((!radmode) && args.nodenum && *args.nodenum)
 		{
 			nodenum = atoi(args.nodenum);




More information about the asterisk-commits mailing list