[asterisk-commits] crichter: branch 1.4 r51648 - in /branches/1.4/channels: ./ misdn/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Jan 23 03:05:55 MST 2007


Author: crichter
Date: Tue Jan 23 04:05:54 2007
New Revision: 51648

URL: http://svn.digium.com/view/asterisk?view=rev&rev=51648
Log:
manually merged r49922 and r50335, because of conflicts. this commint includes addition of the ISDN RESTART Message

Modified:
    branches/1.4/channels/chan_misdn.c
    branches/1.4/channels/misdn/isdn_lib.c
    branches/1.4/channels/misdn/isdn_lib.h

Modified: branches/1.4/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/chan_misdn.c?view=diff&rev=51648&r1=51647&r2=51648
==============================================================================
--- branches/1.4/channels/chan_misdn.c (original)
+++ branches/1.4/channels/chan_misdn.c Tue Jan 23 04:05:54 2007
@@ -792,6 +792,20 @@
 	return 0;
 }
 
+static int misdn_send_restart(int fd, int argc, char *argv[])
+{
+	int port;
+	
+	if (argc != 4)
+		return RESULT_SHOWUSAGE;
+ 
+	port = atoi(argv[3]);
+ 
+ 	misdn_lib_send_restart(port);
+	
+	return 0;
+}
+
 static int misdn_port_up (int fd, int argc, char *argv[])
 {
 	int port;
@@ -1426,6 +1440,9 @@
 		"Usage: misdn restart port\n" },
 	{ {"misdn","restart","pid", NULL}, misdn_restart_pid, "Restarts the given pid",
 		"Usage: misdn restart pid\n" },
+	{ {"misdn","send","restart", NULL},  misdn_send_restart, 
+	  "Sends a restart for every bchannel on the given port", 
+	  "Usage: misdn send restart <port>\n"},
 	{ {"misdn","port","up", NULL}, misdn_port_up, "Tries to establish L1 on the given port",
 		"Usage: misdn port up <port>\n" },
 	{ {"misdn","port","down", NULL}, misdn_port_down, "Tries to deacivate the L1 on the given port",

Modified: branches/1.4/channels/misdn/isdn_lib.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/misdn/isdn_lib.c?view=diff&rev=51648&r1=51647&r2=51648
==============================================================================
--- branches/1.4/channels/misdn/isdn_lib.c (original)
+++ branches/1.4/channels/misdn/isdn_lib.c Tue Jan 23 04:05:54 2007
@@ -3603,6 +3603,31 @@
 	return 0;
 }
 
+/*Sends Restart message for every bchnanel*/
+int misdn_lib_send_restart(int port)
+{
+	struct misdn_stack *stack=find_stack_by_port(port);
+	cb_log(0, port, "Sending Restarts on this port.\n");
+	
+	struct misdn_bchannel dummybc;
+	memset (&dummybc,0,sizeof(dummybc));
+	dummybc.port=stack->port;
+	dummybc.l3_id=MISDN_ID_DUMMY;
+	dummybc.nt=stack->nt;
+
+	int max=stack->pri?30:2;
+	int i;
+	for (i=1;i<max;i++) {
+		dummybc.channel=i;
+		cb_log(0, port, "Restarting channel %d\n",i);
+		misdn_lib_send_event(&dummybc, EVENT_RESTART);
+		/*do we need to wait before we get an EVENT_RESTART_ACK ?*/
+	}
+
+	return 0;
+}
+
+/*reinitializes the L2/L3*/
 int misdn_lib_port_restart(int port)
 {
 	struct misdn_stack *stack=find_stack_by_port(port);

Modified: branches/1.4/channels/misdn/isdn_lib.h
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/misdn/isdn_lib.h?view=diff&rev=51648&r1=51647&r2=51648
==============================================================================
--- branches/1.4/channels/misdn/isdn_lib.h (original)
+++ branches/1.4/channels/misdn/isdn_lib.h Tue Jan 23 04:05:54 2007
@@ -409,6 +409,7 @@
 
 int misdn_lib_port_restart(int port);
 int misdn_lib_pid_restart(int pid);
+int misdn_lib_send_restart(int port);
 
 int misdn_lib_get_port_info(int port);
 



More information about the asterisk-commits mailing list