From 8122c35675e8fba60ed6077595f3afa0fc9065ce Mon Sep 17 00:00:00 2001 From: Christian Richter Date: Wed, 24 May 2006 07:58:52 +0000 Subject: fixed to early connect bug which came in yesterday.., also added the transmit of progress indicators through channel vars git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@29938 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_misdn.c | 15 +++++++++++---- configs/misdn.conf.sample | 14 ++++++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/channels/chan_misdn.c b/channels/chan_misdn.c index 1c2561a65..9989f9820 100644 --- a/channels/chan_misdn.c +++ b/channels/chan_misdn.c @@ -132,6 +132,7 @@ enum misdn_chan_state { MISDN_ALERTING, /*!< when Alerting */ MISDN_BUSY, /*!< when BUSY */ MISDN_CONNECTED, /*!< when connected */ + MISDN_PRECONNECTED, /*!< when connected */ MISDN_DISCONNECTED, /*!< when connected */ MISDN_BRIDGED, /*!< when bridged */ MISDN_CLEANING, /*!< when hangup from * but we were connected before */ @@ -2980,7 +2981,6 @@ static void send_cause2ast(struct ast_channel *ast, struct misdn_bchannel*bc) { } } - void import_ies(struct ast_channel *chan, struct misdn_bchannel *bc) { const char *tmp; @@ -2996,6 +2996,9 @@ void import_ies(struct ast_channel *chan, struct misdn_bchannel *bc) tmp=pbx_builtin_getvar_helper(chan,"PRI_USER1"); if (tmp) bc->user1=atoi(tmp); + + tmp=pbx_builtin_getvar_helper(chan,"PRI_PROGRESS_INDICATOR"); + if (tmp) bc->progress_indicator=atoi(tmp); } void export_ies(struct ast_channel *chan, struct misdn_bchannel *bc) @@ -3014,7 +3017,8 @@ void export_ies(struct ast_channel *chan, struct misdn_bchannel *bc) sprintf(tmp,"%d",bc->user1); pbx_builtin_setvar_helper(chan,"_PRI_USER1",tmp); - pbx_builtin_setvar_helper(chan,"_RDNIS",bc->rad); + sprintf(tmp,"%d",bc->progress_indicator); + pbx_builtin_setvar_helper(chan,"_PRI_PROGRESS_INDICATOR",tmp); } @@ -3104,7 +3108,7 @@ cb_events(enum event_e event, struct misdn_bchannel *bc, void *user_data) ch->l3id=bc->l3_id; ch->addr=bc->addr; - if (bc->nt) { + if (bc->nt && ch->state == MISDN_PRECONNECTED ) { /* OK we've got the very new l3id so we can answer now */ start_bc_tones(ch); @@ -3512,7 +3516,10 @@ cb_events(enum event_e event, struct misdn_bchannel *bc, void *user_data) } /*we answer when we've got our very new L3 ID from the NT stack */ - if (bc->nt) break; + if (bc->nt) { + ch->state=MISDN_PRECONNECTED; + break; + } /* notice that we don't break here!*/ diff --git a/configs/misdn.conf.sample b/configs/misdn.conf.sample index 5bdaecb54..cd382d55d 100644 --- a/configs/misdn.conf.sample +++ b/configs/misdn.conf.sample @@ -38,6 +38,20 @@ debug=0 ; bridging=no + +; +; watches the L1s of every port. If one l1 is down it tries to +; get it up. The timeout is given in seconds. with 0 as value it +; does not watch the l1 at all +; +; default value: 0 +; +; this option is only read at loading time of chan_misdn, +; which means you need to unload and load chan_misdn to change the +; value, an asterisk restart should do the trick +; +l1watcher_timeout=0 + ; stops dialtone after getting first digit on nt Port ; ; default value: yes -- cgit v1.2.3