* Added check for bridging in misdn_call to avoid setting echocancellation

when 2 mISDN channels are involved and when bridging is set. That lead
  to a kernel panic before under different situations, because we switched 
  about 2 times between hardware bridging and echocancelation
* readded MISDN_URATE variable which got lost before, this should make app_v110
  work again
* fixed typo



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@49303 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.2
Christian Richter 19 years ago
parent 6e6fa1c71f
commit 9c8bcc3c1c

@ -1695,6 +1695,15 @@ static int misdn_call(struct ast_channel *ast, char *dest, int timeout)
else
chan_misdn_log(2,port,"NO OPTS GIVEN\n");
/*check for bridging*/
int bridging;
misdn_cfg_get( 0, MISDN_GEN_BRIDGING, &bridging, sizeof(int));
if (bridging && ch->other_ch) {
chan_misdn_log(0, port, "Disabling EC on both Sides\n");
ch->bc->ec_enable=0;
ch->other_ch->bc->ec_enable=0;
}
r=misdn_lib_send_event( newbc, EVENT_SETUP );
/** we should have l3id after sending setup **/
@ -1769,7 +1778,6 @@ static int misdn_answer(struct ast_channel *ast)
}
p->state = MISDN_CONNECTED;
misdn_lib_echo(p->bc,0);
stop_indicate(p);
if ( ast_strlen_zero(p->bc->cad) ) {
@ -2317,26 +2325,11 @@ enum ast_bridge_result misdn_bridge (struct ast_channel *c0,
else
return -1;
int bridging;
misdn_cfg_get( 0, MISDN_GEN_BRIDGING, &bridging, sizeof(int));
if (bridging) {
int ec;
misdn_cfg_get( ch1->bc->port, MISDN_CFG_ECHOCANCEL, &ec, sizeof(int));
if ( ec ) {
chan_misdn_log(2, ch1->bc->port, "Disabling Echo Cancellor when Bridged\n");
ch1->bc->ec_enable=0;
manager_ec_disable(ch1->bc);
}
misdn_cfg_get( ch2->bc->port, MISDN_CFG_ECHOCANCEL, &ec, sizeof(int));
if ( ec ) {
chan_misdn_log(2, ch2->bc->port, "Disabling Echo Cancellor when Bridged\n");
ch2->bc->ec_enable=0;
manager_ec_disable(ch2->bc);
}
/* trying to make a mISDN_dsp conference */
chan_misdn_log(1, ch1->bc->port, "I SEND: Making conference with Number:%d\n", ch1->bc->pid +1);
misdn_lib_bridge(ch1->bc,ch2->bc);
}
@ -3229,6 +3222,11 @@ void export_ch(struct ast_channel *chan, struct misdn_bchannel *bc, struct chan_
sprintf(tmp,"%d",bc->sending_complete);
pbx_builtin_setvar_helper(chan,"MISDN_ADDRESS_COMPLETE",tmp);
}
if (bc->urate) {
sprintf(tmp,"%d",bc->urate);
pbx_builtin_setvar_helper(chan,"MISDN_URATE",tmp);
}
}
@ -3243,7 +3241,6 @@ cb_events(enum event_e event, struct misdn_bchannel *bc, void *user_data)
if (event != EVENT_BCHAN_DATA && event != EVENT_TONE_GENERATE) { /* Debug Only Non-Bchan */
int debuglevel=1;
if ( event==EVENT_CLEANUP && !user_data)
debuglevel=5;
@ -3787,8 +3784,6 @@ cb_events(enum event_e event, struct misdn_bchannel *bc, void *user_data)
misdn_lib_send_event(bc,EVENT_CONNECT_ACKNOWLEDGE);
struct ast_channel *bridged=AST_BRIDGED_P(ch->ast);
misdn_lib_echo(bc,0);
stop_indicate(ch);
if (bridged && !strcasecmp(bridged->tech->type,"mISDN")) {

@ -448,7 +448,7 @@ static int find_free_chan_in_stack(struct misdn_stack *stack, int channel)
int empty_chan_in_stack(struct misdn_stack *stack, int channel)
{
if (channel<=0 || channel>=MAX_BCHANS) {
cb_log(0,stack?stack->port:0, "empty_chan_inst_stack: cannot empty channel %d\n",channel);
cb_log(0,stack?stack->port:0, "empty_chan_in_stack: cannot empty channel %d\n",channel);
return -1;
}
@ -3575,6 +3575,7 @@ int misdn_lib_pid_restart(int pid)
if (bc) {
manager_clean_bc(bc);
}
return 0;
}
int misdn_lib_port_restart(int port)

Loading…
Cancel
Save