aboutsummaryrefslogtreecommitdiffstats
path: root/res
diff options
context:
space:
mode:
authorpabelanger <pabelanger@f38db490-d61c-443f-a65b-d21fe96a405b>2011-02-04 16:55:39 +0000
committerpabelanger <pabelanger@f38db490-d61c-443f-a65b-d21fe96a405b>2011-02-04 16:55:39 +0000
commit6705f034061b134fc09b1e10f619eb3c6d98fa3f (patch)
treea3d1da6c10bc2730a0a579368a28f804a074c035 /res
parent71d8066a81fabc97d0f084b76a9e65059d0ac3d1 (diff)
Replace ast_log(LOG_DEBUG, ...) with ast_debug()
(closes issue #18556) Reported by: kkm Review: https://reviewboard.asterisk.org/r/1071/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@306258 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res')
-rw-r--r--res/ais/evt.c10
-rw-r--r--res/res_agi.c10
-rw-r--r--res/res_config_ldap.c23
-rw-r--r--res/res_http_post.c6
-rw-r--r--res/res_jabber.c8
-rw-r--r--res/res_musiconhold.c16
-rw-r--r--res/res_odbc.c6
-rw-r--r--res/res_rtp_asterisk.c18
-rw-r--r--res/res_smdi.c62
9 files changed, 78 insertions, 81 deletions
diff --git a/res/ais/evt.c b/res/ais/evt.c
index 9438d7740..88b8a6ffd 100644
--- a/res/ais/evt.c
+++ b/res/ais/evt.c
@@ -182,18 +182,18 @@ static void ast_event_cb(const struct ast_event *ast_event, void *data)
const char *filter_str;
SaEvtEventIdT event_id;
- ast_log(LOG_DEBUG, "Got an event to forward\n");
+ ast_debug(1, "Got an event to forward\n");
if (ast_eid_cmp(&ast_eid_default, ast_event_get_ie_raw(ast_event, AST_EVENT_IE_EID))) {
/* If the event didn't originate from this server, don't send it back out. */
- ast_log(LOG_DEBUG, "Returning here\n");
+ ast_debug(1, "Returning here\n");
return;
}
ais_res = saEvtEventAllocate(event_channel->handle, &event_handle);
if (ais_res != SA_AIS_OK) {
ast_log(LOG_ERROR, "Error allocating event: %s\n", ais_err2str(ais_res));
- ast_log(LOG_DEBUG, "Returning here\n");
+ ast_debug(1, "Returning here\n");
return;
}
@@ -237,7 +237,7 @@ return_event_free:
if (ais_res != SA_AIS_OK) {
ast_log(LOG_ERROR, "Error freeing allocated event: %s\n", ais_err2str(ais_res));
}
- ast_log(LOG_DEBUG, "Returning here (event_free)\n");
+ ast_debug(1, "Returning here (event_free)\n");
}
static char *ais_evt_show_event_channels(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
@@ -325,7 +325,7 @@ static void add_publish_event(struct event_channel *event_channel, const char *e
}
publish_event->type = type;
- ast_log(LOG_DEBUG, "Subscribing to event type %d\n", type);
+ ast_debug(1, "Subscribing to event type %d\n", type);
publish_event->sub = ast_event_subscribe(type, ast_event_cb, "AIS", event_channel,
AST_EVENT_IE_END);
ast_event_dump_cache(publish_event->sub);
diff --git a/res/res_agi.c b/res/res_agi.c
index 09cdc3966..0c25c99a2 100644
--- a/res/res_agi.c
+++ b/res/res_agi.c
@@ -1122,7 +1122,7 @@ static char *handle_cli_agi_add_cmd(struct ast_cli_entry *e, int cmd, struct ast
return CLI_FAILURE;
}
- ast_log(LOG_DEBUG, "Added AGI command to channel %s queue\n", chan->name);
+ ast_debug(1, "Added AGI command to channel %s queue\n", chan->name);
ast_channel_unlock(chan);
chan = ast_channel_unref(chan);
@@ -1259,7 +1259,7 @@ static enum agi_result launch_asyncagi(struct ast_channel *chan, char *argv[], i
while (1) {
/* bail out if we need to hangup */
if (ast_check_hangup(chan)) {
- ast_log(LOG_DEBUG, "ast_check_hangup returned true on chan %s\n", chan->name);
+ ast_debug(1, "ast_check_hangup returned true on chan %s\n", chan->name);
break;
}
/* retrieve a command
@@ -1296,21 +1296,21 @@ static enum agi_result launch_asyncagi(struct ast_channel *chan, char *argv[], i
/* no command so far, wait a bit for a frame to read */
res = ast_waitfor(chan, timeout);
if (res < 0) {
- ast_log(LOG_DEBUG, "ast_waitfor returned <= 0 on chan %s\n", chan->name);
+ ast_debug(1, "ast_waitfor returned <= 0 on chan %s\n", chan->name);
break;
}
if (res == 0)
continue;
f = ast_read(chan);
if (!f) {
- ast_log(LOG_DEBUG, "No frame read on channel %s, going out ...\n", chan->name);
+ ast_debug(1, "No frame read on channel %s, going out ...\n", chan->name);
returnstatus = AGI_RESULT_HANGUP;
break;
}
/* is there any other frame we should care about
besides AST_CONTROL_HANGUP? */
if (f->frametype == AST_FRAME_CONTROL && f->subclass.integer == AST_CONTROL_HANGUP) {
- ast_log(LOG_DEBUG, "Got HANGUP frame on channel %s, going out ...\n", chan->name);
+ ast_debug(1, "Got HANGUP frame on channel %s, going out ...\n", chan->name);
ast_frfree(f);
break;
}
diff --git a/res/res_config_ldap.c b/res/res_config_ldap.c
index 19075833b..adfdacb28 100644
--- a/res/res_config_ldap.c
+++ b/res/res_config_ldap.c
@@ -159,7 +159,7 @@ static int semicolon_count_str(const char *somestr)
}
return count;
-}
+}
/* takes a linked list of \a ast_variable variables, finds the one with the name variable_value
* and returns the number of semicolons in the value for that \a ast_variable
@@ -399,19 +399,18 @@ static struct ast_variable **realtime_ldap_result_to_vars(struct ldap_table_conf
i = 0;
/* For each static realtime variable we may create several entries in the \a vars array if it's delimited */
- for (entry_index = 0; ldap_entry; ) {
+ for (entry_index = 0; ldap_entry; ) {
int pos = 0;
delim_value = NULL;
delim_tot_count = 0;
delim_count = 0;
-
+
do { /* while delim_count */
/* Starting new static var */
char *ldap_attribute_name = ldap_first_attribute(ldapConn, ldap_entry, &ber);
struct berval *value;
while (ldap_attribute_name) {
-
const char *attribute_name = convert_attribute_name_from_ldap(table_config, ldap_attribute_name);
int is_realmed_password_attribute = strcasecmp(attribute_name, "md5secret") == 0;
struct berval **values = NULL;
@@ -431,7 +430,7 @@ static struct ast_variable **realtime_ldap_result_to_vars(struct ldap_table_conf
ast_debug(2, "md5: %s\n", valptr);
}
if (valptr) {
- if (delim_value == NULL && !is_realmed_password_attribute
+ if (delim_value == NULL && !is_realmed_password_attribute
&& (static_table_config != table_config || strcmp(attribute_name, "variable_value") == 0)) {
delim_value = ast_strdup(valptr);
@@ -442,7 +441,7 @@ static struct ast_variable **realtime_ldap_result_to_vars(struct ldap_table_conf
}
}
- if (is_delimited != 0 && !is_realmed_password_attribute
+ if (is_delimited != 0 && !is_realmed_password_attribute
&& (static_table_config != table_config || strcmp(attribute_name, "variable_value") == 0) ) {
/* for non-Static RealTime, first */
@@ -452,7 +451,7 @@ static struct ast_variable **realtime_ldap_result_to_vars(struct ldap_table_conf
delim_value[i] = '\0';
ast_debug(2, "LINE(%d) DELIM - attribute_name: %s value: %s pos: %d\n", __LINE__, attribute_name, &delim_value[pos], pos);
-
+
if (prev) {
prev->next = ast_variable_new(attribute_name, &delim_value[pos], table_config->table_name);
if (prev->next) {
@@ -486,7 +485,7 @@ static struct ast_variable **realtime_ldap_result_to_vars(struct ldap_table_conf
}
free(delim_value);
delim_value = NULL;
-
+
ast_debug(4, "LINE(%d) DELIM pos: %d i: %d\n", __LINE__, pos, i);
} else {
/* not delimited */
@@ -530,7 +529,7 @@ static struct ast_variable **realtime_ldap_result_to_vars(struct ldap_table_conf
if (static_table_config != table_config) {
ast_debug(3, "LINE(%d) Added to vars - non static\n", __LINE__);
-
+
vars[entry_index++] = var;
prev = NULL;
}
@@ -805,7 +804,7 @@ static struct ast_variable **realtime_ldap_base_ap(unsigned int *entries_count_p
LDAP_SCOPE_SUBTREE, ast_str_buffer(filter), NULL, 0, NULL, NULL, NULL, LDAP_NO_LIMIT,
&ldap_result_msg);
if (result != LDAP_SUCCESS && is_ldap_connect_error(result)) {
- ast_log(LOG_DEBUG, "Failed to query directory. Try %d/10\n", tries + 1);
+ ast_debug(1, "Failed to query directory. Try %d/10\n", tries + 1);
if (++tries < 10) {
usleep(1);
if (ldapConn) {
@@ -1084,7 +1083,7 @@ static struct ast_config *config_ldap(const char *basedn, const char *table_name
struct ast_variable *var_val = variable_named(*p, "variable_value");
struct ast_variable *var_metric = variable_named(*p, "var_metric");
struct ast_variable *dn = variable_named(*p, "dn");
-
+
ast_debug(3, "category: %s\n", category->value);
ast_debug(3, "var_name: %s\n", var_name->value);
ast_debug(3, "var_val: %s\n", var_val->value);
@@ -1503,7 +1502,7 @@ static int update2_ldap(const char *basedn, const char *table_name, va_list ap)
ldap_entry = ldap_first_entry(ldapConn, ldap_result_msg);
- for (i = 0; ldap_entry; i++) {
+ for (i = 0; ldap_entry; i++) {
dn = ldap_get_dn(ldapConn, ldap_entry);
if ((error = ldap_modify_ext_s(ldapConn, dn, ldap_mods, NULL, NULL)) != LDAP_SUCCESS) {
ast_log(LOG_ERROR, "Couldn't modify dn:%s because %s", dn, ldap_err2string(error));
diff --git a/res/res_http_post.c b/res/res_http_post.c
index 5fff5d8ba..e2d93d340 100644
--- a/res/res_http_post.c
+++ b/res/res_http_post.c
@@ -123,7 +123,7 @@ static void process_message_callback(GMimeObject *part, gpointer user_data)
return;
} else if (GMIME_IS_MULTIPART(part)) {
GList *l;
-
+
ast_log(LOG_WARNING, "Got unexpected GMIME_IS_MULTIPART, trying to process subparts\n");
l = GMIME_MULTIPART(part)->subparts;
while (l) {
@@ -365,9 +365,7 @@ static int http_post_callback(struct ast_tcptls_session_instance *ser, const str
fprintf(f, "\r\n");
if (0 > readmimefile(ser->f, f, boundary_marker, content_len)) {
- if (option_debug) {
- ast_log(LOG_DEBUG, "Cannot find boundary marker in POST request.\n");
- }
+ ast_debug(1, "Cannot find boundary marker in POST request.\n");
fclose(f);
return -1;
diff --git a/res/res_jabber.c b/res/res_jabber.c
index a05e78f23..75ea729d1 100644
--- a/res/res_jabber.c
+++ b/res/res_jabber.c
@@ -3158,7 +3158,7 @@ static void aji_mwi_cb(const struct ast_event *ast_event, void *data)
if (ast_eid_cmp(&ast_eid_default, ast_event_get_ie_raw(ast_event, AST_EVENT_IE_EID)))
{
/* If the event didn't originate from this server, don't send it back out. */
- ast_log(LOG_DEBUG, "Returning here\n");
+ ast_debug(1, "Returning here\n");
return;
}
@@ -3186,7 +3186,7 @@ static void aji_devstate_cb(const struct ast_event *ast_event, void *data)
if (ast_eid_cmp(&ast_eid_default, ast_event_get_ie_raw(ast_event, AST_EVENT_IE_EID)))
{
/* If the event didn't originate from this server, don't send it back out. */
- ast_log(LOG_DEBUG, "Returning here\n");
+ ast_debug(1, "Returning here\n");
return;
}
@@ -3246,7 +3246,7 @@ static int aji_handle_pubsub_event(void *data, ikspak *pak)
item_content = iks_child(item);
ast_str_to_eid(&pubsub_eid, iks_find_attrib(item_content, "eid"));
if (!ast_eid_cmp(&ast_eid_default, &pubsub_eid)) {
- ast_log(LOG_DEBUG, "Returning here, eid of incoming event matches ours!\n");
+ ast_debug(1, "Returning here, eid of incoming event matches ours!\n");
return IKS_FILTER_EAT;
}
if (!strcasecmp(iks_name(item_content), "state")) {
@@ -3271,7 +3271,7 @@ static int aji_handle_pubsub_event(void *data, ikspak *pak)
return IKS_FILTER_EAT;
}
} else {
- ast_log(LOG_DEBUG, "Don't know how to handle PubSub event of type %s\n",
+ ast_debug(1, "Don't know how to handle PubSub event of type %s\n",
iks_name(item_content));
return IKS_FILTER_EAT;
}
diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c
index 1d7aeadb5..f5bc2ab35 100644
--- a/res/res_musiconhold.c
+++ b/res/res_musiconhold.c
@@ -343,10 +343,10 @@ static int ast_moh_files_next(struct ast_channel *chan)
return 0;
}
-static struct ast_frame *moh_files_readframe(struct ast_channel *chan)
+static struct ast_frame *moh_files_readframe(struct ast_channel *chan)
{
struct ast_frame *f = NULL;
-
+
if (!(chan->stream && (f = ast_readframe(chan->stream)))) {
if (!ast_moh_files_next(chan))
f = ast_readframe(chan->stream);
@@ -842,7 +842,7 @@ static struct mohclass *_get_mohbyname(const char *name, int warn, int flags, co
#endif
if (!moh && warn) {
- ast_log(LOG_DEBUG, "Music on Hold class '%s' not found in memory\n", name);
+ ast_debug(1, "Music on Hold class '%s' not found in memory\n", name);
}
return moh;
@@ -851,11 +851,11 @@ static struct mohclass *_get_mohbyname(const char *name, int warn, int flags, co
static struct mohdata *mohalloc(struct mohclass *cl)
{
struct mohdata *moh;
- long flags;
-
+ long flags;
+
if (!(moh = ast_calloc(1, sizeof(*moh))))
return NULL;
-
+
if (pipe(moh->pipe)) {
ast_log(LOG_WARNING, "Failed to create pipe: %s\n", strerror(errno));
ast_free(moh);
@@ -1537,7 +1537,7 @@ static void moh_class_destructor(void *obj)
char buff[8192];
int bytes, tbytes = 0, stime = 0, pid = 0;
- ast_log(LOG_DEBUG, "killing %d!\n", class->pid);
+ ast_debug(1, "killing %d!\n", class->pid);
stime = time(NULL) + 2;
pid = class->pid;
@@ -1571,7 +1571,7 @@ static void moh_class_destructor(void *obj)
tbytes = tbytes + bytes;
}
- ast_log(LOG_DEBUG, "mpg123 pid %d and child died after %d bytes read\n", pid, tbytes);
+ ast_debug(1, "mpg123 pid %d and child died after %d bytes read\n", pid, tbytes);
close(class->srcfd);
}
diff --git a/res/res_odbc.c b/res/res_odbc.c
index 67ba3111d..84d7284bb 100644
--- a/res/res_odbc.c
+++ b/res/res_odbc.c
@@ -1435,15 +1435,15 @@ static odbc_status odbc_obj_disconnect(struct odbc_obj *obj)
if (obj->parent) {
if (res == SQL_SUCCESS || res == SQL_SUCCESS_WITH_INFO) {
- ast_log(LOG_DEBUG, "Disconnected %d from %s [%s]\n", res, obj->parent->name, obj->parent->dsn);
+ ast_debug(1, "Disconnected %d from %s [%s]\n", res, obj->parent->name, obj->parent->dsn);
} else {
- ast_log(LOG_DEBUG, "res_odbc: %s [%s] already disconnected\n", obj->parent->name, obj->parent->dsn);
+ ast_debug(1, "res_odbc: %s [%s] already disconnected\n", obj->parent->name, obj->parent->dsn);
}
}
if ((res = SQLFreeHandle(SQL_HANDLE_DBC, obj->con) == SQL_SUCCESS)) {
obj->con = NULL;
- ast_log(LOG_DEBUG, "Database handle deallocated\n");
+ ast_debug(1, "Database handle deallocated\n");
} else {
SQLGetDiagRec(SQL_HANDLE_DBC, obj->con, 1, state, &err, msg, 100, &mlen);
ast_log(LOG_WARNING, "Unable to deallocate database handle? %d errno=%d %s\n", res, (int)err, msg);
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index f91cdb117..0082fda96 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -1127,7 +1127,7 @@ static int ast_rtp_raw_write(struct ast_rtp_instance *instance, struct ast_frame
strerror(errno));
} else if (((ast_test_flag(rtp, FLAG_NAT_ACTIVE) == FLAG_NAT_INACTIVE) || rtpdebug) && !ast_test_flag(rtp, FLAG_NAT_INACTIVE_NOWARN)) {
/* Only give this error message once if we are not RTP debugging */
- if (option_debug || rtpdebug)
+ if (rtpdebug)
ast_debug(0, "RTP NAT: Can't write RTP to private address %s, waiting for other end to send audio...\n",
ast_sockaddr_stringify(&remote_address));
ast_set_flag(rtp, FLAG_NAT_INACTIVE_NOWARN);
@@ -1417,7 +1417,7 @@ static void process_dtmf_rfc2833(struct ast_rtp_instance *instance, unsigned cha
}
/* Print out debug if turned on */
- if (rtpdebug || option_debug > 2)
+ if (rtpdebug)
ast_debug(0, "- RTP 2833 Event: %08x (len = %d)\n", event, len);
/* Figure out what digit was pressed */
@@ -1433,7 +1433,7 @@ static void process_dtmf_rfc2833(struct ast_rtp_instance *instance, unsigned cha
resp = 'X';
} else {
/* Not a supported event */
- ast_log(LOG_DEBUG, "Ignoring RTP 2833 Event: %08x. Not a DTMF Digit.\n", event);
+ ast_debug(1, "Ignoring RTP 2833 Event: %08x. Not a DTMF Digit.\n", event);
return;
}
@@ -1563,7 +1563,7 @@ static struct ast_frame *process_dtmf_cisco(struct ast_rtp_instance *instance, u
power = data[2];
event = data[3] & 0x1f;
- if (option_debug > 2 || rtpdebug)
+ if (rtpdebug)
ast_debug(0, "Cisco DTMF Digit: %02x (len=%d, seq=%d, flags=%02x, power=%d, history count=%d)\n", event, len, seq, flags, power, (len - 4) / 2);
if (event < 10) {
resp = '0' + event;
@@ -1663,7 +1663,7 @@ static struct ast_frame *ast_rtcp_read(struct ast_rtp_instance *instance)
/* Send to whoever sent to us */
if (ast_sockaddr_cmp(&rtp->rtcp->them, &addr)) {
ast_sockaddr_copy(&rtp->rtcp->them, &addr);
- if (option_debug || rtpdebug)
+ if (rtpdebug)
ast_debug(0, "RTCP NAT: Got RTCP from other end. Now sending to address %s\n",
ast_sockaddr_stringify(&rtp->rtcp->them));
}
@@ -1685,8 +1685,8 @@ static struct ast_frame *ast_rtcp_read(struct ast_rtp_instance *instance)
length &= 0xffff;
if ((i + length) > packetwords) {
- if (option_debug || rtpdebug)
- ast_log(LOG_DEBUG, "RTCP Read too short\n");
+ if (rtpdebug)
+ ast_debug(1, "RTCP Read too short\n");
return &ast_null_frame;
}
@@ -2068,7 +2068,7 @@ static struct ast_frame *ast_rtp_read(struct ast_rtp_instance *instance, int rtc
}
rtp->rxseqno = 0;
ast_set_flag(rtp, FLAG_NAT_ACTIVE);
- if (option_debug || rtpdebug)
+ if (rtpdebug)
ast_debug(0, "RTP NAT: Got audio from other end. Now sending to address %s\n",
ast_sockaddr_stringify(&remote_address));
}
@@ -2103,7 +2103,7 @@ static struct ast_frame *ast_rtp_read(struct ast_rtp_instance *instance, int rtc
};
if (!mark) {
- if (option_debug || rtpdebug) {
+ if (rtpdebug) {
ast_debug(1, "Forcing Marker bit, because SSRC has changed\n");
}
mark = 1;
diff --git a/res/res_smdi.c b/res/res_smdi.c
index 19b049f17..3c1ce4c97 100644
--- a/res/res_smdi.c
+++ b/res/res_smdi.c
@@ -289,16 +289,16 @@ static int smdi_toggle_mwi(struct ast_smdi_interface *iface, const char *mailbox
{
FILE *file;
int i;
-
+
if (!(file = fopen(iface->name, "w"))) {
ast_log(LOG_ERROR, "Error opening SMDI interface %s (%s) for writing\n", iface->name, strerror(errno));
return 1;
- }
-
+ }
+
ASTOBJ_WRLOCK(iface);
-
+
fprintf(file, "%s:MWI ", on ? "OP" : "RMV");
-
+
for (i = 0; i < iface->msdstrip; i++)
fprintf(file, "0");
@@ -643,71 +643,71 @@ static void *smdi_read(void *iface_p)
char *cp = NULL;
int i;
int start = 0;
-
+
/* read an smdi message */
while ((c = fgetc(iface->file))) {
/* check if this is the start of a message */
if (!start) {
if (c == 'M') {
- ast_log(LOG_DEBUG, "Read an 'M' to start an SMDI message\n");
+ ast_debug(1, "Read an 'M' to start an SMDI message\n");
start = 1;
}
continue;
}
-
+
if (c == 'D') { /* MD message */
start = 0;
- ast_log(LOG_DEBUG, "Read a 'D' ... it's an MD message.\n");
+ ast_debug(1, "Read a 'D' ... it's an MD message.\n");
if (!(md_msg = ast_calloc(1, sizeof(*md_msg)))) {
ASTOBJ_UNREF(iface, ast_smdi_interface_destroy);
return NULL;
}
-
+
ASTOBJ_INIT(md_msg);
/* read the message desk number */
for (i = 0; i < sizeof(md_msg->mesg_desk_num) - 1; i++) {
md_msg->mesg_desk_num[i] = fgetc(iface->file);
- ast_log(LOG_DEBUG, "Read a '%c'\n", md_msg->mesg_desk_num[i]);
+ ast_debug(1, "Read a '%c'\n", md_msg->mesg_desk_num[i]);
}
md_msg->mesg_desk_num[sizeof(md_msg->mesg_desk_num) - 1] = '\0';
-
- ast_log(LOG_DEBUG, "The message desk number is '%s'\n", md_msg->mesg_desk_num);
+
+ ast_debug(1, "The message desk number is '%s'\n", md_msg->mesg_desk_num);
/* read the message desk terminal number */
for (i = 0; i < sizeof(md_msg->mesg_desk_term) - 1; i++) {
md_msg->mesg_desk_term[i] = fgetc(iface->file);
- ast_log(LOG_DEBUG, "Read a '%c'\n", md_msg->mesg_desk_term[i]);
+ ast_debug(1, "Read a '%c'\n", md_msg->mesg_desk_term[i]);
}
md_msg->mesg_desk_term[sizeof(md_msg->mesg_desk_term) - 1] = '\0';
- ast_log(LOG_DEBUG, "The message desk terminal is '%s'\n", md_msg->mesg_desk_term);
+ ast_debug(1, "The message desk terminal is '%s'\n", md_msg->mesg_desk_term);
/* read the message type */
md_msg->type = fgetc(iface->file);
-
- ast_log(LOG_DEBUG, "Message type is '%c'\n", md_msg->type);
+
+ ast_debug(1, "Message type is '%c'\n", md_msg->type);
/* read the forwarding station number (may be blank) */
cp = &md_msg->fwd_st[0];
for (i = 0; i < sizeof(md_msg->fwd_st) - 1; i++) {
if ((c = fgetc(iface->file)) == ' ') {
*cp = '\0';
- ast_log(LOG_DEBUG, "Read a space, done looking for the forwarding station\n");
+ ast_debug(1, "Read a space, done looking for the forwarding station\n");
break;
}
/* store c in md_msg->fwd_st */
if (i >= iface->msdstrip) {
- ast_log(LOG_DEBUG, "Read a '%c' and stored it in the forwarding station buffer\n", c);
+ ast_debug(1, "Read a '%c' and stored it in the forwarding station buffer\n", c);
*cp++ = c;
} else {
- ast_log(LOG_DEBUG, "Read a '%c', but didn't store it in the fwd station buffer, because of the msdstrip setting (%d < %d)\n", c, i, iface->msdstrip);
+ ast_debug(1, "Read a '%c', but didn't store it in the fwd station buffer, because of the msdstrip setting (%d < %d)\n", c, i, iface->msdstrip);
}
}
@@ -715,7 +715,7 @@ static void *smdi_read(void *iface_p)
md_msg->fwd_st[sizeof(md_msg->fwd_st) - 1] = '\0';
cp = NULL;
- ast_log(LOG_DEBUG, "The forwarding station is '%s'\n", md_msg->fwd_st);
+ ast_debug(1, "The forwarding station is '%s'\n", md_msg->fwd_st);
/* Put the fwd_st in the name field so that we can use ASTOBJ_FIND to look
* up a message on this field */
@@ -726,7 +726,7 @@ static void *smdi_read(void *iface_p)
for (i = 0; i < sizeof(md_msg->calling_st) - 1; i++) {
if (!isdigit((c = fgetc(iface->file)))) {
*cp = '\0';
- ast_log(LOG_DEBUG, "Read a '%c', but didn't store it in the calling station buffer because it's not a digit\n", c);
+ ast_debug(1, "Read a '%c', but didn't store it in the calling station buffer because it's not a digit\n", c);
if (c == ' ') {
/* Don't break on a space. We may read the space before the calling station
* here if the forwarding station buffer filled up. */
@@ -738,10 +738,10 @@ static void *smdi_read(void *iface_p)
/* store c in md_msg->calling_st */
if (i >= iface->msdstrip) {
- ast_log(LOG_DEBUG, "Read a '%c' and stored it in the calling station buffer\n", c);
+ ast_debug(1, "Read a '%c' and stored it in the calling station buffer\n", c);
*cp++ = c;
} else {
- ast_log(LOG_DEBUG, "Read a '%c', but didn't store it in the calling station buffer, because of the msdstrip setting (%d < %d)\n", c, i, iface->msdstrip);
+ ast_debug(1, "Read a '%c', but didn't store it in the calling station buffer, because of the msdstrip setting (%d < %d)\n", c, i, iface->msdstrip);
}
}
@@ -749,19 +749,19 @@ static void *smdi_read(void *iface_p)
md_msg->calling_st[sizeof(md_msg->calling_st) - 1] = '\0';
cp = NULL;
- ast_log(LOG_DEBUG, "The calling station is '%s'\n", md_msg->calling_st);
+ ast_debug(1, "The calling station is '%s'\n", md_msg->calling_st);
/* add the message to the message queue */
md_msg->timestamp = ast_tvnow();
ast_smdi_md_message_push(iface, md_msg);
- ast_log(LOG_DEBUG, "Received SMDI MD message on %s\n", iface->name);
-
+ ast_debug(1, "Received SMDI MD message on %s\n", iface->name);
+
ASTOBJ_UNREF(md_msg, ast_smdi_md_message_destroy);
} else if (c == 'W') { /* MWI message */
start = 0;
- ast_log(LOG_DEBUG, "Read a 'W', it's an MWI message. (No more debug coming for MWI messages)\n");
+ ast_debug(1, "Read a 'W', it's an MWI message. (No more debug coming for MWI messages)\n");
if (!(mwi_msg = ast_calloc(1, sizeof(*mwi_msg)))) {
ASTOBJ_UNREF(iface,ast_smdi_interface_destroy);
@@ -789,7 +789,7 @@ static void *smdi_read(void *iface_p)
/* make sure the station number is null terminated, even if this will truncate it */
mwi_msg->fwd_st[sizeof(mwi_msg->fwd_st) - 1] = '\0';
cp = NULL;
-
+
/* Put the fwd_st in the name field so that we can use ASTOBJ_FIND to look
* up a message on this field */
ast_copy_string(mwi_msg->name, mwi_msg->fwd_st, sizeof(mwi_msg->name));
@@ -803,8 +803,8 @@ static void *smdi_read(void *iface_p)
/* add the message to the message queue */
mwi_msg->timestamp = ast_tvnow();
ast_smdi_mwi_message_push(iface, mwi_msg);
- ast_log(LOG_DEBUG, "Received SMDI MWI message on %s\n", iface->name);
-
+ ast_debug(1, "Received SMDI MWI message on %s\n", iface->name);
+
ASTOBJ_UNREF(mwi_msg, ast_smdi_mwi_message_destroy);
} else {
ast_log(LOG_ERROR, "Unknown SMDI message type received on %s (M%c).\n", iface->name, c);