[asterisk-commits] rmudgett: branch rmudgett/bch_shift_v1.4 r311739 - in /team/rmudgett/bch_shif...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon Mar 28 12:33:40 CDT 2011
Author: rmudgett
Date: Mon Mar 28 12:33:36 2011
New Revision: 311739
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=311739
Log:
Merged revisions 311685,311737 via svnmerge from
https://origsvn.digium.com/svn/asterisk/team/rmudgett/bch_shift_v1.6.2
................
r311685 | rmudgett | 2011-03-25 17:05:24 -0500 (Fri, 25 Mar 2011) | 86 lines
Merged revisions 311556-311557,311604,311607-311608,311610,311664-311665,311672,311674,311676,311682 via svnmerge from
https://origsvn.digium.com/svn/asterisk/team/rmudgett/bch_shift_v1.8
........
r311556 | rmudgett | 2011-03-22 17:52:16 -0500 (Tue, 22 Mar 2011) | 1 line
Mostly restart message format changes.
........
r311557 | rmudgett | 2011-03-22 17:58:26 -0500 (Tue, 22 Mar 2011) | 1 line
Add allocated flag to 'dahdi show channel' PRI output.
........
r311604 | rmudgett | 2011-03-23 09:40:26 -0500 (Wed, 23 Mar 2011) | 1 line
Block SETUPs with duplicate call ptr.
........
r311607 | rmudgett | 2011-03-23 11:39:27 -0500 (Wed, 23 Mar 2011) | 1 line
Add conditional code around force restart code.
........
r311608 | rmudgett | 2011-03-23 12:15:03 -0500 (Wed, 23 Mar 2011) | 1 line
Invert test logic. It will work better now.
........
r311610 | rmudgett | 2011-03-23 15:10:31 -0500 (Wed, 23 Mar 2011) | 1 line
Make RESTART request not destroy call and update hangup/restart verbose messages.
........
r311664 | rmudgett | 2011-03-24 13:35:05 -0500 (Thu, 24 Mar 2011) | 2 lines
Just destroy calls if T309 is not enabled.
........
r311665 | rmudgett | 2011-03-24 14:41:56 -0500 (Thu, 24 Mar 2011) | 30 lines
Invalid PRI call ptr message associated with force channel RESTART.
When Asterisk receives a cause PRI_CAUSE_REQUESTED_CHAN_UNAVAIL(44), it
forces a RESTART on that B channel. Due to timing, another SETUP
requesting the same B channel could come in right after the
RELEASE_COMPLETE with cause 44. That call SETUP would get shifted to
another channel and two messages sent immediately (SETUP_ACKNOWLEDGE,
PROCEEDING, ALERTING, or CONNECT). The peer Asterisk box on receiving the
RESTART, immediately hangs up and destroys the new call associated with the B channel.
When the peer then processes the two messages for the destroyed call, it
responds with PRI_CAUSE_INVALID_CALL_REFERENCE(81) to both.
--> SETUP(call-1)
<-- RELEASE_COMPLETE(call-1, PRI_CAUSE_REQUESTED_CHAN_UNAVAIL)
<-- SETUP(call-2, same B channel)
--> RESTART
--> SETUP_ACKNOWLEDGE(call-2, New B channel)
--> CONNECT(call-2)
<-- RESTART_ACKNOWLEDGE (Destroys call-2 because associated with B channel)
<-- RELEASE_COMPLETE(call-2, PRI_CAUSE_INVALID_CALL_REFERENCE)
<-- RELEASE_COMPLETE(call-2, PRI_CAUSE_INVALID_CALL_REFERENCE)
If both RELEASE_COMPLETE responses are processed by libpri before the
Asterisk core hangs up the call, then the invalid call ptr message is
generated. Libpri has already destroyed the call structure when it
processed the second RELEASE_COMPLETE.
Fixed by making sure that the call is hung up and forgotten immediately if
the hangup cause is PRI_CAUSE_INVALID_CALL_REFERENCE.
........
r311672 | rmudgett | 2011-03-24 16:48:42 -0500 (Thu, 24 Mar 2011) | 7 lines
Don't continue to deal with the B channel after we have effectively released it.
In sig_pri_hangup(), the owner ptr and allocated flag should not be
cleared outside of the PRI lock protection. Also they should be cleared
as the last steps in hangup since they release the B channel for other
calls to use.
........
r311674 | rmudgett | 2011-03-24 18:02:23 -0500 (Thu, 24 Mar 2011) | 1 line
Make sure that the last call has completed hanging up before setting up for the new.
........
r311676 | rmudgett | 2011-03-25 09:47:44 -0500 (Fri, 25 Mar 2011) | 1 line
Update comment since I fixed the problem it mentions.
........
r311682 | rmudgett | 2011-03-25 12:58:58 -0500 (Fri, 25 Mar 2011) | 1 line
Prevent potential deadlock with failed idle call.
........
................
r311737 | rmudgett | 2011-03-28 11:56:59 -0500 (Mon, 28 Mar 2011) | 1 line
Add some missing exception code and restore some now GR-303 specific code.
................
Modified:
team/rmudgett/bch_shift_v1.4/ (props changed)
team/rmudgett/bch_shift_v1.4/channels/chan_dahdi.c
Propchange: team/rmudgett/bch_shift_v1.4/
------------------------------------------------------------------------------
--- bch_shift_v1.6.2-integrated (original)
+++ bch_shift_v1.6.2-integrated Mon Mar 28 12:33:36 2011
@@ -1,1 +1,1 @@
-/team/rmudgett/bch_shift_v1.6.2:1-311681,311684
+/team/rmudgett/bch_shift_v1.6.2:1-311737
Modified: team/rmudgett/bch_shift_v1.4/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/team/rmudgett/bch_shift_v1.4/channels/chan_dahdi.c?view=diff&rev=311739&r1=311738&r2=311739
==============================================================================
--- team/rmudgett/bch_shift_v1.4/channels/chan_dahdi.c (original)
+++ team/rmudgett/bch_shift_v1.4/channels/chan_dahdi.c Mon Mar 28 12:33:36 2011
@@ -126,6 +126,22 @@
#undef SUPPORT_USERUSER
/*!
+ * Define to make always pick a channel if allowed. Useful for
+ * testing channel shifting.
+ */
+//#define ALWAYS_PICK_CHANNEL 1
+#define ALWAYS_PICK_CHANNEL 1 //BUGBUG
+
+/*!
+ * Define to force a RESTART on a channel that returns a cause
+ * code of PRI_CAUSE_REQUESTED_CHAN_UNAVAIL(44). If the cause
+ * is because of a stuck channel on the peer and the channel is
+ * always the next channel we pick for an outgoing call then
+ * this can help.
+ */
+#define FORCE_RESTART_UNAVAIL_CHANS 1
+
+/*!
* \note Define ZHONE_HACK to cause us to go off hook and then back on hook when
* the user hangs up to reset the state machine so ring works properly.
* This is used to be able to support kewlstart by putting the zhone in
@@ -145,8 +161,6 @@
/*! \brief Typically, how many rings before we should send Caller*ID */
#define DEFAULT_CIDRINGS 1
-
-#define CHANNEL_PSEUDO -12
#define AST_LAW(p) (((p)->law == DAHDI_LAW_ALAW) ? AST_FORMAT_ALAW : AST_FORMAT_ULAW)
@@ -3076,7 +3090,6 @@
}
if (!p->subs[SUB_REAL].owner && !p->subs[SUB_CALLWAIT].owner && !p->subs[SUB_THREEWAY].owner) {
- p->owner = NULL;
p->ringt = 0;
p->distinctivering = 0;
p->confirmanswer = 0;
@@ -3087,7 +3100,6 @@
p->pulsedial = 0;
p->onhooktime = time(NULL);
#ifdef HAVE_PRI
- p->allocated = 0;
p->dialing = 0;
p->progress = 0;
p->call_level = DAHDI_CALL_LEVEL_IDLE;
@@ -3118,7 +3130,7 @@
if (res < 0)
ast_log(LOG_WARNING, "Unable to set law on channel %d to default: %s\n", p->channel, strerror(errno));
/* Perform low level hangup if no owner left */
-#ifdef HAVE_PRI
+#if defined(HAVE_PRI)
if (p->pri) {
#ifdef SUPPORT_USERUSER
const char *useruser = pbx_builtin_getvar_helper(ast,"USERUSERINFO");
@@ -3126,51 +3138,52 @@
/* Make sure we have a call (or REALLY have a call in the case of a PRI) */
if (p->call && (!p->bearer || (p->bearer->call == p->call))) {
- if (!pri_grab(p, p->pri)) {
- if (p->alreadyhungup) {
- ast_log(LOG_DEBUG, "Already hungup... Calling hangup once, and clearing call\n");
+ pri_grab(p, p->pri);
+ if (p->alreadyhungup) {
+ ast_log(LOG_DEBUG, "Already hungup... Calling hangup once, and clearing call\n");
#ifdef SUPPORT_USERUSER
- pri_call_set_useruser(p->call, useruser);
+ pri_call_set_useruser(p->call, useruser);
#endif
- pri_hangup(p->pri->pri, p->call, -1);
- p->call = NULL;
- if (p->bearer)
- p->bearer->call = NULL;
- } else {
- const char *cause = pbx_builtin_getvar_helper(ast,"PRI_CAUSE");
- int icause = ast->hangupcause ? ast->hangupcause : -1;
- ast_log(LOG_DEBUG, "Not yet hungup... Calling hangup once with icause, and clearing call\n");
+ pri_hangup(p->pri->pri, p->call, -1);
+ p->call = NULL;
+ if (p->bearer)
+ p->bearer->call = NULL;
+ } else {
+ const char *cause = pbx_builtin_getvar_helper(ast,"PRI_CAUSE");
+ int icause = ast->hangupcause ? ast->hangupcause : -1;
+ ast_log(LOG_DEBUG, "Not yet hungup... Calling hangup once with icause, and clearing call\n");
#ifdef SUPPORT_USERUSER
- pri_call_set_useruser(p->call, useruser);
+ pri_call_set_useruser(p->call, useruser);
#endif
- p->alreadyhungup = 1;
- if (p->bearer)
- p->bearer->alreadyhungup = 1;
- if (cause) {
- if (atoi(cause))
- icause = atoi(cause);
- }
- pri_hangup(p->pri->pri, p->call, icause);
+ p->alreadyhungup = 1;
+ if (p->bearer)
+ p->bearer->alreadyhungup = 1;
+ if (cause) {
+ if (atoi(cause))
+ icause = atoi(cause);
}
- if (res < 0)
- ast_log(LOG_WARNING, "pri_disconnect failed\n");
- pri_rel(p->pri);
- } else {
- ast_log(LOG_WARNING, "Unable to grab PRI on span %d\n", p->span);
- res = -1;
- }
+ pri_hangup(p->pri->pri, p->call, icause);
+ }
+ p->allocated = 0;
+ p->owner = NULL;
+ pri_rel(p->pri);
} else {
if (p->bearer)
ast_log(LOG_DEBUG, "Bearer call is %p, while ours is still %p\n", p->bearer->call, p->call);
p->call = NULL;
+ p->allocated = 0;
+ p->owner = NULL;
res = 0;
}
- }
-#endif
+ } else
+#endif /* defined(HAVE_PRI) */
+ {
+ p->owner = NULL;
+ }
if (p->sig && (p->sig != SIG_PRI))
res = dahdi_set_hook(p->subs[SUB_REAL].dfd, DAHDI_ONHOOK);
if (res < 0) {
@@ -3250,12 +3263,10 @@
p->oprmode = 0;
ast->tech_pvt = NULL;
ast_mutex_unlock(&p->lock);
- ast_module_unref(ast_module_info->self);
if (option_verbose > 2)
ast_verbose( VERBOSE_PREFIX_3 "Hungup '%s'\n", ast->name);
ast_mutex_lock(&iflock);
-
if (p->restartpending) {
num_restart_pending--;
}
@@ -3274,6 +3285,8 @@
}
}
ast_mutex_unlock(&iflock);
+
+ ast_module_unref(ast_module_info->self);
return 0;
}
@@ -4529,11 +4542,10 @@
case DAHDI_EVENT_ALARM:
#ifdef HAVE_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 */
+ /* T309 is not enabled : destroy 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);
@@ -9060,6 +9072,21 @@
break;
}
}
+#if defined(HAVE_PRI)
+ switch (p->sig) {
+ case SIG_PRI_LIB_HANDLE_CASES:
+ /*
+ * We already have the B channel reserved for this call. We
+ * just need to make sure that dahdi_hangup() has completed
+ * cleaning up before continuing.
+ */
+ ast_mutex_lock(&p->lock);
+ ast_mutex_unlock(&p->lock);
+ break;
+ default:
+ break;
+ }
+#endif /* defined(HAVE_PRI) */
p->outgoing = 1;
tmp = dahdi_new(p, AST_STATE_RESERVED, 0, p->owner ? SUB_CALLWAIT : SUB_REAL, 0, 0);
if (!tmp) {
@@ -9889,7 +9916,9 @@
pri->pvts[nextidle]->isidlecall = 1;
if (ast_pthread_create_background(&p, NULL, do_idle_thread, idle)) {
ast_log(LOG_WARNING, "Unable to start new thread for idle channel '%s'\n", idle->name);
+ ast_mutex_unlock(&pri->lock);
ast_hangup(idle);
+ ast_mutex_lock(&pri->lock);
}
} else {
ast_log(LOG_WARNING, "Unable to request channel 'DAHDI/%s' for idle call\n", idlen);
@@ -10047,10 +10076,9 @@
struct dahdi_pvt *p = pri->pvts[i];
if (p) {
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 */
+ /* T309 is not enabled : destroy 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
@@ -10067,15 +10095,18 @@
}
break;
case PRI_EVENT_RESTART:
- if (e->restart.channel > -1) {
+ if (e->restart.channel > -1 && PRI_CHANNEL(e->ring.channel) != 0xFF) {
chanpos = pri_find_principle(pri, e->restart.channel);
if (chanpos < 0)
- ast_log(LOG_WARNING, "Restart requested on odd/unavailable channel number %d/%d on span %d\n",
- PRI_SPAN(e->restart.channel), PRI_CHANNEL(e->restart.channel), pri->span);
+ ast_log(LOG_WARNING,
+ "Span %d: Restart requested on odd/unavailable channel number %d/%d\n",
+ pri->span, PRI_SPAN(e->restart.channel),
+ PRI_CHANNEL(e->restart.channel));
else {
if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "B-channel %d/%d restarted on span %d\n",
- PRI_SPAN(e->restart.channel), PRI_CHANNEL(e->restart.channel), pri->span);
+ ast_verbose(VERBOSE_PREFIX_3 "Span %d: Channel %d/%d restarted\n",
+ pri->span, PRI_SPAN(e->restart.channel),
+ PRI_CHANNEL(e->restart.channel));
ast_mutex_lock(&pri->pvts[chanpos]->lock);
if (pri->pvts[chanpos]->call) {
pri_destroycall(pri->pri, pri->pvts[chanpos]->call);
@@ -10090,7 +10121,8 @@
}
} else {
if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_2 "Restart on requested on entire span %d\n", pri->span);
+ ast_verbose(VERBOSE_PREFIX_2 "Restart requested on entire span %d\n",
+ pri->span);
for (x = 0; x < pri->numchans; x++)
if (pri->pvts[x]) {
ast_mutex_lock(&pri->pvts[x]->lock);
@@ -10159,6 +10191,15 @@
break;
case PRI_EVENT_RING:
crv = NULL;
+ chanpos = pri_find_principle_by_call(pri, e->ring.call);
+ if (-1 < chanpos) {
+ /* Libpri has already filtered out duplicate SETUPs. */
+ ast_log(LOG_WARNING,
+ "Span %d: Got SETUP with duplicate call ptr. Dropping call.\n",
+ pri->span);
+ pri_hangup(pri->pri, e->ring.call, PRI_CAUSE_NORMAL_TEMPORARY_FAILURE);
+ break;
+ }
if (e->ring.channel == -1 || PRI_CHANNEL(e->ring.channel) == 0xFF) {
/* Any channel requested. */
chanpos = pri_find_empty_chan(pri, 1);
@@ -10178,14 +10219,6 @@
pri->span, PRI_SPAN(e->ring.channel),
PRI_CHANNEL(e->ring.channel));
} else if (!sig_pri_is_chan_available(pri->pvts[chanpos])) {
- /* Libpri has already filtered out duplicate SETUPs anyway. */
- if (pri->pvts[chanpos]->call == e->ring.call) {
- ast_log(LOG_WARNING,
- "Span %d: Ignoring duplicate SETUP on channel %d/%d\n",
- pri->span, PRI_SPAN(e->ring.channel),
- PRI_CHANNEL(e->ring.channel));
- break;
- }
/* This is where we handle initial glare */
ast_log(LOG_DEBUG,
"Span %d: SETUP requested unavailable channel %d/%d. Attempting to renegotiate.\n",
@@ -10193,12 +10226,6 @@
PRI_CHANNEL(e->ring.channel));
chanpos = -1;
}
-/*!
- * Define to make always pick a channel if allowed. Useful for
- * testing channel shifting.
- */
-//#define ALWAYS_PICK_CHANNEL 1
-#define ALWAYS_PICK_CHANNEL 1 //BUGBUG
#if defined(ALWAYS_PICK_CHANNEL)
if (e->ring.flexible) {
chanpos = -1;
@@ -10700,6 +10727,18 @@
break;
}
ast_mutex_lock(&pri->pvts[chanpos]->lock);
+ switch (e->hangup.cause) {
+ case PRI_CAUSE_INVALID_CALL_REFERENCE:
+ /*
+ * The peer denies the existence of this call so we must
+ * continue hanging it up and forget about it.
+ */
+ pri_hangup(pri->pri, e->hangup.call, e->hangup.cause);
+ pri->pvts[chanpos]->call = NULL;
+ break;
+ default:
+ break;
+ }
if (!pri->pvts[chanpos]->alreadyhungup) {
/* we're calling here dahdi_hangup so once we get there we need to clear p->call after calling pri_hangup */
pri->pvts[chanpos]->alreadyhungup = 1;
@@ -10749,20 +10788,26 @@
pri->pvts[chanpos]->call = NULL;
}
if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Channel %d/%d, span %d got hangup, cause %d\n",
- pri->pvts[chanpos]->logicalspan, pri->pvts[chanpos]->prioffset, pri->span, e->hangup.cause);
+ ast_verbose(VERBOSE_PREFIX_3 "Span %d: Channel %d/%d got hangup, cause %d\n",
+ pri->span, pri->pvts[chanpos]->logicalspan,
+ pri->pvts[chanpos]->prioffset, e->hangup.cause);
} else {
/* Continue hanging up the call. */
pri_hangup(pri->pri, pri->pvts[chanpos]->call, e->hangup.cause);
pri->pvts[chanpos]->call = NULL;
}
- if (e->hangup.cause == PRI_CAUSE_REQUESTED_CHAN_UNAVAIL) {
+#if defined(FORCE_RESTART_UNAVAIL_CHANS)
+ if (e->hangup.cause == PRI_CAUSE_REQUESTED_CHAN_UNAVAIL
+ && !pri->resetting && !pri->pvts[chanpos]->resetting) {
if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Forcing restart of channel %d/%d on span %d since channel reported in use\n",
- PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span);
+ ast_verbose(VERBOSE_PREFIX_3
+ "Span %d: Forcing restart of channel %d/%d since channel reported in use\n",
+ pri->span, pri->pvts[chanpos]->logicalspan,
+ pri->pvts[chanpos]->prioffset);
+ pri->pvts[chanpos]->resetting = 1;
pri_reset(pri->pri, PVT_TO_CHANNEL(pri->pvts[chanpos]));
- pri->pvts[chanpos]->resetting = 1;
- }
+ }
+#endif /* defined(FORCE_RESTART_UNAVAIL_CHANS) */
if (e->hangup.aoc_units > -1)
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Channel %d/%d, span %d received AOC-E charging %d unit%s\n",
@@ -10793,6 +10838,20 @@
break;
}
ast_mutex_lock(&pri->pvts[chanpos]->lock);
+ switch (e->hangup.cause) {
+ case PRI_CAUSE_INVALID_CALL_REFERENCE:
+ /*
+ * The peer denies the existence of this call so we must
+ * continue hanging it up and forget about it. We should not
+ * get this cause here, but for completeness we will handle it
+ * anyway.
+ */
+ pri_hangup(pri->pri, e->hangup.call, e->hangup.cause);
+ pri->pvts[chanpos]->call = NULL;
+ break;
+ default:
+ break;
+ }
if (pri->pvts[chanpos]->realcall)
pri_hangup_all(pri->pvts[chanpos]->realcall, pri);
else if (pri->pvts[chanpos]->owner) {
@@ -10830,7 +10889,9 @@
break;
}
if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Channel %d/%d, span %d got hangup request, cause %d\n", PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span, e->hangup.cause);
+ ast_verbose(VERBOSE_PREFIX_3 "Span %d: Channel %d/%d got hangup request, cause %d\n",
+ pri->span, pri->pvts[chanpos]->logicalspan,
+ pri->pvts[chanpos]->prioffset, e->hangup.cause);
if (e->hangup.aoc_units > -1)
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Channel %d/%d, span %d received AOC-E charging %d unit%s\n",
@@ -10843,13 +10904,18 @@
pri_hangup(pri->pri, pri->pvts[chanpos]->call, e->hangup.cause);
pri->pvts[chanpos]->call = NULL;
}
- if (e->hangup.cause == PRI_CAUSE_REQUESTED_CHAN_UNAVAIL) {
+#if defined(FORCE_RESTART_UNAVAIL_CHANS)
+ if (e->hangup.cause == PRI_CAUSE_REQUESTED_CHAN_UNAVAIL
+ && !pri->resetting && !pri->pvts[chanpos]->resetting) {
if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Forcing restart of channel %d/%d span %d since channel reported in use\n",
- PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span);
+ ast_verbose(VERBOSE_PREFIX_3
+ "Span %d: Forcing restart of channel %d/%d since channel reported in use\n",
+ pri->span, pri->pvts[chanpos]->logicalspan,
+ pri->pvts[chanpos]->prioffset);
+ pri->pvts[chanpos]->resetting = 1;
pri_reset(pri->pri, PVT_TO_CHANNEL(pri->pvts[chanpos]));
- pri->pvts[chanpos]->resetting = 1;
- }
+ }
+#endif /* defined(FORCE_RESTART_UNAVAIL_CHANS) */
#ifdef SUPPORT_USERUSER
if (!ast_strlen_zero(e->hangup.useruserinfo)) {
@@ -10869,12 +10935,12 @@
}
ast_mutex_lock(&pri->pvts[chanpos]->lock);
pri->pvts[chanpos]->call = NULL;
- pri->pvts[chanpos]->resetting = 0;
if (pri->pvts[chanpos]->owner) {
if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "Channel %d/%d, span %d got hangup ACK\n", PRI_SPAN(e->hangup.channel), PRI_CHANNEL(e->hangup.channel), pri->span);
- }
-
+ ast_verbose(VERBOSE_PREFIX_3 "Span %d: Channel %d/%d got hangup ACK\n",
+ pri->span, pri->pvts[chanpos]->logicalspan,
+ pri->pvts[chanpos]->prioffset);
+ }
#ifdef SUPPORT_USERUSER
if (!ast_strlen_zero(e->hangup.useruserinfo)) {
struct ast_channel *owner = pri->pvts[chanpos]->owner;
@@ -10899,19 +10965,25 @@
if (pri->pvts[x] && pri->pvts[x]->resetting) {
chanpos = x;
ast_mutex_lock(&pri->pvts[chanpos]->lock);
- ast_log(LOG_DEBUG, "Assuming restart ack is really for channel %d/%d span %d\n", pri->pvts[chanpos]->logicalspan,
- pri->pvts[chanpos]->prioffset, pri->span);
- if (pri->pvts[chanpos]->realcall)
+ ast_log(LOG_DEBUG,
+ "Span %d: Assuming restart ack is for channel %d/%d\n",
+ pri->span, pri->pvts[chanpos]->logicalspan,
+ pri->pvts[chanpos]->prioffset);
+ if (pri->pvts[chanpos]->realcall)
pri_hangup_all(pri->pvts[chanpos]->realcall, pri);
else if (pri->pvts[chanpos]->owner) {
- ast_log(LOG_WARNING, "Got restart ack on channel %d/%d with owner on span %d\n", pri->pvts[chanpos]->logicalspan,
- pri->pvts[chanpos]->prioffset, pri->span);
+ ast_log(LOG_WARNING,
+ "Span %d: Got restart ack on channel %d/%d with owner\n",
+ pri->span, pri->pvts[chanpos]->logicalspan,
+ pri->pvts[chanpos]->prioffset);
pri->pvts[chanpos]->owner->_softhangup |= AST_SOFTHANGUP_DEV;
}
pri->pvts[chanpos]->resetting = 0;
if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "B-channel %d/%d successfully restarted on span %d\n", pri->pvts[chanpos]->logicalspan,
- pri->pvts[chanpos]->prioffset, pri->span);
+ ast_verbose(VERBOSE_PREFIX_3
+ "Span %d: Channel %d/%d successfully restarted\n",
+ pri->span, pri->pvts[chanpos]->logicalspan,
+ pri->pvts[chanpos]->prioffset);
ast_mutex_unlock(&pri->pvts[chanpos]->lock);
if (pri->resetting)
pri_check_restart(pri);
@@ -10919,8 +10991,10 @@
}
}
if (chanpos < 0) {
- ast_log(LOG_WARNING, "Restart ACK requested on strange channel %d/%d span %d\n",
- PRI_SPAN(e->restartack.channel), PRI_CHANNEL(e->restartack.channel), pri->span);
+ ast_log(LOG_WARNING,
+ "Span %d: Restart ACK on strange channel %d/%d\n",
+ pri->span, PRI_SPAN(e->restartack.channel),
+ PRI_CHANNEL(e->restartack.channel));
}
} else {
if (pri->pvts[chanpos]) {
@@ -10928,14 +11002,18 @@
if (pri->pvts[chanpos]->realcall)
pri_hangup_all(pri->pvts[chanpos]->realcall, pri);
else if (pri->pvts[chanpos]->owner) {
- ast_log(LOG_WARNING, "Got restart ack on channel %d/%d span %d with owner\n",
- PRI_SPAN(e->restartack.channel), PRI_CHANNEL(e->restartack.channel), pri->span);
+ ast_log(LOG_WARNING,
+ "Span %d: Got restart ack on channel %d/%d with owner\n",
+ pri->span, pri->pvts[chanpos]->logicalspan,
+ pri->pvts[chanpos]->prioffset);
pri->pvts[chanpos]->owner->_softhangup |= AST_SOFTHANGUP_DEV;
}
pri->pvts[chanpos]->resetting = 0;
if (option_verbose > 2)
- ast_verbose(VERBOSE_PREFIX_3 "B-channel %d/%d successfully restarted on span %d\n", pri->pvts[chanpos]->logicalspan,
- pri->pvts[chanpos]->prioffset, pri->span);
+ ast_verbose(VERBOSE_PREFIX_3
+ "Span %d: Channel %d/%d successfully restarted\n",
+ pri->span, pri->pvts[chanpos]->logicalspan,
+ pri->pvts[chanpos]->prioffset);
ast_mutex_unlock(&pri->pvts[chanpos]->lock);
if (pri->resetting)
pri_check_restart(pri);
@@ -11738,13 +11816,15 @@
ast_cli(fd, "Call ");
if (tmp->bearer)
ast_cli(fd, "Bearer ");
+ if (tmp->allocated) {
+ ast_cli(fd, "Allocated ");
+ }
ast_cli(fd, "\n");
if (tmp->logicalspan)
ast_cli(fd, "PRI Logical Span: %d\n", tmp->logicalspan);
else
ast_cli(fd, "PRI Logical Span: Implicit\n");
}
-
#endif
memset(&ci, 0, sizeof(ci));
ps.channo = tmp->channel;
More information about the asterisk-commits
mailing list