[asterisk-commits] branch oej/videosupport r14466 - in /team/oej/videosupport: ./ apps/ channels/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Mar 23 13:20:58 MST 2006


Author: oej
Date: Thu Mar 23 14:20:55 2006
New Revision: 14466

URL: http://svn.digium.com/view/asterisk?rev=14466&view=rev
Log:
Resolve, reset, go

Modified:
    team/oej/videosupport/   (props changed)
    team/oej/videosupport/apps/app_readfile.c
    team/oej/videosupport/channels/chan_sip.c

Propchange: team/oej/videosupport/
------------------------------------------------------------------------------
    automerge = http://www.voip-forum.com/

Propchange: team/oej/videosupport/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Propchange: team/oej/videosupport/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Mar 23 14:20:55 2006
@@ -1,1 +1,1 @@
-/trunk:1-14407
+/trunk:1-14464

Modified: team/oej/videosupport/apps/app_readfile.c
URL: http://svn.digium.com/view/asterisk/team/oej/videosupport/apps/app_readfile.c?rev=14466&r1=14465&r2=14466&view=diff
==============================================================================
--- team/oej/videosupport/apps/app_readfile.c (original)
+++ team/oej/videosupport/apps/app_readfile.c Thu Mar 23 14:20:55 2006
@@ -92,15 +92,16 @@
 		}
 	}
 
-	returnvar = ast_read_textfile(file);
-	if(len > 0){
-		if(len < strlen(returnvar))
-			returnvar[len]='\0';
-		else
-			ast_log(LOG_WARNING,"%s is longer than %d, and %d \n", file, len, (int)strlen(returnvar));
+	if ((returnvar = ast_read_textfile(file))) {
+		if (len > 0) {
+			if (len < strlen(returnvar))
+				returnvar[len]='\0';
+			else
+				ast_log(LOG_WARNING, "%s is longer than %d, and %d \n", file, len, (int)strlen(returnvar));
+		}
+		pbx_builtin_setvar_helper(chan, varname, returnvar);
+		free(returnvar);
 	}
-	pbx_builtin_setvar_helper(chan, varname, returnvar);
-	free(returnvar);
 	LOCAL_USER_REMOVE(u);
 	return res;
 }

Modified: team/oej/videosupport/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/videosupport/channels/chan_sip.c?rev=14466&r1=14465&r2=14466&view=diff
==============================================================================
--- team/oej/videosupport/channels/chan_sip.c (original)
+++ team/oej/videosupport/channels/chan_sip.c Thu Mar 23 14:20:55 2006
@@ -7657,8 +7657,8 @@
 	regex_t regexbuf;
 	int havepattern = FALSE;
 
-#define FORMAT2 "%-25.25s  %-15.15s %-3.3s %-3.3s %-3.3s %-8s %-10s\n"
-#define FORMAT  "%-25.25s  %-15.15s %-3.3s %-3.3s %-3.3s %-8d %-10s\n"
+#define FORMAT2 "%-25.25s  %-15.15s %-3.3s %-3.3s %-3.3s %-8s %-10s %-10s\n"
+#define FORMAT  "%-25.25s  %-15.15s %-3.3s %-3.3s %-3.3s %-8d %-10s %-10s\n"
 
 	char name[256];
 	char iabuf[INET_ADDRSTRLEN];
@@ -7667,6 +7667,9 @@
 	int peers_offline = 0;
 	char *id;
 	char idtext[256] = "";
