[svn-commits] trunk r34604 - in /trunk/channels: ./ misdn/

svn-commits at lists.digium.com svn-commits at lists.digium.com
Sun Jun 18 12:09:32 MST 2006


Author: crichter
Date: Sun Jun 18 14:09:32 2006
New Revision: 34604

URL: http://svn.digium.com/view/asterisk?rev=34604&view=rev
Log:
added TONE_HANGUP, also added Tone generation by mISDN_dsp for post hangup tones, therefore the TONE_X defines are in the isdn_lib.h now. changed a REALEASE to a DISCONNECT in NT Stack, to make tones available in that state.

Modified:
    trunk/channels/chan_misdn.c
    trunk/channels/misdn/isdn_lib.c
    trunk/channels/misdn/isdn_lib.h

Modified: trunk/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_misdn.c?rev=34604&r1=34603&r2=34604&view=diff
==============================================================================
--- trunk/channels/chan_misdn.c (original)
+++ trunk/channels/chan_misdn.c Sun Jun 18 14:09:32 2006
@@ -110,16 +110,6 @@
 
 /* BEGIN: chan_misdn.h */
 
-
-enum tone_e {
-	TONE_NONE=0,
-	TONE_DIAL,
-	TONE_ALERTING,
-	TONE_FAR_ALERTING,
-	TONE_BUSY,
-	TONE_CUSTOM,
-	TONE_FILE
-};
 
 
 enum misdn_chan_state {
@@ -1981,7 +1971,7 @@
 		return 0;
 	}
 
-	stop_bc_tones(p);
+	/*stop_bc_tones(p);*/
 	
 	release_unlock;
 	
@@ -2008,11 +1998,11 @@
 		case MISDN_HOLDED:
 		case MISDN_DIALING:
 			start_bc_tones(p);
-			tone_indicate(p, TONE_BUSY);
+			tone_indicate(p, TONE_HANGUP);
 			p->state=MISDN_CLEANING;
 		
 			if (bc->nt)
-				misdn_lib_send_event( bc, EVENT_RELEASE);
+				misdn_lib_send_event( bc, EVENT_DISCONNECT);
 			else
 				misdn_lib_send_event( bc, EVENT_RELEASE_COMPLETE);
       
@@ -2024,7 +2014,7 @@
 			chan_misdn_log(2, bc->port, " --> * State Alerting\n");
 
 			if (p->orginator != ORG_AST) 
-				tone_indicate(p, TONE_BUSY);
+				tone_indicate(p, TONE_HANGUP);
       
 			p->state=MISDN_CLEANING;
 			misdn_lib_send_event( bc, EVENT_DISCONNECT);
@@ -2033,7 +2023,7 @@
 			/*  Alerting or Disconect */
 			chan_misdn_log(2, bc->port, " --> * State Connected\n");
 			start_bc_tones(p);
-			tone_indicate(p, TONE_BUSY);
+			tone_indicate(p, TONE_HANGUP);
 			misdn_lib_send_event( bc, EVENT_DISCONNECT);
       
 			p->state=MISDN_CLEANING; /* MISDN_HUNGUP_FROM_AST; */
@@ -2129,7 +2119,7 @@
 	if (!ast) return NULL;
 	if (! (tmp=MISDN_ASTERISK_TECH_PVT(ast)) ) return NULL;
 	if (!tmp->bc) return NULL;
-	
+
 	len=read(tmp->pipe[0],tmp->ast_rd_buf,sizeof(tmp->ast_rd_buf));
 
 	if (len<=0) {
@@ -2367,14 +2357,9 @@
 	
 	if (!cl->ast) {
 		chan_misdn_log(-1,cl->bc->port,"Ast Ptr Not existing anymore.. we need to generate tones ourselves now (tbd)\n");
+		
+		misdn_lib_send_tone(cl->bc,tone);
 		return 0;
-#if 0
-		struct ast_channel *dummy=misdn_new(cl, AST_STATE_RESERVED, cl->bc->dad, cl->bc->oad, AST_FORMAT_ALAW, cl->bc->port, 99);
-		cl->ast=dummy;
-		/* return 0; */
-		cl->dummy=1;
-		ast=cl->ast;
-#endif
 	}
 	
 	switch (tone) {

Modified: trunk/channels/misdn/isdn_lib.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/misdn/isdn_lib.c?rev=34604&r1=34603&r2=34604&view=diff
==============================================================================
--- trunk/channels/misdn/isdn_lib.c (original)
+++ trunk/channels/misdn/isdn_lib.c Sun Jun 18 14:09:32 2006
@@ -3798,6 +3798,8 @@
 	unsigned int *d = (unsigned int*)&ctrl->data.p;
 	struct misdn_stack *stack=get_stack_by_bc(bc);
 	
+	cb_log(4,bc->port,"ph_control: c1:%x c2:%x\n",c1,c2);
+	
 	ctrl->prim = PH_CONTROL | REQUEST;
 	ctrl->addr = bc->addr | FLG_MSG_DOWN;
 	ctrl->dinfo = 0;
@@ -3913,6 +3915,29 @@
 	return NULL;
 }
 
+
+
+void misdn_lib_send_tone(struct misdn_bchannel *bc, enum tone_e tone) 
+{
+	switch(tone) {
+	case TONE_DIAL:
+		manager_ph_control(bc, TONE_PATT_ON, TONE_GERMAN_DIALTONE);	
+	break;
+	
+	case TONE_ALERTING:
+		manager_ph_control(bc, TONE_PATT_ON, TONE_GERMAN_RINGING);	
+	break;
+	
+	case TONE_HANGUP:
+		manager_ph_control(bc, TONE_PATT_ON, TONE_GERMAN_HANGUP);	
+	break;
+
+	case TONE_NONE:
+	default:
+		manager_ph_control(bc, TONE_PATT_OFF, TONE_GERMAN_HANGUP);	
+	}
+
+}
 
 
 void manager_ec_enable(struct misdn_bchannel *bc)

Modified: trunk/channels/misdn/isdn_lib.h
URL: http://svn.digium.com/view/asterisk/trunk/channels/misdn/isdn_lib.h?rev=34604&r1=34603&r2=34604&view=diff
==============================================================================
--- trunk/channels/misdn/isdn_lib.h (original)
+++ trunk/channels/misdn/isdn_lib.h Sun Jun 18 14:09:32 2006
@@ -18,6 +18,19 @@
 /** For initialization usage **/
 /* typedef int ie_nothing_t ;*/
 /** end of init usage **/
+
+
+
+enum tone_e {
+	TONE_NONE=0,
+	TONE_DIAL,
+	TONE_ALERTING,
+	TONE_FAR_ALERTING,
+	TONE_BUSY,
+	TONE_HANGUP,
+	TONE_CUSTOM,
+	TONE_FILE
+};
 
 
 
@@ -376,6 +389,7 @@
 void manager_ec_enable(struct misdn_bchannel *bc);
 void manager_ec_disable(struct misdn_bchannel *bc);
 
+void misdn_lib_send_tone(struct misdn_bchannel *bc, enum tone_e tone);
 
 void get_show_stack_details(int port, char *buf);
 



More information about the svn-commits mailing list