[asterisk-commits] dvossel: branch dvossel/generic_aoc r256981 - in /team/dvossel/generic_aoc: c...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Apr 12 16:30:04 CDT 2010
Author: dvossel
Date: Mon Apr 12 16:30:00 2010
New Revision: 256981
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=256981
Log:
configure AOC-E termination hangup delay to one half T305 timer
Modified:
team/dvossel/generic_aoc/channels/sig_pri.c
team/dvossel/generic_aoc/configs/chan_dahdi.conf.sample
Modified: team/dvossel/generic_aoc/channels/sig_pri.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/channels/sig_pri.c?view=diff&rev=256981&r1=256980&r2=256981
==============================================================================
--- team/dvossel/generic_aoc/channels/sig_pri.c (original)
+++ team/dvossel/generic_aoc/channels/sig_pri.c Mon Apr 12 16:30:00 2010
@@ -2729,18 +2729,16 @@
* hangup delay.
*
* \param ast Asterisk channel
+ * \param ms to delay hangup
*
* \return Nothing
*/
-static void sig_pri_send_aoce_termination_request(struct ast_channel *ast)
+static void sig_pri_send_aoce_termination_request(struct ast_channel *ast, unsigned int ms)
{
struct ast_aoc_decoded *decoded;
struct ast_aoc_encoded *encoded;
size_t encoded_size;
- struct timeval whentohangup = {
- .tv_sec = 10,
- .tv_usec = 0,
- };
+ struct timeval whentohangup = { 0, };
if (!(decoded = ast_aoc_create(AST_AOC_REQUEST, 0, AST_AOC_REQUEST_E))) {
ast_softhangup_nolock(ast, AST_SOFTHANGUP_DEV);
@@ -2755,8 +2753,11 @@
return;
}
+ /* convert ms to timeval */
+ whentohangup.tv_usec = (ms % 1000) * 1000;
+ whentohangup.tv_sec = ms / 1000;
+
ast_queue_control_data(ast, AST_CONTROL_AOC, encoded, encoded_size);
-
ast_channel_setwhentohangup_tv(ast, whentohangup);
ast_log(LOG_DEBUG, "Delaying hangup on %s for aoc-e msg\n", ast->name);
@@ -4600,7 +4601,7 @@
if (do_hangup) {
#if defined(HAVE_PRI_AOC_EVENTS)
if (!pri->pvts[chanpos]->holding_aoce && pri->aoce_delayhangup && ast_bridged_channel(pri->pvts[chanpos]->owner)) {
- sig_pri_send_aoce_termination_request(pri->pvts[chanpos]->owner);
+ sig_pri_send_aoce_termination_request(pri->pvts[chanpos]->owner, pri_get_timer(pri->pri, PRI_TIMER_T305) / 2);
pri->pvts[chanpos]->waiting_for_aoce = 1;
} else if (detect_aoc_e_subcmd(e->hangup.subcmds)) {
/* If a AOC-E msg was sent during the Disconnect, we must use a
@@ -4721,7 +4722,7 @@
if (do_hangup) {
#if defined(HAVE_PRI_AOC_EVENTS)
if (!pri->pvts[chanpos]->holding_aoce && pri->aoce_delayhangup && ast_bridged_channel(pri->pvts[chanpos]->owner)) {
- sig_pri_send_aoce_termination_request(pri->pvts[chanpos]->owner);
+ sig_pri_send_aoce_termination_request(pri->pvts[chanpos]->owner, pri_get_timer(pri->pri, PRI_TIMER_T305) / 2);
pri->pvts[chanpos]->waiting_for_aoce = 1;
} else if (detect_aoc_e_subcmd(e->hangup.subcmds)) {
/* If a AOC-E msg was sent during the Disconnect, we must use a AST_CONTROL_HANGUP frame
Modified: team/dvossel/generic_aoc/configs/chan_dahdi.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/configs/chan_dahdi.conf.sample?view=diff&rev=256981&r1=256980&r2=256981
==============================================================================
--- team/dvossel/generic_aoc/configs/chan_dahdi.conf.sample (original)
+++ team/dvossel/generic_aoc/configs/chan_dahdi.conf.sample Mon Apr 12 16:30:00 2010
@@ -307,11 +307,11 @@
;
; When this option is enabled, a hangup initiated by the ISDN PRI side of the
; asterisk channel will result in the channel delaying its hangup in an
-; attempt to receive the final AOC-E message from its bridge. If the channel
+; attempt to receive the final AOC-E message from its bridge. The delay
+; period is configured as one half the T305 timer length. If the channel
; is not bridged the hangup will occur immediatly without delay.
;
;aoce_delayhangup=yes
-
; pritimer cannot be changed on a reload.
;
More information about the asterisk-commits
mailing list