[asterisk-commits] crichter: branch 1.2 r59639 - in
/branches/1.2/channels: ./ misdn/
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Mon Apr 2 05:08:13 MST 2007
Author: crichter
Date: Mon Apr 2 07:08:12 2007
New Revision: 59639
URL: http://svn.digium.com/view/asterisk?view=rev&rev=59639
Log:
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
Modified:
branches/1.2/channels/chan_misdn.c
branches/1.2/channels/misdn/chan_misdn_config.h
branches/1.2/channels/misdn_config.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=59639&r1=59638&r2=59639
==============================================================================
--- branches/1.2/channels/chan_misdn.c (original)
+++ branches/1.2/channels/chan_misdn.c Mon Apr 2 07:08:12 2007
@@ -106,6 +106,7 @@
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 */
@@ -145,6 +146,8 @@
int need_queue_hangup;
int need_hangup;
int need_busy;
+
+ int noautorespond_on_setup;
int orginator;
@@ -682,6 +685,7 @@
{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 */
@@ -1492,6 +1496,8 @@
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);
@@ -2131,6 +2137,7 @@
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);
@@ -3141,16 +3148,20 @@
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 )
@@ -3642,8 +3653,12 @@
/* 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 {
@@ -3701,14 +3716,19 @@
}
if (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) {
@@ -3738,7 +3758,6 @@
}
} 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");
Modified: branches/1.2/channels/misdn/chan_misdn_config.h
URL: http://svn.digium.com/view/asterisk/branches/1.2/channels/misdn/chan_misdn_config.h?view=diff&rev=59639&r1=59638&r2=59639
==============================================================================
--- branches/1.2/channels/misdn/chan_misdn_config.h (original)
+++ branches/1.2/channels/misdn/chan_misdn_config.h Mon Apr 2 07:08:12 2007
@@ -56,6 +56,7 @@
MISDN_CFG_PIPELINE, /* char[] */
#endif
MISDN_CFG_NEED_MORE_INFOS, /* bool */
+ MISDN_CFG_NOAUTORESPOND_ON_SETUP, /* bool */
MISDN_CFG_NTTIMEOUT, /* bool */
MISDN_CFG_JITTERBUFFER, /* int */
MISDN_CFG_JITTERBUFFER_UPPER_THRESHOLD, /* int */
Modified: branches/1.2/channels/misdn_config.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/channels/misdn_config.c?view=diff&rev=59639&r1=59638&r2=59639
==============================================================================
--- branches/1.2/channels/misdn_config.c (original)
+++ branches/1.2/channels/misdn_config.c Mon Apr 2 07:08:12 2007
@@ -117,6 +117,7 @@
{ "pipeline", MISDN_CFG_PIPELINE, MISDN_CTYPE_STR, NO_DEFAULT, NONE },
#endif
{ "need_more_infos", MISDN_CFG_NEED_MORE_INFOS, MISDN_CTYPE_BOOL, "0", NONE },
+ { "noautorespond_on_setup", MISDN_CFG_NOAUTORESPOND_ON_SETUP, MISDN_CTYPE_BOOL, "0", NONE },
{ "nttimeout", MISDN_CFG_NTTIMEOUT, MISDN_CTYPE_BOOL, "no", NONE },
{ "jitterbuffer", MISDN_CFG_JITTERBUFFER, MISDN_CTYPE_INT, "4000", NONE },
{ "jitterbuffer_upper_threshold", MISDN_CFG_JITTERBUFFER_UPPER_THRESHOLD, MISDN_CTYPE_INT, "0", NONE },
More information about the asterisk-commits
mailing list