From f1dce57742ce5fdcdad03706136c9398588af453 Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Wed, 8 Aug 2012 20:17:02 +0000 Subject: Fix the analog dial *0 flash-hook of bridged peer feature. The flash-hook the bridged peer feature now correctly determines if the bridged peer is another chan_dahdi channel, that it is an analog channel, and that it has the correct signaling for an FXO port. It now also flash-hooks the correct channel. ........ Merged revisions 370900 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 370901 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370902 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/sig_analog.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'channels/sig_analog.c') diff --git a/channels/sig_analog.c b/channels/sig_analog.c index 2b81eb460..c6303d931 100644 --- a/channels/sig_analog.c +++ b/channels/sig_analog.c @@ -1711,7 +1711,7 @@ static void analog_get_and_handle_alarms(struct analog_pvt *p) static void *analog_get_bridged_channel(struct analog_pvt *p, struct ast_channel *chan) { if (p->calls->get_sigpvt_bridged_channel) { - return p->calls->get_sigpvt_bridged_channel; + return p->calls->get_sigpvt_bridged_channel(chan); } return NULL; } @@ -2322,18 +2322,16 @@ static void *__analog_ss_thread(void *data) struct ast_channel *nbridge = p->subs[ANALOG_SUB_THREEWAY].owner; struct analog_pvt *pbridge = NULL; /* set up the private struct of the bridged one, if any */ - if (nbridge && ast_bridged_channel(nbridge)) { + if (nbridge) { pbridge = analog_get_bridged_channel(p, nbridge); } - if (nbridge && pbridge && - (ast_channel_tech(nbridge) == p->chan_tech) && - (ast_channel_tech(ast_bridged_channel(nbridge)) == p->chan_tech) && - ISTRUNK(pbridge)) { + if (pbridge && ISTRUNK(pbridge)) { /* Clear out the dial buffer */ p->dop.dialstr[0] = '\0'; /* flash hookswitch */ - if ((analog_flash(p) == -1) && (errno != EINPROGRESS)) { - ast_log(LOG_WARNING, "Unable to flash external trunk on channel %s: %s\n", + if ((analog_flash(pbridge) == -1) && (errno != EINPROGRESS)) { + ast_log(LOG_WARNING, + "Unable to flash-hook bridged trunk from channel %s: %s\n", ast_channel_name(nbridge), strerror(errno)); } analog_swap_subs(p, ANALOG_SUB_REAL, ANALOG_SUB_THREEWAY); -- cgit v1.2.3