aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_misdn.c
diff options
context:
space:
mode:
authorcrichter <crichter@f38db490-d61c-443f-a65b-d21fe96a405b>2007-04-03 07:20:27 +0000
committercrichter <crichter@f38db490-d61c-443f-a65b-d21fe96a405b>2007-04-03 07:20:27 +0000
commit7f128000f078acd416d2d00bde03a0a719f70911 (patch)
tree128a5f5bc09fafe484a1a24a31f140cfad4a46ce /channels/chan_misdn.c
parentc2014fd5516bb0879a99225cfef8892e9ee72932 (diff)
Merged revisions 59623-59624,59639 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r59623 | crichter | 2007-04-02 09:12:24 +0200 (Mo, 02 Apr 2007) | 1 line we can now make 30 channels on a PRI (before we forgot chan 31..) ........ r59624 | crichter | 2007-04-02 09:25:54 +0200 (Mo, 02 Apr 2007) | 1 line don't be verbose if no need ........ r59639 | crichter | 2007-04-02 14:08:12 +0200 (Mo, 02 Apr 2007) | 1 line added option which allows us to accept incoming SETUP Messages without automatically sending Proceeding or Setup Acknowledge, this is useful with some broken switches and if you want to Release incoming calls without previously having acknowledged them. The new option is noautorespond_on_setup=yes|no default is no, so we don't break the existing behaviour ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@59774 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_misdn.c')
-rw-r--r--channels/chan_misdn.c55
1 files changed, 37 insertions, 18 deletions
diff --git a/channels/chan_misdn.c b/channels/chan_misdn.c
index 07e9af447..0f15ed366 100644
--- a/channels/chan_misdn.c
+++ b/channels/chan_misdn.c
@@ -114,6 +114,7 @@ enum misdn_chan_state {
MISDN_NOTHING=0, /*!< at beginning */
MISDN_WAITING4DIGS, /*!< when waiting for infos */
MISDN_EXTCANTMATCH, /*!< when asterisk couldnt match our ext */
+ MISDN_INCOMING_SETUP, /*!< for incoming setups*/
MISDN_DIALING, /*!< when pbx_start */
MISDN_PROGRESS, /*!< we got a progress */
MISDN_PROCEEDING, /*!< we got a progress */
@@ -152,6 +153,8 @@ struct chan_list {
int need_hangup;
int need_busy;
+ int noautorespond_on_setup;
+
int orginator;
int norxtone;
@@ -946,6 +949,7 @@ static struct state_struct state_array[] = {
{MISDN_NOTHING,"NOTHING"}, /* at beginning */
{MISDN_WAITING4DIGS,"WAITING4DIGS"}, /* when waiting for infos */
{MISDN_EXTCANTMATCH,"EXTCANTMATCH"}, /* when asterisk couldnt match our ext */
+ {MISDN_INCOMING_SETUP,"INCOMING SETUP"}, /* when pbx_start */
{MISDN_DIALING,"DIALING"}, /* when pbx_start */
{MISDN_PROGRESS,"PROGRESS"}, /* when pbx_start */
{MISDN_PROCEEDING,"PROCEEDING"}, /* when pbx_start */
@@ -1710,6 +1714,8 @@ static int read_config(struct chan_list *ch, int orig) {
misdn_cfg_get( port, MISDN_CFG_NEED_MORE_INFOS, &bc->need_more_infos, sizeof(int));
misdn_cfg_get( port, MISDN_CFG_NTTIMEOUT, &ch->nttimeout, sizeof(int));
+ misdn_cfg_get( port, MISDN_CFG_NOAUTORESPOND_ON_SETUP, &ch->noautorespond_on_setup, sizeof(int));
+
misdn_cfg_get( port, MISDN_CFG_FAR_ALERTING, &ch->far_alerting, sizeof(int));
misdn_cfg_get( port, MISDN_CFG_ALLOWED_BEARERS, &ch->allowed_bearers, BUFFERSIZE);
@@ -2020,11 +2026,11 @@ static int misdn_call(struct ast_channel *ast, char *dest, int timeout)
misdn_cfg_get( 0, MISDN_GEN_BRIDGING, &bridging, sizeof(int));
if (bridging && ch->other_ch) {
#ifdef MISDN_1_2
- chan_misdn_log(0, port, "Disabling EC (aka Pipeline) on both Sides\n");
+ chan_misdn_log(1, port, "Disabling EC (aka Pipeline) on both Sides\n");
*ch->bc->pipeline=0;
*ch->other_ch->bc->pipeline=0;
#else
- chan_misdn_log(0, port, "Disabling EC on both Sides\n");
+ chan_misdn_log(1, port, "Disabling EC on both Sides\n");
ch->bc->ec_enable=0;
ch->other_ch->bc->ec_enable=0;
#endif
@@ -2404,6 +2410,7 @@ static int misdn_hangup(struct ast_channel *ast)
chan_misdn_log(2, bc->port, " --> state:%s\n", misdn_get_ch_state(p));
switch (p->state) {
+ case MISDN_INCOMING_SETUP:
case MISDN_CALLING:
p->state=MISDN_CLEANING;
misdn_lib_send_event( bc, EVENT_RELEASE_COMPLETE);
@@ -3495,16 +3502,20 @@ static void do_immediate_setup(struct misdn_bchannel *bc,struct chan_list *ch ,
ch->state=MISDN_DIALING;
- if (bc->nt) {
- int ret;
- ret = misdn_lib_send_event(bc, EVENT_SETUP_ACKNOWLEDGE );
- } else {
- int ret;
- if ( misdn_lib_is_ptp(bc->port)) {
+ if (!ch->noautorespond_on_setup) {
+ if (bc->nt) {
+ int ret;
ret = misdn_lib_send_event(bc, EVENT_SETUP_ACKNOWLEDGE );
} else {
- ret = misdn_lib_send_event(bc, EVENT_PROCEEDING );
+ int ret;
+ if ( misdn_lib_is_ptp(bc->port)) {
+ ret = misdn_lib_send_event(bc, EVENT_SETUP_ACKNOWLEDGE );
+ } else {
+ ret = misdn_lib_send_event(bc, EVENT_PROCEEDING );
+ }
}
+ } else {
+ ch->state = MISDN_INCOMING_SETUP;
}
if ( !bc->nt && (ch->orginator==ORG_MISDN) && !ch->incoming_early_audio )
@@ -4066,8 +4077,12 @@ cb_events(enum event_e event, struct misdn_bchannel *bc, void *user_data)
/* Check for Pickup Request first */
if (!strcmp(chan->exten, ast_pickup_ext())) {
- int ret;/** Sending SETUP_ACK**/
- ret = misdn_lib_send_event(bc, EVENT_SETUP_ACKNOWLEDGE );
+ if (!ch->noautorespond_on_setup) {
+ int ret;/** Sending SETUP_ACK**/
+ ret = misdn_lib_send_event(bc, EVENT_SETUP_ACKNOWLEDGE );
+ } else {
+ ch->state = MISDN_INCOMING_SETUP;
+ }
if (ast_pickup_call(chan)) {
hangup_chan(ch);
} else {
@@ -4125,14 +4140,19 @@ cb_events(enum event_e event, struct misdn_bchannel *bc, void *user_data)
}
if (!ch->overlap_dial && ast_exists_extension(ch->ast, ch->context, bc->dad, 1, bc->oad)) {
- ch->state=MISDN_DIALING;
- if (bc->nt || (bc->need_more_infos && misdn_lib_is_ptp(bc->port)) ) {
- int ret;
- ret = misdn_lib_send_event(bc, EVENT_SETUP_ACKNOWLEDGE );
+ if (!ch->noautorespond_on_setup) {
+ ch->state=MISDN_DIALING;
+
+ if (bc->nt || (bc->need_more_infos && misdn_lib_is_ptp(bc->port)) ) {
+ int ret;
+ ret = misdn_lib_send_event(bc, EVENT_SETUP_ACKNOWLEDGE );
+ } else {
+ int ret;
+ ret= misdn_lib_send_event(bc, EVENT_PROCEEDING );
+ }
} else {
- int ret;
- ret= misdn_lib_send_event(bc, EVENT_PROCEEDING );
+ ch->state = MISDN_INCOMING_SETUP;
}
if (pbx_start_chan(ch)<0) {
@@ -4162,7 +4182,6 @@ cb_events(enum event_e event, struct misdn_bchannel *bc, void *user_data)
}
} else {
-
int ret= misdn_lib_send_event(bc, EVENT_SETUP_ACKNOWLEDGE );
if (ret == -ENOCHAN) {
ast_log(LOG_WARNING,"Channel was catched, before we could Acknowledge\n");