aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorrmudgett <rmudgett@f38db490-d61c-443f-a65b-d21fe96a405b>2010-11-02 21:24:13 +0000
committerrmudgett <rmudgett@f38db490-d61c-443f-a65b-d21fe96a405b>2010-11-02 21:24:13 +0000
commit65c175ed2d571722b5e2d1c6b3ae97f255427d02 (patch)
treedab4e17c7d218c13426742a844ff944e2d1e4f36 /channels
parent403c9246061ff528f936f9331175423700105c03 (diff)
Make warning message have more useful information in it.
Change "Unable to get index, and nullok is not asserted" to "Unable to get index for '<channel-name>' on channel <number> (<function>(), line <number>)". git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@293639 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_dahdi.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index f293703fa..620e3c2ff 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -1106,7 +1106,8 @@ static int cidrings[NUM_CADENCE_MAX] = {
#define CANBUSYDETECT(p) (ISTRUNK(p) || (p->sig & (SIG_EM | SIG_EM_E1 | SIG_SF)) /* || (p->sig & __DAHDI_SIG_FXO) */)
#define CANPROGRESSDETECT(p) (ISTRUNK(p) || (p->sig & (SIG_EM | SIG_EM_E1 | SIG_SF)) /* || (p->sig & __DAHDI_SIG_FXO) */)
-static int dahdi_get_index(struct ast_channel *ast, struct dahdi_pvt *p, int nullok)
+#define dahdi_get_index(ast, p, nullok) _dahdi_get_index(ast, p, nullok, __PRETTY_FUNCTION__, __LINE__)
+static int _dahdi_get_index(struct ast_channel *ast, struct dahdi_pvt *p, int nullok, const char *fname, unsigned long line)
{
int res;
if (p->subs[SUB_REAL].owner == ast)
@@ -1118,7 +1119,9 @@ static int dahdi_get_index(struct ast_channel *ast, struct dahdi_pvt *p, int nul
else {
res = -1;
if (!nullok)
- ast_log(LOG_WARNING, "Unable to get index, and nullok is not asserted\n");
+ ast_log(LOG_WARNING,
+ "Unable to get index for '%s' on channel %d (%s(), line %lu)\n",
+ ast ? ast->name : "", p->channel, fname, line);
}
return res;
}