+	int realtimepeers;
+
+	realtimepeers = ast_check_realtime("sippeers");
 
 	if (s) {	/* Manager - get ActionID */
 		id = astman_get_header(m,"ActionID");
@@ -7689,7 +7692,7 @@
 	}
 
 	if (!s) { /* Normal list */
-		ast_cli(fd, FORMAT2, "Name/username", "Host", "Dyn", "Nat", "ACL", "Port", "Status");
+		ast_cli(fd, FORMAT2, "Name/username", "Host", "Dyn", "Nat", "ACL", "Port", "Status", (realtimepeers ? "Realtime" : ""));
 	} 
 	
 	ASTOBJ_CONTAINER_TRAVERSE(&peerl, 1, do {
@@ -7730,7 +7733,8 @@
 			ast_test_flag((&iterator->flags_page2), SIP_PAGE2_DYNAMIC) ? " D " : "   ", 	/* Dynamic or not? */
 			(ast_test_flag(iterator, SIP_NAT) & SIP_NAT_ROUTE) ? " N " : "   ",	/* NAT=yes? */
 			iterator->ha ? " A " : "   ", 	/* permit/deny */
-			ntohs(iterator->addr.sin_port), status);
+			ntohs(iterator->addr.sin_port), status,
+			realtimepeers ? (ast_test_flag(iterator, SIP_REALTIME) ? "Cached RT":"") : "");
 
 		if (!s)  {/* Normal CLI list */
 			ast_cli(fd, FORMAT, name, 
@@ -7739,7 +7743,8 @@
 			(ast_test_flag(iterator, SIP_NAT) & SIP_NAT_ROUTE) ? " N " : "   ",	/* NAT=yes? */
 			iterator->ha ? " A " : "   ",       /* permit/deny */
 			
-			ntohs(iterator->addr.sin_port), status);
+			ntohs(iterator->addr.sin_port), status,
+			realtimepeers ? (ast_test_flag(iterator, SIP_REALTIME) ? "Cached RT":"") : "");
 		} else {	/* Manager format */
 			/* The names here need to be the same as other channels */
 			ast_cli(fd, 
@@ -7753,7 +7758,8 @@
 			"Natsupport: %s\r\n"
 			"Video Support: %s\r\n"
 			"ACL: %s\r\n"
-			"Status: %s\r\n\r\n", 
+			"Status: %s\r\n"
+			"RealtimeDevice: %s\r\n\r\n", 
 			idtext,
 			iterator->name, 
 			iterator->addr.sin_addr.s_addr ? ast_inet_ntoa(iabuf, sizeof(iabuf), iterator->addr.sin_addr) : "-none-",
@@ -7762,7 +7768,8 @@
 			(ast_test_flag(iterator, SIP_NAT) & SIP_NAT_ROUTE) ? "yes" : "no",	/* NAT=yes? */
 			ast_test_flag((&iterator->flags_page2), SIP_PAGE2_VIDEOSUPPORT) ? "yes" : "no",	/* VIDEOSUPPORT=yes? */
 			iterator->ha ? "yes" : "no",       /* permit/deny */
-			status);
+			status,
+			realtimepeers ? (ast_test_flag(iterator, SIP_REALTIME) ? "yes":"no") : "no");
 		}
 
 		ASTOBJ_UNLOCK(iterator);
@@ -8086,6 +8093,9 @@
 	struct ast_variable *v;
 	struct sip_auth *auth;
 	int x = 0, codec = 0, load_realtime;
+	int realtimepeers;
+
+	realtimepeers = ast_check_realtime("sippeers");
 
 	if (argc < 4)
 		return RESULT_SHOWUSAGE;
@@ -8104,6 +8114,9 @@
 	if (peer && type==0 ) { /* Normal listing */
 		ast_cli(fd,"\n\n");
 		ast_cli(fd, "  * Name       : %s\n", peer->name);
+		if (realtimepeers) {	/* Realtime is enabled */
+			ast_cli(fd, "  Realtime peer: %s\n", ast_test_flag(peer, SIP_REALTIME) ? "Yes, cached" : "No");
+		}
 		ast_cli(fd, "  Secret       : %s\n", ast_strlen_zero(peer->secret)?"<Not set>":"<Set>");
 		ast_cli(fd, "  MD5Secret    : %s\n", ast_strlen_zero(peer->md5secret)?"<Not set>":"<Set>");
 		auth = peer->auth;
@@ -8358,8 +8371,8 @@
 static int sip_show_settings(int fd, int argc, char *argv[])
 {
 	char tmp[BUFSIZ];
-	int realtimepeers = 0;
-	int realtimeusers = 0;
+	int realtimepeers;
+	int realtimeusers;
 
 	realtimepeers = ast_check_realtime("sippeers");
 	realtimeusers = ast_check_realtime("sipusers");



More information about the asterisk-commits mailing list