[Asterisk-Dev] Reading problems with chan_misdn-0.1.0

Lattanzio Francesco f.lattanzio at mediatechnologies.it
Thu May 5 09:16:33 MST 2005


When answering the channel, some delay is needed before the channel is ready 
for reading. This, sometimes, disrupt things, because if the reading queue is 
empty, the 'read' method of the channel is invoked. However, this always 
returns a NULL pointer, which * recognizes as a disconnection.
To fix things, just make it return a "null frame". The patch follows:

diff -urN chan_misdn-beta-0.1.0/Makefile chan_misdn-beta-0.1.0-fixed/Makefile
--- chan_misdn-beta-0.1.0/Makefile	2005-04-01 16:32:38.000000000 +0200
+++ chan_misdn-beta-0.1.0-fixed/Makefile	2005-05-05 17:32:05.000000000 +0200
@@ -47,7 +47,7 @@
 # If you are using a asterisk version above from stable (v1-0)
 # then comment the following line out (good luck)
 #
-#CFLAGS+=-DASTERISK_STABLE
+CFLAGS+=-DASTERISK_STABLE
 
 
 LINUXROOT=/usr/src/linux-2.6
diff -urN chan_misdn-beta-0.1.0/chan_misdn.c 
chan_misdn-beta-0.1.0-fixed/chan_misdn.c
--- chan_misdn-beta-0.1.0/chan_misdn.c	2005-04-01 16:32:10.000000000 +0200
+++ chan_misdn-beta-0.1.0-fixed/chan_misdn.c	2005-05-05 17:33:35.000000000 
+0200
@@ -1258,8 +1258,7 @@
     break;
 
   default:
-    /*if ( 1 )
-      send_digit_to_chan(p,digit); */
+    send_digit_to_chan(p, digit);
     //chan_misdn_log("");
     break;
   }
@@ -1590,6 +1589,9 @@
 {
   static int i = 0 ;
   chan_list_t *p;
+  static struct ast_frame null_frame={
+    AST_FRAME_NULL
+  };
 
   if (!ast || ! MISDN_ASTERISK_PVT(ast)) return NULL;
   p = MISDN_ASTERISK_TECH_PVT(ast) ;
@@ -1600,7 +1602,7 @@
     i=1;
   }
   
-  return NULL;
+  return &null_frame;
 }
 
 int misdn_write(struct ast_channel *ast, struct ast_frame *frame)
@@ -2528,12 +2530,12 @@
 	if ( !strlen(bc->dad) && strlen(bc->keypad)) strcpy(bc->dad,bc->keypad);
 	switch( bc->numplan ) {
 	case NUMPLAN_INTERNATIONAL:
-	  prefix=get_nat_prefix(bc);
+	  prefix=get_internat_prefix(bc);
 	  if (misdn_debug>0) chan_misdn_log(" --> Numplan: Internat. prefix %s\n", 
prefix);
 	  break;
 	  
 	case NUMPLAN_NATIONAL:
-	  prefix=get_internat_prefix(bc);
+	  prefix=get_nat_prefix(bc);
 	  if (misdn_debug>0) chan_misdn_log(" --> Numplan: Nat. prefix %s\n", 
prefix);
 	  break;
 	  
The system configuration is:

  1) Linux 2.6.10
  2) mISDN_for_PBX4Linux_2005_03_06.tar.gz and
     mISDNuser_for_PBX4Linux_2005_01_28.tar.gz from isdn.jolly.de
  3) chan_misdn-beta-0.1.0.tgz + BN4S0/BN8S0 cards from beroNet
  4) Asterisk 1.0.6

Bye.

-- 
Francesco Lattanzio <f.lattanzio at mediatechnologies.it>



More information about the asterisk-dev mailing list