diff --git a/channels/chan_brcm.c b/channels/chan_brcm.c index 436e25e1eabdd89c9543598f7469460fe902839a..98685ac1e913058ec3eda8c4ca1ba08214c870eb 100644 --- a/channels/chan_brcm.c +++ b/channels/chan_brcm.c @@ -578,7 +578,7 @@ static int brcm_indicate(struct ast_channel *ast, int condition, const void *dat case AST_CONTROL_RINGING: sub->channel_state = RINGBACK; endpt_signal(sub->parent->line_id, "ringback", "on", NULL); - if (sub->owner) { + if (sub->owner && (sub->call_id == 0)) { sub->call_id = ast_channel_callid(sub->owner); endpt_connection(sub->parent->line_id, sub->call_id, "update"); } @@ -629,6 +629,10 @@ static int brcm_indicate(struct ast_channel *ast, int condition, const void *dat } } res = 0; + } else if (sub->owner && (sub->call_id == 0)) { + sub->call_id = ast_channel_callid(sub->owner); + endpt_connection(sub->parent->line_id, sub->call_id, "update"); + res = 0; } else { res = -1; } @@ -4587,7 +4591,7 @@ static int brcm_create_connection(struct brcm_subchannel *sub) { if(!brcm_in_onhold(sub->parent) && !brcm_in_call(sub->parent)) { // Is there another connection already? ast_debug(1, "Creating real endpoint connection for pvt line_id=%i, connection_id: %d, call_id: %d\n", sub->parent->line_id, sub->connection_id, sub->call_id); endpt_connection(sub->parent->line_id, sub->call_id, "create"); - } else { + } else if (sub->call_id != 0) { ast_debug(1, "Updating real endpoint connection for pvt line_id=%i, connection_id: %d, call_id: %d\n", sub->parent->line_id, sub->connection_id, sub->call_id); endpt_connection(sub->parent->line_id, sub->call_id, "update"); }