[asterisk-commits] crichter: branch 1.2 r62945 - in /branches/1.2/channels: ./ misdn/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu May 3 08:39:22 MST 2007


Author: crichter
Date: Thu May  3 10:39:21 2007
New Revision: 62945

URL: http://svn.digium.com/view/asterisk?view=rev&rev=62945
Log:
when we're in state WAITING4DIGS, we use the asterisk tone-generator which prods us, so we can't just return -1 in misdn_write in this case. Added a MISDN_KEYPAD channel variable, and fixed the sending of keypad. this enables us to modify the call forward parameters in the switch.

Modified:
    branches/1.2/channels/chan_misdn.c
    branches/1.2/channels/misdn/isdn_msg_parser.c

Modified: branches/1.2/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/channels/chan_misdn.c?view=diff&rev=62945&r1=62944&r2=62945
==============================================================================
--- branches/1.2/channels/chan_misdn.c (original)
+++ branches/1.2/channels/chan_misdn.c Thu May  3 10:39:21 2007
@@ -1709,8 +1709,7 @@
 	}
 	
 	port=newbc->port;
-	strncpy(newbc->dad,ext,sizeof( newbc->dad));
-	strncpy(ast->exten,ext,sizeof(ast->exten));
+
 	
 	chan_misdn_log(1, port, "* CALL: %s\n",dest);
 	
@@ -1719,7 +1718,10 @@
 	chan_misdn_log(3, port, " --> * adding2newbc ext %s\n",ast->exten);
 	if (ast->exten) {
 		int l = sizeof(newbc->dad);
-		strncpy(newbc->dad,ast->exten, l);
+		strncpy(ast->exten,ext,sizeof(ast->exten));
+
+		strncpy(newbc->dad,ext,l);
+
 		newbc->dad[l-1] = 0;
 	}
 	newbc->rad[0]=0;
@@ -1732,7 +1734,7 @@
 			newbc->oad[l-1] = 0;
 		}
 	}
-	
+
 	{
 		struct chan_list *ch=MISDN_ASTERISK_TECH_PVT(ast);
 		if (!ch) { ast_verbose("No chan_list in misdn_call\n"); return -1;}
@@ -2308,6 +2310,10 @@
 
 	if ( !frame->samples ) {
 		chan_misdn_log(4, ch->bc->port, "misdn_write: zero write\n");
+		if (ch->state == MISDN_WAITING4DIGS) {
+			chan_misdn_log(4, ch->bc->port, "misdn_write: WAIT4DIGS ..\n");
+			return 0;
+		}
 		return -1;
 	}
 
@@ -3279,6 +3285,14 @@
 	if (tmp && (atoi(tmp) == 1)) {
 		bc->sending_complete=1;
 	}
+	
+	const char *kp=pbx_builtin_getvar_helper(chan,"MISDN_KEYPAD");
+	if (kp) {
+		strncpy(bc->keypad,kp,sizeof(bc->keypad));
+		bc->keypad[sizeof(bc->keypad)-1]=0;
+	}
+	
+	
 }
  
 void export_ch(struct ast_channel *chan, struct misdn_bchannel *bc, struct chan_list *ch)
@@ -3298,6 +3312,9 @@
 		sprintf(tmp,"%d",bc->urate);
 		pbx_builtin_setvar_helper(chan,"MISDN_URATE",tmp);
 	}
+
+	if (bc->keypad[0]) 
+		pbx_builtin_setvar_helper(chan,"MISDN_KEYPAD",bc->keypad);
 }
 
 
@@ -3768,6 +3785,7 @@
 				
 				/** ADD IGNOREPAT **/
 				
+				ch->state=MISDN_WAITING4DIGS;
 				int stop_tone;
 				misdn_cfg_get( 0, MISDN_GEN_STOP_TONE, &stop_tone, sizeof(int));
 				if ( (!ast_strlen_zero(bc->dad)) && stop_tone ) 
@@ -3776,7 +3794,6 @@
 					dialtone_indicate(ch);
 				}
 				
-				ch->state=MISDN_WAITING4DIGS;
 			}
 		}
       

Modified: branches/1.2/channels/misdn/isdn_msg_parser.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/channels/misdn/isdn_msg_parser.c?view=diff&rev=62945&r1=62944&r2=62945
==============================================================================
--- branches/1.2/channels/misdn/isdn_msg_parser.c (original)
+++ branches/1.2/channels/misdn/isdn_msg_parser.c Thu May  3 10:39:21 2007
@@ -287,7 +287,7 @@
 
 	{
 		if (bc->keypad[0])
-			enc_ie_keypad(&setup->CALLED_PN, msg, bc->keypad, nt,bc);
+			enc_ie_keypad(&setup->KEYPAD, msg, bc->keypad, nt,bc);
 	}
 	
   



More information about the asterisk-commits mailing list