[asterisk-commits] rmudgett: branch 1.8 r313780 - /branches/1.8/channels/chan_dahdi.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Apr 14 16:00:00 CDT 2011
Author: rmudgett
Date: Thu Apr 14 15:59:56 2011
New Revision: 313780
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=313780
Log:
Leftover debug messages unconditionally sent to the console.
Executing Dial(DAHDI/1/18475551212,300,) with the echotraining config
option enabled outputs the following debug messages unconditionally:
Dialing T1847555121 on 1
Dialing www2w on 1
* Made debug messages in my_dial_digits() normal debug messages that do
not get output unless enabled.
* Reworded some debug messages in my_dial_digits() to be clearer.
* Replace strncpy() with ast_copy_string() in my_dial_digits() which does
the same job better.
(closes issue #18847)
Reported by: vmikhelson
Tested by: rmudgett
Modified:
branches/1.8/channels/chan_dahdi.c
Modified: branches/1.8/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/channels/chan_dahdi.c?view=diff&rev=313780&r1=313779&r2=313780
==============================================================================
--- branches/1.8/channels/chan_dahdi.c (original)
+++ branches/1.8/channels/chan_dahdi.c Thu Apr 14 15:59:56 2011
@@ -2920,18 +2920,21 @@
return -1;
}
- if (sub != ANALOG_SUB_REAL)
- printf("Trying to dial digits on sub %d\n", sub);
+ if (sub != ANALOG_SUB_REAL) {
+ ast_log(LOG_ERROR, "Trying to dial_digits '%s' on channel %d subchannel %d\n",
+ dop->dialstr, p->channel, sub);
+ return -1;
+ }
ddop.op = DAHDI_DIAL_OP_REPLACE;
- strncpy(ddop.dialstr, dop->dialstr, sizeof(ddop.dialstr));
-
- printf("Dialing %s on %d\n", ddop.dialstr, p->channel);
+ ast_copy_string(ddop.dialstr, dop->dialstr, sizeof(ddop.dialstr));
+
+ ast_debug(1, "Channel %d: Sending '%s' to DAHDI_DIAL.\n", p->channel, ddop.dialstr);
res = ioctl(p->subs[index].dfd, DAHDI_DIAL, &ddop);
-
- if (res == -1)
- ast_log(LOG_DEBUG, "DAHDI_DIAL ioctl failed on %s: %s\n", p->owner->name, strerror(errno));
+ if (res == -1) {
+ ast_debug(1, "DAHDI_DIAL ioctl failed on %s: %s\n", p->owner->name, strerror(errno));
+ }
return res;
}
More information about the asterisk-commits
mailing list