[svn-commits] branch crichter/0.3.0 r34603 - in
/team/crichter/0.3.0/channels: ./ misdn/
svn-commits at lists.digium.com
svn-commits at lists.digium.com
Sun Jun 18 12:02:07 MST 2006
Author: crichter
Date: Sun Jun 18 14:02:06 2006
New Revision: 34603
URL: http://svn.digium.com/view/asterisk?rev=34603&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:
team/crichter/0.3.0/channels/chan_misdn.c
team/crichter/0.3.0/channels/misdn/isdn_lib.c
team/crichter/0.3.0/channels/misdn/isdn_lib.h
Modified: team/crichter/0.3.0/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/channels/chan_misdn.c?rev=34603&r1=34602&r2=34603&view=diff
==============================================================================
--- team/crichter/0.3.0/channels/chan_misdn.c (original)
+++ team/crichter/0.3.0/channels/chan_misdn.c Sun Jun 18 14:02:06 2006
@@ -105,16 +105,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 {
@@ -1930,7 +1920,7 @@
return 0;
}
- stop_bc_tones(p);
+ /*stop_bc_tones(p);*/
release_unlock;
@@ -1957,11 +1947,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);
@@ -1973,7 +1963,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);
@@ -1982,7 +1972,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; */
@@ -2032,7 +2022,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) {
@@ -2040,7 +2030,7 @@
chan_misdn_log(2,tmp->bc->port,"misdn_read: Pipe closed, hanging up\n");
return NULL;
}
-
+
tmp->frame.frametype = AST_FRAME_VOICE;
tmp->frame.subclass = AST_FORMAT_ALAW;
tmp->frame.datalen = len;
@@ -2269,14 +2259,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: team/crichter/0.3.0/channels/misdn/isdn_lib.c
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/channels/misdn/isdn_lib.c?rev=34603&r1=34602&r2=34603&view=diff
==============================================================================
--- team/crichter/0.3.0/channels/misdn/isdn_lib.c (original)
+++ team/crichter/0.3.0/channels/misdn/isdn_lib.c Sun Jun 18 14:02:06 2006
@@ -3766,6 +3766,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;
@@ -3881,6 +3883,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: team/crichter/0.3.0/channels/misdn/isdn_lib.h
URL: http://svn.digium.com/view/asterisk/team/crichter/0.3.0/channels/misdn/isdn_lib.h?rev=34603&r1=34602&r2=34603&view=diff
==============================================================================
--- team/crichter/0.3.0/channels/misdn/isdn_lib.h (original)
+++ team/crichter/0.3.0/channels/misdn/isdn_lib.h Sun Jun 18 14:02:06 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
+};
@@ -373,6 +386,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