]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
manually merged r49922 and r50335, because of conflicts. this commint includes additi...
authorChristian Richter <christian.richter@beronet.com>
Tue, 23 Jan 2007 10:05:54 +0000 (10:05 +0000)
committerChristian Richter <christian.richter@beronet.com>
Tue, 23 Jan 2007 10:05:54 +0000 (10:05 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@51648 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_misdn.c
channels/misdn/isdn_lib.c
channels/misdn/isdn_lib.h

index 28cf4e9cbc836dc2f1dfa05c9dc3e7f3683a71b4..2510df4372775b8302ad2991ad1953a23da843c7 100644 (file)
@@ -792,6 +792,20 @@ static int misdn_restart_pid (int fd, int argc, char *argv[])
        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 @@ static struct ast_cli_entry chan_misdn_clis[] = {
                "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",
index 69fa12a0c6a46698bbd2fd3efacd9eb46827fcc9..d655b9305ae71cf3d9f6acc7f91fa89fd32dc42a 100644 (file)
@@ -3603,6 +3603,31 @@ int misdn_lib_pid_restart(int pid)
        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);
index ccd87bcfb8db250cb27021c75ab027e2e073f0f0..e320882ddef7db50ce10cb88b82c8762265d64d8 100644 (file)
@@ -409,6 +409,7 @@ void isdn_lib_stop_dtmf (struct misdn_bchannel *bc);
 
 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);