Made minor logging changes in smqueue to aid in debugging

This commit is contained in:
svangundy 2014-03-28 19:41:07 +01:00 committed by Michael Iedema
parent acaac051cb
commit c6c98fba0e
2 changed files with 11 additions and 7 deletions

View File

@ -251,6 +251,8 @@ shortcode_zap_queued (const char *imsi, const char *msgtext,
*
* This shortcode message can be processed several times, if we need
* to do retries because of locked files, for example.
*
* Will add number into the HLR with a plus at the beginning if it exists
*/
enum short_code_action
shortcode_register (const char *imsi, const char *msgtext,
@ -314,7 +316,7 @@ shortcode_register (const char *imsi, const char *msgtext,
}
}
}
LOG(DEBUG) << "Register IMSI:" << imsi << " phonenum:" << phonenum;
if (!badnum) {
existing = smq->my_hlr.getCLIDLocal(imsi);
@ -343,6 +345,7 @@ shortcode_register (const char *imsi, const char *msgtext,
LOG(DEBUG) << phonenum << " is not in the HLR";
// Neither the IMSI nor the phonenum is in use.
// Book 'em, danno!
did = smq->my_hlr.addUser(imsi, phonenum);
switch (did) {
case SubscriberRegistry::SUCCESS:

View File

@ -580,7 +580,7 @@ short_msg_pending::validate_short_msg(SMq *manager, bool should_early_check)
user = p->req_uri->username;
if (!user)
return 484;
if (!check_to_user(user))
if (!check_to_user(user)) // Check user does nothing
return 484;
// FIXME, URL versus To: might have different username
// requirements?
@ -2004,7 +2004,7 @@ SMq::lookup_uri_imsi (short_msg_pending *qmsg)
char *newdest = my_hlr.getIMSI(username);
if (!newdest) {
/* ==================FIXME KLUDGE====================
* Here is our fake table of IMSIs and phone numbers
` * Here is our fake table of IMSIs and phone numbers
* ==================FIXME KLUDGE==================== */
for (int i = 0; imsi_phone[i].phone[0]; i++) {
if (0 == strcmp(imsi_phone[i].phone, username)) {
@ -2026,7 +2026,7 @@ SMq::lookup_uri_imsi (short_msg_pending *qmsg)
if (!newdest) {
/* Didn't find it in HLR or fake table. Bitch. */
// We have to return an error to the originator.
LOG(NOTICE) << "Lookup phonenum '" << username << "' to IMSI failed.";
LOG(NOTICE) << "Lookup phonenum '" << username << "' to IMSI failed";
LOG(DEBUG) << "MSG = " << qmsg->text;
if (global_relay.c_str()[0] == '\0') {
@ -2387,7 +2387,7 @@ void SMq::main_loop(int msTMO)
smpl = new short_msg_p_list(1);
smp = &*smpl->begin(); // Here's our short_msg_pending!
smp->initialize (len, buffer, false);
smp->initialize (len, buffer, false); // Just makes a copy
smp->ms_to_sc = true;
//LOG(DEBUG) << "Before insert new message smpl size " << smpl->size();
@ -2405,13 +2405,14 @@ void SMq::main_loop(int msTMO)
<< smp->qtag << "' from "
<< smp->parsed->from->url->username
<< " for "
<< smp->parsed->req_uri->username
<< smp->parsed->req_uri->username // just shows smsc
<< ".";
} else {
LOG(INFO) << "Got SMS "
<< smp->parsed->status_code
<< " Response qtag '"
<< smp->qtag << "'.";
<< smp->qtag << " for "
<< smp->parsed->req_uri->username; // Name that was sent to smqueue
}
// **********************************************************************