adde incoming_early_audio option, to avoid sending tone indications to the remote party on incoming calls from the pstn, this shouldnt be enabled, only if the provider allows it

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@10227 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Christian Richter
2006-02-15 19:51:33 +00:00
parent f6bd1b8559
commit afaf8e4c04
4 changed files with 27 additions and 2 deletions

View File

@@ -150,6 +150,8 @@ struct chan_list {
int norxtone;
int notxtone;
int incoming_early_audio;
int pipe[2];
char ast_rd_buf[4096];
struct ast_frame frame;
@@ -1210,6 +1212,8 @@ static int read_config(struct chan_list *ch, int orig) {
misdn_cfg_get( port, MISDN_CFG_TXGAIN, &bc->txgain, sizeof(int));
misdn_cfg_get( port, MISDN_CFG_RXGAIN, &bc->rxgain, sizeof(int));
misdn_cfg_get( port, MISDN_CFG_INCOMING_EARLY_AUDIO, &ch->incoming_early_audio, sizeof(int));
misdn_cfg_get( port, MISDN_CFG_SENDDTMF, &bc->send_dtmf, sizeof(int));
misdn_cfg_get( port, MISDN_CFG_NEED_MORE_INFOS, &bc->need_more_infos, sizeof(int));
@@ -1733,7 +1737,11 @@ static int misdn_indication(struct ast_channel *ast, int cond)
p->state=MISDN_ALERTING;
chan_misdn_log(1, p->bc->port, " --> * IND :\tringing pid:%d\n",p->bc?p->bc->pid:-1);
misdn_lib_send_event( p->bc, EVENT_ALERTING);
tone_indicate(p, TONE_ALERTING);
if ( !p->bc->nt && (p->orginator==ORG_MISDN) && !p->incoming_early_audio )
chan_misdn_log(1,p->bc->port, " --> incoming_early_audio off\n");
else
tone_indicate(p, TONE_ALERTING);
chan_misdn_log(1, p->bc->port, " --> * SEND: State Ring pid:%d\n",p->bc?p->bc->pid:-1);
ast_setstate(ast,AST_STATE_RINGING);
}
@@ -2860,7 +2868,11 @@ static void do_immediate_setup(struct misdn_bchannel *bc,struct chan_list *ch ,
ret = misdn_lib_send_event(bc, EVENT_PROCEEDING );
}
}
tone_indicate(ch,TONE_DIAL);
if ( !bc->nt && (ch->orginator==ORG_MISDN) && !ch->incoming_early_audio )
chan_misdn_log(1,bc->port, " --> incoming_early_audio off\n");
else
tone_indicate(ch,TONE_DIAL);
chan_misdn_log(1, bc->port, "* Starting Ast ctx:%s dad:%s oad:%s with 's' extension\n", ast->context, ast->exten, AST_CID_P(ast));