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

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


Author: crichter
Date: Tue Jan 23 04:28:54 2007
New Revision: 51649

URL: http://svn.digium.com/view/asterisk?view=rev&rev=51649
Log:
Merged revisions 50495,50506 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r50495 | crichter | 2007-01-11 14:27:52 +0100 (Do, 11 Jan 2007) | 6 lines

* more additions to make the RESTART message work
* added fix for misdn_call to allow SETUPs with empty 
  extensions, replaced the strtok_r functions with strsep for that 
  (inspired by Sandro Cappellazzo, thanks)


........
r50506 | crichter | 2007-01-11 15:45:38 +0100 (Do, 11 Jan 2007) | 1 line

when we get L2 UP, the L1 is UP definitely too, so we set the L1 state up as well.
........

Modified:
    branches/1.4/   (props changed)
    branches/1.4/channels/chan_misdn.c
    branches/1.4/channels/misdn/isdn_lib.c
    branches/1.4/channels/misdn/isdn_msg_parser.c

Propchange: branches/1.4/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

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=51649&r1=51648&r2=51649
==============================================================================
--- branches/1.4/channels/chan_misdn.c (original)
+++ branches/1.4/channels/chan_misdn.c Tue Jan 23 04:28:54 2007
@@ -1879,23 +1879,21 @@
 	int r;
 	struct chan_list *ch=MISDN_ASTERISK_TECH_PVT(ast);
 	struct misdn_bchannel *newbc;
-	char *opts=NULL, *ext,*tokb;
+	char *opts=NULL, *ext;
 	char dest_cp[256];
 
 	{
 		strncpy(dest_cp,dest,sizeof(dest_cp)-1);
 		dest_cp[sizeof(dest_cp)]=0;
-		
-		ext=strtok_r(dest_cp,"/",&tokb);
-		
+
+		ext=dest_cp;
+		strsep(&ext,"/");
 		if (ext) {
-			ext=strtok_r(NULL,"/",&tokb);
-			if (ext) {
-				opts=strtok_r(NULL,"/",&tokb);
-			} else {
-				chan_misdn_log(0,0,"misdn_call: No Extension given!\n");
-				return -1;
-			}
+			opts=ext;
+			strsep(&opts,"/");
+		}  else {
+			ast_log(LOG_WARNING, "Malformed dialstring\n");
+			return -1;
 		}
 	}
 

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=51649&r1=51648&r2=51649
==============================================================================
--- branches/1.4/channels/misdn/isdn_lib.c (original)
+++ branches/1.4/channels/misdn/isdn_lib.c Tue Jan 23 04:28:54 2007
@@ -1970,7 +1970,9 @@
 				cb_log(0, stack->port, "%% GOT L2 Activate Info. but we're activated already.. this l2 is faulty, blocking port\n");
 				cb_event(EVENT_PORT_ALARM, &stack->bc[0], glob_mgr->user_data);
 			}
-			
+		
+			/* when we get the L2 UP, the L1 is UP definitely too*/
+			stack->l1link = 1;
 			stack->l2link = 1;
 			stack->l2upcnt=0;
 			
@@ -2821,6 +2823,9 @@
 
 		case SSTATUS_L2_ESTABLISHED:
 			cb_log(3, stack->port, "MGMT: SSTATUS: L2_ESTABLISH \n");
+
+			/*when the L2 goes UP, L1 needs to be UP too*/
+			stack->l1link=1;
 			stack->l2link=1;
 			break;
 			
@@ -3612,12 +3617,12 @@
 	struct misdn_bchannel dummybc;
 	memset (&dummybc,0,sizeof(dummybc));
 	dummybc.port=stack->port;
-	dummybc.l3_id=MISDN_ID_DUMMY;
+	dummybc.l3_id=MISDN_ID_GLOBAL;
 	dummybc.nt=stack->nt;
 
 	int max=stack->pri?30:2;
 	int i;
-	for (i=1;i<max;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);
@@ -3747,6 +3752,16 @@
 					iframe_t *frm = (iframe_t *)msg->data;
 					struct misdn_bchannel *bc = find_bc_by_l3id(stack, frm->dinfo);
 					if (bc) send_msg(glob_mgr->midev, bc, msg);
+					else  {
+						if (frm->dinfo == MISDN_ID_GLOBAL) {
+							struct misdn_bchannel dummybc;
+							memset (&dummybc,0,sizeof(dummybc));
+							dummybc.port=stack->port;
+							dummybc.l3_id=MISDN_ID_GLOBAL;
+							dummybc.nt=stack->nt;
+							send_msg(glob_mgr->midev, &dummybc, msg);
+						}
+					}
 				}
 			}
 		}

Modified: branches/1.4/channels/misdn/isdn_msg_parser.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/channels/misdn/isdn_msg_parser.c?view=diff&rev=51649&r1=51648&r2=51649
==============================================================================
--- branches/1.4/channels/misdn/isdn_msg_parser.c (original)
+++ branches/1.4/channels/misdn/isdn_msg_parser.c Tue Jan 23 04:28:54 2007
@@ -816,10 +816,14 @@
 	msg_t *msg =(msg_t*)create_l3msg(CC_RESTART | REQUEST, MT_RESTART,  bc?bc->l3_id:-1, sizeof(RESTART_t) ,nt); 
  
 	restart=(RESTART_t*)((msg->data+HEADER_LEN)); 
-
+	
 #if DEBUG 
 	printf("Building RESTART Msg\n"); 
 #endif
+	enc_ie_channel_id(&restart->CHANNEL_ID, msg, 1,bc->channel, nt,bc);
+
+	cb_log(0,bc->port, "Restarting channel %d\n", bc->channel);
+	
 	return msg; 
 }
 



More information about the asterisk-commits mailing list