[asterisk-commits] file: branch file/issue_9650 r65848 - in
/team/file/issue_9650: include/aster...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Thu May 24 08:02:06 MST 2007
Author: file
Date: Thu May 24 10:02:06 2007
New Revision: 65848
URL: http://svn.digium.com/view/asterisk?view=rev&rev=65848
Log:
Add some potentially silly code that will allow the current perceived indication to migrate over to the other channel when masquerading happens. Example: You do an attended transfer but actually complete it before the remote party answers. Right now you may get silence (since the frame indicating ringing was sent through before you completed the transfer) but with this code the masquerade process should see that the channel should get ringing and indicate it... hopefully.
Modified:
team/file/issue_9650/include/asterisk/channel.h
team/file/issue_9650/main/channel.c
Modified: team/file/issue_9650/include/asterisk/channel.h
URL: http://svn.digium.com/view/asterisk/team/file/issue_9650/include/asterisk/channel.h?view=diff&rev=65848&r1=65847&r2=65848
==============================================================================
--- team/file/issue_9650/include/asterisk/channel.h (original)
+++ team/file/issue_9650/include/asterisk/channel.h Thu May 24 10:02:06 2007
@@ -490,6 +490,8 @@
char emulate_dtmf_digit; /*!< Digit being emulated */
unsigned int emulate_dtmf_duration; /*!< Number of ms left to emulate DTMF for */
struct timeval dtmf_tv; /*!< The time that an in process digit began, or the last digit ended */
+
+ int perceived_indication;
/*! \brief Data stores on the channel */
AST_LIST_HEAD_NOLOCK(datastores, ast_datastore) datastores;
Modified: team/file/issue_9650/main/channel.c
URL: http://svn.digium.com/view/asterisk/team/file/issue_9650/main/channel.c?view=diff&rev=65848&r1=65847&r2=65848
==============================================================================
--- team/file/issue_9650/main/channel.c (original)
+++ team/file/issue_9650/main/channel.c Thu May 24 10:02:06 2007
@@ -1696,6 +1696,8 @@
ast_channel_unlock(chan);
return -1;
}
+
+ chan->perceived_indication = 0;
switch (chan->_state) {
case AST_STATE_RINGING:
@@ -2462,6 +2464,9 @@
}
if (chan->tech->indicate)
res = chan->tech->indicate(chan, condition, data, datalen);
+ /* Record the perceived indication on the channel structure */
+ if (condition == AST_CONTROL_RINGING || condition == AST_CONTROL_BUSY || condition == AST_CONTROL_CONGESTION)
+ chan->perceived_indication = condition;
ast_channel_unlock(chan);
if (!chan->tech->indicate || res) {
/*
@@ -3643,6 +3648,10 @@
if (option_debug)
ast_log(LOG_DEBUG, "Putting channel %s in %d/%d formats\n", original->name, wformat, rformat);
+ /* Once all is said and done see if the perceived indications match, if not we have to make them match */
+ if (clone->perceived_indication != original->perceived_indication)
+ ast_indicate(original, clone->perceived_indication);
+
/* Okay. Last thing is to let the channel driver know about all this mess, so he
can fix up everything as best as possible */
if (original->tech->fixup) {
More information about the asterisk-commits
mailing list