[asterisk-commits] trunk r37226 - in /trunk: channels/chan_zap.c
configs/zapata.conf.sample
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Thu Jul 6 14:51:51 MST 2006
Author: mattf
Date: Thu Jul 6 16:51:51 2006
New Revision: 37226
URL: http://svn.digium.com/view/asterisk?rev=37226&view=rev
Log:
Asterisk portion of the T309 patch. (#7271)
Modified:
trunk/channels/chan_zap.c
trunk/configs/zapata.conf.sample
Modified: trunk/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_zap.c?rev=37226&r1=37225&r2=37226&view=diff
==============================================================================
--- trunk/channels/chan_zap.c (original)
+++ trunk/channels/chan_zap.c Thu Jul 6 16:51:51 2006
@@ -3637,20 +3637,23 @@
break;
case ZT_EVENT_ALARM:
#ifdef HAVE_PRI
- if (p->call) {
- if (p->pri && p->pri->pri) {
- if (!pri_grab(p, p->pri)) {
- pri_hangup(p->pri->pri, p->call, -1);
- pri_destroycall(p->pri->pri, p->call);
- p->call = NULL;
- pri_rel(p->pri);
+ if (!p->pri || !p->pri->pri || (pri_get_timer(p->pri->pri, PRI_TIMER_T309) < 0)) {
+ /* T309 is not enabled : hangup calls when alarm occurs */
+ if (p->call) {
+ if (p->pri && p->pri->pri) {
+ if (!pri_grab(p, p->pri)) {
+ pri_hangup(p->pri->pri, p->call, -1);
+ pri_destroycall(p->pri->pri, p->call);
+ p->call = NULL;
+ pri_rel(p->pri);
+ } else
+ ast_log(LOG_WARNING, "Failed to grab PRI!\n");
} else
- ast_log(LOG_WARNING, "Failed to grab PRI!\n");
- } else
- ast_log(LOG_WARNING, "The PRI Call have not been destroyed\n");
- }
- if (p->owner)
- p->owner->_softhangup |= AST_SOFTHANGUP_DEV;
+ ast_log(LOG_WARNING, "The PRI Call has not been destroyed\n");
+ }
+ if (p->owner)
+ p->owner->_softhangup |= AST_SOFTHANGUP_DEV;
+ }
if (p->bearer)
p->bearer->inalarm = 1;
else
@@ -3662,7 +3665,13 @@
"Alarm: %s\r\n"
"Channel: %d\r\n",
alarm2str(res), p->channel);
- /* fall through intentionally */
+#ifdef HAVE_LIBPRI
+ if (!p->pri || !p->pri->pri || pri_get_timer(p->pri->pri, PRI_TIMER_T309) < 0) {
+ /* fall through intentionally */
+ } else {
+ break;
+ }
+#endif
case ZT_EVENT_ONHOOK:
if (p->radio) {
p->subs[index].f.frametype = AST_FRAME_CONTROL;
@@ -8366,18 +8375,21 @@
for (i = 0; i < pri->numchans; i++) {
struct zt_pvt *p = pri->pvts[i];
if (p) {
- if (p->call) {
- if (p->pri && p->pri->pri) {
- pri_hangup(p->pri->pri, p->call, -1);
- pri_destroycall(p->pri->pri, p->call);
- p->call = NULL;
- } else
- ast_log(LOG_WARNING, "The PRI Call have not been destroyed\n");
+ if (!p->pri || !p->pri->pri || pri_get_timer(p->pri->pri, PRI_TIMER_T309) < 0) {
+ /* T309 is not enabled : hangup calls when alarm occurs */
+ if (p->call) {
+ if (p->pri && p->pri->pri) {
+ pri_hangup(p->pri->pri, p->call, -1);
+ pri_destroycall(p->pri->pri, p->call);
+ p->call = NULL;
+ } else
+ ast_log(LOG_WARNING, "The PRI Call have not been destroyed\n");
+ }
+ if (p->realcall) {
+ pri_hangup_all(p->realcall, pri);
+ } else if (p->owner)
+ p->owner->_softhangup |= AST_SOFTHANGUP_DEV;
}
- if (p->realcall) {
- pri_hangup_all(p->realcall, pri);
- } else if (p->owner)
- p->owner->_softhangup |= AST_SOFTHANGUP_DEV;
p->inalarm = 1;
}
}
@@ -10218,12 +10230,11 @@
cfg = ast_config_load(config);
- /* We *must* have a config file otherwise stop immediately */
+ /* Error if we have no config file */
if (!cfg) {
ast_log(LOG_ERROR, "Unable to load config %s\n", config);
return 0;
}
-
/* It's a little silly to lock it, but we mind as well just to be sure */
ast_mutex_lock(&iflock);
Modified: trunk/configs/zapata.conf.sample
URL: http://svn.digium.com/view/asterisk/trunk/configs/zapata.conf.sample?rev=37226&r1=37225&r2=37226&view=diff
==============================================================================
--- trunk/configs/zapata.conf.sample (original)
+++ trunk/configs/zapata.conf.sample Thu Jul 6 16:51:51 2006
@@ -131,6 +131,16 @@
; ISDN Timers
; All of the ISDN timers and counters that are used are configurable. Specify
; the timer name, and its value (in ms for timers).
+; K: Layer 2 max number of outstanding unacknowledged I frames (default 7)
+; N200: Layer 2 max number of retransmissions of a frame (default 3)
+; T200: Layer 2 max time before retransmission of a frame (default 1000 ms)
+; T203: Layer 2 max time without frames being exchanged (default 10000 ms)
+; T305: Wait for DISCONNECT acknowledge (default 30000 ms)
+; T308: Wait for RELEASE acknowledge (default 4000 ms)
+; T309: Maintain active calls on Layer 2 disconnection (default -1, Asterisk clears calls)
+; EuroISDN: 6000 to 12000 ms, according to (N200 + 1) Ã T200 + 2s
+; May vary in other ISDN standards (Q.931 1993 : 90000 ms)
+; T313: Wait for CONNECT acknowledge, CPE side only (default 3000 ms)
;
; pritimer => t200,1000
; pritimer => t313,4000
More information about the asterisk-commits
mailing list