sms: Use the DLSMS instead of the DSMS category throughout our code

This commit is contained in:
Holger Hans Peter Freyther 2012-11-10 19:46:58 +01:00
parent 366c33185b
commit eff4094950
7 changed files with 61 additions and 74 deletions

View File

@ -16,7 +16,6 @@ enum {
DRSL, DRSL,
DNM, DNM,
DMNCC, DMNCC,
DSMS,
DPAG, DPAG,
DMEAS, DMEAS,
DSCCP, DSCCP,

View File

@ -235,12 +235,6 @@ static struct log_info_cat gprs_categories[] = {
.color = "\033[1;33m", .color = "\033[1;33m",
.enabled = 1, .loglevel = LOGL_NOTICE, .enabled = 1, .loglevel = LOGL_NOTICE,
}, },
[DSMS] = {
.name = "DSMS",
.description = "Layer3 Short Message Service (SMS)",
.color = "\033[1;37m",
.enabled = 1, .loglevel = LOGL_NOTICE,
},
[DPAG] = { [DPAG] = {
.name = "DPAG", .name = "DPAG",
.description = "Paging Subsystem", .description = "Paging Subsystem",

View File

@ -79,12 +79,6 @@ static const struct log_info_cat default_categories[] = {
.color = "\033[1;39m", .color = "\033[1;39m",
.enabled = 1, .loglevel = LOGL_NOTICE, .enabled = 1, .loglevel = LOGL_NOTICE,
}, },
[DSMS] = {
.name = "DSMS",
.description = "Layer3 Short Message Service (SMS)",
.color = "\033[1;37m",
.enabled = 1, .loglevel = LOGL_NOTICE,
},
[DPAG] = { [DPAG] = {
.name = "DPAG", .name = "DPAG",
.description = "Paging Subsystem", .description = "Paging Subsystem",

View File

@ -184,7 +184,7 @@ struct msgb *gsm411_msgb_alloc(void)
static int gsm411_sendmsg(struct gsm_subscriber_connection *conn, struct msgb *msg, uint8_t link_id) static int gsm411_sendmsg(struct gsm_subscriber_connection *conn, struct msgb *msg, uint8_t link_id)
{ {
DEBUGP(DSMS, "GSM4.11 TX %s\n", osmo_hexdump(msg->data, msg->len)); DEBUGP(DLSMS, "GSM4.11 TX %s\n", osmo_hexdump(msg->data, msg->len));
msg->l3h = msg->data; msg->l3h = msg->data;
return gsm0808_submit_dtap(conn, msg, link_id, 1); return gsm0808_submit_dtap(conn, msg, link_id, 1);
} }
@ -194,7 +194,7 @@ static void cp_timer_expired(void *data)
{ {
struct gsm_trans *trans = data; struct gsm_trans *trans = data;
DEBUGP(DSMS, "SMC Timer TC1* is expired, calling trans_free()\n"); DEBUGP(DLSMS, "SMC Timer TC1* is expired, calling trans_free()\n");
/* FIXME: we need to re-transmit the last CP-DATA 1..3 times */ /* FIXME: we need to re-transmit the last CP-DATA 1..3 times */
trans_free(trans); trans_free(trans);
} }
@ -220,17 +220,17 @@ static int gsm411_cp_sendmsg(struct msgb *msg, struct gsm_trans *trans,
trans->sms.cp_timer.cb = cp_timer_expired; trans->sms.cp_timer.cb = cp_timer_expired;
/* 5.3.2.1: Set Timer TC1A */ /* 5.3.2.1: Set Timer TC1A */
osmo_timer_schedule(&trans->sms.cp_timer, GSM411_TMR_TC1A); osmo_timer_schedule(&trans->sms.cp_timer, GSM411_TMR_TC1A);
DEBUGP(DSMS, "TX: CP-DATA "); DEBUGP(DLSMS, "TX: CP-DATA ");
break; break;
case GSM411_MT_CP_ACK: case GSM411_MT_CP_ACK:
DEBUGP(DSMS, "TX: CP-ACK "); DEBUGP(DLSMS, "TX: CP-ACK ");
break; break;
case GSM411_MT_CP_ERROR: case GSM411_MT_CP_ERROR:
DEBUGP(DSMS, "TX: CP-ERROR "); DEBUGP(DLSMS, "TX: CP-ERROR ");
break; break;
} }
DEBUGPC(DSMS, "trans=%x\n", trans->transaction_id); DEBUGPC(DLSMS, "trans=%x\n", trans->transaction_id);
return gsm411_sendmsg(trans->conn, msg, trans->sms.link_id); return gsm411_sendmsg(trans->conn, msg, trans->sms.link_id);
} }
@ -254,7 +254,7 @@ static int gsm411_rp_sendmsg(struct msgb *msg, struct gsm_trans *trans,
static int gsm340_rx_sms_submit(struct msgb *msg, struct gsm_sms *gsms) static int gsm340_rx_sms_submit(struct msgb *msg, struct gsm_sms *gsms)
{ {
if (db_sms_store(gsms) != 0) { if (db_sms_store(gsms) != 0) {
LOGP(DSMS, LOGL_ERROR, "Failed to store SMS in Database\n"); LOGP(DLSMS, LOGL_ERROR, "Failed to store SMS in Database\n");
return GSM411_RP_CAUSE_MO_NET_OUT_OF_ORDER; return GSM411_RP_CAUSE_MO_NET_OUT_OF_ORDER;
} }
/* dispatch a signal to tell higher level about it */ /* dispatch a signal to tell higher level about it */
@ -333,7 +333,7 @@ static int gsm340_gen_tpdu(struct msgb *msg, struct gsm_sms *sms)
memcpy(smsp, sms->user_data, sms->user_data_len); memcpy(smsp, sms->user_data, sms->user_data_len);
break; break;
default: default:
LOGP(DSMS, LOGL_NOTICE, "Unhandled Data Coding Scheme: 0x%02X\n", LOGP(DLSMS, LOGL_NOTICE, "Unhandled Data Coding Scheme: 0x%02X\n",
sms->data_coding_scheme); sms->data_coding_scheme);
break; break;
} }
@ -374,7 +374,7 @@ static int gsm340_rx_tpdu(struct gsm_subscriber_connection *conn, struct msgb *m
/* length in bytes of the destination address */ /* length in bytes of the destination address */
da_len_bytes = 2 + *smsp/2 + *smsp%2; da_len_bytes = 2 + *smsp/2 + *smsp%2;
if (da_len_bytes > 12) { if (da_len_bytes > 12) {
LOGP(DSMS, LOGL_ERROR, "Destination Address > 12 bytes ?!?\n"); LOGP(DLSMS, LOGL_ERROR, "Destination Address > 12 bytes ?!?\n");
rc = GSM411_RP_CAUSE_SEMANT_INC_MSG; rc = GSM411_RP_CAUSE_SEMANT_INC_MSG;
goto out; goto out;
} }
@ -411,7 +411,7 @@ static int gsm340_rx_tpdu(struct gsm_subscriber_connection *conn, struct msgb *m
sms_vp = 0; sms_vp = 0;
break; break;
default: default:
LOGP(DSMS, LOGL_NOTICE, LOGP(DLSMS, LOGL_NOTICE,
"SMS Validity period not implemented: 0x%02x\n", sms_vpf); "SMS Validity period not implemented: 0x%02x\n", sms_vpf);
return GSM411_RP_CAUSE_MO_NET_OUT_OF_ORDER; return GSM411_RP_CAUSE_MO_NET_OUT_OF_ORDER;
} }
@ -432,7 +432,7 @@ static int gsm340_rx_tpdu(struct gsm_subscriber_connection *conn, struct msgb *m
gsms->sender = subscr_get(conn->subscr); gsms->sender = subscr_get(conn->subscr);
LOGP(DSMS, LOGL_INFO, "RX SMS: Sender: %s, MTI: 0x%02x, VPF: 0x%02x, " LOGP(DLSMS, LOGL_INFO, "RX SMS: Sender: %s, MTI: 0x%02x, VPF: 0x%02x, "
"MR: 0x%02x PID: 0x%02x, DCS: 0x%02x, DA: %s, " "MR: 0x%02x PID: 0x%02x, DCS: 0x%02x, DA: %s, "
"UserDataLength: 0x%02x, UserData: \"%s\"\n", "UserDataLength: 0x%02x, UserData: \"%s\"\n",
subscr_name(gsms->sender), sms_mti, sms_vpf, gsms->msg_ref, subscr_name(gsms->sender), sms_mti, sms_vpf, gsms->msg_ref,
@ -461,11 +461,11 @@ static int gsm340_rx_tpdu(struct gsm_subscriber_connection *conn, struct msgb *m
break; break;
case GSM340_SMS_COMMAND_MS2SC: case GSM340_SMS_COMMAND_MS2SC:
case GSM340_SMS_DELIVER_REP_MS2SC: case GSM340_SMS_DELIVER_REP_MS2SC:
LOGP(DSMS, LOGL_NOTICE, "Unimplemented MTI 0x%02x\n", sms_mti); LOGP(DLSMS, LOGL_NOTICE, "Unimplemented MTI 0x%02x\n", sms_mti);
rc = GSM411_RP_CAUSE_IE_NOTEXIST; rc = GSM411_RP_CAUSE_IE_NOTEXIST;
break; break;
default: default:
LOGP(DSMS, LOGL_NOTICE, "Undefined MTI 0x%02x\n", sms_mti); LOGP(DLSMS, LOGL_NOTICE, "Undefined MTI 0x%02x\n", sms_mti);
rc = GSM411_RP_CAUSE_IE_NOTEXIST; rc = GSM411_RP_CAUSE_IE_NOTEXIST;
break; break;
} }
@ -483,7 +483,7 @@ static int gsm411_send_rp_ack(struct gsm_trans *trans, uint8_t msg_ref)
{ {
struct msgb *msg = gsm411_msgb_alloc(); struct msgb *msg = gsm411_msgb_alloc();
DEBUGP(DSMS, "TX: SMS RP ACK\n"); DEBUGP(DLSMS, "TX: SMS RP ACK\n");
return gsm411_rp_sendmsg(msg, trans, GSM411_MT_RP_ACK_MT, msg_ref); return gsm411_rp_sendmsg(msg, trans, GSM411_MT_RP_ACK_MT, msg_ref);
} }
@ -495,7 +495,7 @@ static int gsm411_send_rp_error(struct gsm_trans *trans,
msgb_tv_put(msg, 1, cause); msgb_tv_put(msg, 1, cause);
LOGP(DSMS, LOGL_NOTICE, "TX: SMS RP ERROR, cause %d (%s)\n", cause, LOGP(DLSMS, LOGL_NOTICE, "TX: SMS RP ERROR, cause %d (%s)\n", cause,
get_value_string(rp_cause_strs, cause)); get_value_string(rp_cause_strs, cause));
return gsm411_rp_sendmsg(msg, trans, GSM411_MT_RP_ERROR_MT, msg_ref); return gsm411_rp_sendmsg(msg, trans, GSM411_MT_RP_ERROR_MT, msg_ref);
@ -511,10 +511,10 @@ static int gsm411_rx_rp_ud(struct msgb *msg, struct gsm_trans *trans,
int rc = 0; int rc = 0;
if (src_len && src) if (src_len && src)
LOGP(DSMS, LOGL_ERROR, "RP-DATA (MO) with SRC ?!?\n"); LOGP(DLSMS, LOGL_ERROR, "RP-DATA (MO) with SRC ?!?\n");
if (!dst_len || !dst || !tpdu_len || !tpdu) { if (!dst_len || !dst || !tpdu_len || !tpdu) {
LOGP(DSMS, LOGL_ERROR, LOGP(DLSMS, LOGL_ERROR,
"RP-DATA (MO) without DST or TPDU ?!?\n"); "RP-DATA (MO) without DST or TPDU ?!?\n");
gsm411_send_rp_error(trans, rph->msg_ref, gsm411_send_rp_error(trans, rph->msg_ref,
GSM411_RP_CAUSE_INV_MAND_INF); GSM411_RP_CAUSE_INV_MAND_INF);
@ -522,7 +522,7 @@ static int gsm411_rx_rp_ud(struct msgb *msg, struct gsm_trans *trans,
} }
msg->l4h = tpdu; msg->l4h = tpdu;
DEBUGP(DSMS, "DST(%u,%s)\n", dst_len, osmo_hexdump(dst, dst_len)); DEBUGP(DLSMS, "DST(%u,%s)\n", dst_len, osmo_hexdump(dst, dst_len));
rc = gsm340_rx_tpdu(trans->conn, msg); rc = gsm340_rx_tpdu(trans->conn, msg);
if (rc == 0) if (rc == 0)
@ -553,7 +553,7 @@ static int gsm411_rx_rp_data(struct msgb *msg, struct gsm_trans *trans,
if (rpud_len) if (rpud_len)
rp_ud = &rph->data[1+src_len+1+dst_len+1]; rp_ud = &rph->data[1+src_len+1+dst_len+1];
DEBUGP(DSMS, "RX_RP-DATA: src_len=%u, dst_len=%u ud_len=%u\n", DEBUGP(DLSMS, "RX_RP-DATA: src_len=%u, dst_len=%u ud_len=%u\n",
src_len, dst_len, rpud_len); src_len, dst_len, rpud_len);
return gsm411_rx_rp_ud(msg, trans, rph, src_len, src, dst_len, dst, return gsm411_rx_rp_ud(msg, trans, rph, src_len, src, dst_len, dst,
rpud_len, rp_ud); rpud_len, rp_ud);
@ -570,13 +570,13 @@ static int gsm411_rx_rp_ack(struct msgb *msg, struct gsm_trans *trans,
* transmitted */ * transmitted */
if (!trans->sms.is_mt) { if (!trans->sms.is_mt) {
LOGP(DSMS, LOGL_ERROR, "RX RP-ACK on a MO transfer ?\n"); LOGP(DLSMS, LOGL_ERROR, "RX RP-ACK on a MO transfer ?\n");
return gsm411_send_rp_error(trans, rph->msg_ref, return gsm411_send_rp_error(trans, rph->msg_ref,
GSM411_RP_CAUSE_MSG_INCOMP_STATE); GSM411_RP_CAUSE_MSG_INCOMP_STATE);
} }
if (!sms) { if (!sms) {
LOGP(DSMS, LOGL_ERROR, "RX RP-ACK but no sms in transaction?!?\n"); LOGP(DLSMS, LOGL_ERROR, "RX RP-ACK but no sms in transaction?!?\n");
return gsm411_send_rp_error(trans, rph->msg_ref, return gsm411_send_rp_error(trans, rph->msg_ref,
GSM411_RP_CAUSE_PROTOCOL_ERR); GSM411_RP_CAUSE_PROTOCOL_ERR);
} }
@ -613,12 +613,12 @@ static int gsm411_rx_rp_error(struct msgb *msg, struct gsm_trans *trans,
* successfully receive the SMS. We need to investigate * successfully receive the SMS. We need to investigate
* the cause and take action depending on it */ * the cause and take action depending on it */
LOGP(DSMS, LOGL_NOTICE, "%s: RX SMS RP-ERROR, cause %d:%d (%s)\n", LOGP(DLSMS, LOGL_NOTICE, "%s: RX SMS RP-ERROR, cause %d:%d (%s)\n",
subscr_name(trans->conn->subscr), cause_len, cause, subscr_name(trans->conn->subscr), cause_len, cause,
get_value_string(rp_cause_strs, cause)); get_value_string(rp_cause_strs, cause));
if (!trans->sms.is_mt) { if (!trans->sms.is_mt) {
LOGP(DSMS, LOGL_ERROR, "RX RP-ERR on a MO transfer ?\n"); LOGP(DLSMS, LOGL_ERROR, "RX RP-ERR on a MO transfer ?\n");
#if 0 #if 0
return gsm411_send_rp_error(trans, rph->msg_ref, return gsm411_send_rp_error(trans, rph->msg_ref,
GSM411_RP_CAUSE_MSG_INCOMP_STATE); GSM411_RP_CAUSE_MSG_INCOMP_STATE);
@ -626,7 +626,7 @@ static int gsm411_rx_rp_error(struct msgb *msg, struct gsm_trans *trans,
} }
if (!sms) { if (!sms) {
LOGP(DSMS, LOGL_ERROR, LOGP(DLSMS, LOGL_ERROR,
"RX RP-ERR, but no sms in transaction?!?\n"); "RX RP-ERR, but no sms in transaction?!?\n");
return -EINVAL; return -EINVAL;
#if 0 #if 0
@ -685,17 +685,17 @@ static int gsm411_rx_cp_data(struct msgb *msg, struct gsm48_hdr *gh,
switch (msg_type) { switch (msg_type) {
case GSM411_MT_RP_DATA_MO: case GSM411_MT_RP_DATA_MO:
DEBUGP(DSMS, "RX SMS RP-DATA (MO)\n"); DEBUGP(DLSMS, "RX SMS RP-DATA (MO)\n");
/* start TR2N and enter 'wait to send RP-ACK state' */ /* start TR2N and enter 'wait to send RP-ACK state' */
trans->sms.rp_state = GSM411_RPS_WAIT_TO_TX_RP_ACK; trans->sms.rp_state = GSM411_RPS_WAIT_TO_TX_RP_ACK;
rc = gsm411_rx_rp_data(msg, trans, rp_data); rc = gsm411_rx_rp_data(msg, trans, rp_data);
break; break;
case GSM411_MT_RP_ACK_MO: case GSM411_MT_RP_ACK_MO:
DEBUGP(DSMS,"RX SMS RP-ACK (MO)\n"); DEBUGP(DLSMS,"RX SMS RP-ACK (MO)\n");
rc = gsm411_rx_rp_ack(msg, trans, rp_data); rc = gsm411_rx_rp_ack(msg, trans, rp_data);
break; break;
case GSM411_MT_RP_SMMA_MO: case GSM411_MT_RP_SMMA_MO:
DEBUGP(DSMS, "RX SMS RP-SMMA\n"); DEBUGP(DLSMS, "RX SMS RP-SMMA\n");
/* start TR2N and enter 'wait to send RP-ACK state' */ /* start TR2N and enter 'wait to send RP-ACK state' */
trans->sms.rp_state = GSM411_RPS_WAIT_TO_TX_RP_ACK; trans->sms.rp_state = GSM411_RPS_WAIT_TO_TX_RP_ACK;
rc = gsm411_rx_rp_smma(msg, trans, rp_data); rc = gsm411_rx_rp_smma(msg, trans, rp_data);
@ -704,7 +704,7 @@ static int gsm411_rx_cp_data(struct msgb *msg, struct gsm48_hdr *gh,
rc = gsm411_rx_rp_error(msg, trans, rp_data); rc = gsm411_rx_rp_error(msg, trans, rp_data);
break; break;
default: default:
LOGP(DSMS, LOGL_NOTICE, "Invalid RP type 0x%02x\n", msg_type); LOGP(DLSMS, LOGL_NOTICE, "Invalid RP type 0x%02x\n", msg_type);
rc = gsm411_send_rp_error(trans, rp_data->msg_ref, rc = gsm411_send_rp_error(trans, rp_data->msg_ref,
GSM411_RP_CAUSE_MSGTYPE_NOTEXIST); GSM411_RP_CAUSE_MSGTYPE_NOTEXIST);
break; break;
@ -735,7 +735,7 @@ static int gsm411_tx_cp_error(struct gsm_trans *trans, uint8_t cause)
struct msgb *msg = gsm411_msgb_alloc(); struct msgb *msg = gsm411_msgb_alloc();
uint8_t *causep; uint8_t *causep;
LOGP(DSMS, LOGL_NOTICE, "TX CP-ERROR, cause %d (%s)\n", cause, LOGP(DLSMS, LOGL_NOTICE, "TX CP-ERROR, cause %d (%s)\n", cause,
get_value_string(cp_cause_strs, cause)); get_value_string(cp_cause_strs, cause));
causep = msgb_put(msg, 1); causep = msgb_put(msg, 1);
@ -758,15 +758,15 @@ int gsm0411_rcv_sms(struct gsm_subscriber_connection *conn,
return -EIO; return -EIO;
/* FIXME: send some error message */ /* FIXME: send some error message */
DEBUGP(DSMS, "trans_id=%x ", transaction_id); DEBUGP(DLSMS, "trans_id=%x ", transaction_id);
trans = trans_find_by_id(conn->subscr, GSM48_PDISC_SMS, trans = trans_find_by_id(conn->subscr, GSM48_PDISC_SMS,
transaction_id); transaction_id);
if (!trans) { if (!trans) {
DEBUGPC(DSMS, "(new) "); DEBUGPC(DLSMS, "(new) ");
trans = trans_alloc(conn->subscr, GSM48_PDISC_SMS, trans = trans_alloc(conn->subscr, GSM48_PDISC_SMS,
transaction_id, new_callref++); transaction_id, new_callref++);
if (!trans) { if (!trans) {
DEBUGPC(DSMS, "No memory for trans\n"); DEBUGPC(DLSMS, "No memory for trans\n");
/* FIXME: send some error message */ /* FIXME: send some error message */
return -ENOMEM; return -ENOMEM;
} }
@ -780,7 +780,7 @@ int gsm0411_rcv_sms(struct gsm_subscriber_connection *conn,
switch(msg_type) { switch(msg_type) {
case GSM411_MT_CP_DATA: case GSM411_MT_CP_DATA:
DEBUGPC(DSMS, "RX SMS CP-DATA\n"); DEBUGPC(DLSMS, "RX SMS CP-DATA\n");
/* 5.4: For MO, if a CP-DATA is received for a new /* 5.4: For MO, if a CP-DATA is received for a new
* transaction, equals reception of an implicit * transaction, equals reception of an implicit
@ -799,7 +799,7 @@ int gsm0411_rcv_sms(struct gsm_subscriber_connection *conn,
if (!ptrans) if (!ptrans)
continue; continue;
DEBUGP(DSMS, "Implicit CP-ACK for trans_id=%x\n", i); DEBUGP(DLSMS, "Implicit CP-ACK for trans_id=%x\n", i);
/* Finish it for good */ /* Finish it for good */
osmo_timer_del(&ptrans->sms.cp_timer); osmo_timer_del(&ptrans->sms.cp_timer);
@ -828,7 +828,7 @@ int gsm0411_rcv_sms(struct gsm_subscriber_connection *conn,
break; break;
case GSM411_MT_CP_ACK: case GSM411_MT_CP_ACK:
/* previous CP-DATA in this transaction was confirmed */ /* previous CP-DATA in this transaction was confirmed */
DEBUGPC(DSMS, "RX SMS CP-ACK\n"); DEBUGPC(DLSMS, "RX SMS CP-ACK\n");
/* 5.2.3.1.3: MO state exists when SMC has received CP-ACK */ /* 5.2.3.1.3: MO state exists when SMC has received CP-ACK */
/* 5.2.3.2.4: MT state exists when SMC has received CP-ACK */ /* 5.2.3.2.4: MT state exists when SMC has received CP-ACK */
trans->sms.cp_state = GSM411_CPS_MM_ESTABLISHED; trans->sms.cp_state = GSM411_CPS_MM_ESTABLISHED;
@ -844,14 +844,14 @@ int gsm0411_rcv_sms(struct gsm_subscriber_connection *conn,
} }
break; break;
case GSM411_MT_CP_ERROR: case GSM411_MT_CP_ERROR:
DEBUGPC(DSMS, "RX SMS CP-ERROR, cause %d (%s)\n", gh->data[0], DEBUGPC(DLSMS, "RX SMS CP-ERROR, cause %d (%s)\n", gh->data[0],
get_value_string(cp_cause_strs, gh->data[0])); get_value_string(cp_cause_strs, gh->data[0]));
osmo_timer_del(&trans->sms.cp_timer); osmo_timer_del(&trans->sms.cp_timer);
trans->sms.cp_state = GSM411_CPS_IDLE; trans->sms.cp_state = GSM411_CPS_IDLE;
trans_free(trans); trans_free(trans);
break; break;
default: default:
DEBUGPC(DSMS, "RX Unimplemented CP msg_type: 0x%02x\n", msg_type); DEBUGPC(DLSMS, "RX Unimplemented CP msg_type: 0x%02x\n", msg_type);
rc = gsm411_tx_cp_error(trans, GSM411_CP_CAUSE_MSGTYPE_NOTEXIST); rc = gsm411_tx_cp_error(trans, GSM411_CP_CAUSE_MSGTYPE_NOTEXIST);
trans->sms.cp_state = GSM411_CPS_IDLE; trans->sms.cp_state = GSM411_CPS_IDLE;
trans_free(trans); trans_free(trans);
@ -875,19 +875,19 @@ int gsm411_send_sms(struct gsm_subscriber_connection *conn, struct gsm_sms *sms)
transaction_id = trans_assign_trans_id(conn->subscr, GSM48_PDISC_SMS, 0); transaction_id = trans_assign_trans_id(conn->subscr, GSM48_PDISC_SMS, 0);
if (transaction_id == -1) { if (transaction_id == -1) {
LOGP(DSMS, LOGL_ERROR, "No available transaction ids\n"); LOGP(DLSMS, LOGL_ERROR, "No available transaction ids\n");
send_signal(S_SMS_UNKNOWN_ERROR, NULL, sms, 0); send_signal(S_SMS_UNKNOWN_ERROR, NULL, sms, 0);
sms_free(sms); sms_free(sms);
return -EBUSY; return -EBUSY;
} }
DEBUGP(DSMS, "send_sms_lchan()\n"); DEBUGP(DLSMS, "send_sms_lchan()\n");
/* FIXME: allocate transaction with message reference */ /* FIXME: allocate transaction with message reference */
trans = trans_alloc(conn->subscr, GSM48_PDISC_SMS, trans = trans_alloc(conn->subscr, GSM48_PDISC_SMS,
transaction_id, new_callref++); transaction_id, new_callref++);
if (!trans) { if (!trans) {
LOGP(DSMS, LOGL_ERROR, "No memory for trans\n"); LOGP(DLSMS, LOGL_ERROR, "No memory for trans\n");
send_signal(S_SMS_UNKNOWN_ERROR, NULL, sms, 0); send_signal(S_SMS_UNKNOWN_ERROR, NULL, sms, 0);
sms_free(sms); sms_free(sms);
/* FIXME: send some error message */ /* FIXME: send some error message */
@ -931,7 +931,7 @@ int gsm411_send_sms(struct gsm_subscriber_connection *conn, struct gsm_sms *sms)
*rp_ud_len = rc; *rp_ud_len = rc;
DEBUGP(DSMS, "TX: SMS DELIVER\n"); DEBUGP(DLSMS, "TX: SMS DELIVER\n");
osmo_counter_inc(conn->bts->network->stats.sms.delivered); osmo_counter_inc(conn->bts->network->stats.sms.delivered);
db_sms_inc_deliver_attempts(trans->sms.sms); db_sms_inc_deliver_attempts(trans->sms.sms);
@ -949,7 +949,7 @@ static int paging_cb_send_sms(unsigned int hooknum, unsigned int event,
struct gsm_sms *sms = _sms; struct gsm_sms *sms = _sms;
int rc = 0; int rc = 0;
DEBUGP(DSMS, "paging_cb_send_sms(hooknum=%u, event=%u, msg=%p," DEBUGP(DLSMS, "paging_cb_send_sms(hooknum=%u, event=%u, msg=%p,"
"conn=%p, sms=%p/id: %llu)\n", hooknum, event, msg, conn, sms, sms->id); "conn=%p, sms=%p/id: %llu)\n", hooknum, event, msg, conn, sms, sms->id);
if (hooknum != GSM_HOOK_RR_PAGING) if (hooknum != GSM_HOOK_RR_PAGING)
@ -967,7 +967,7 @@ static int paging_cb_send_sms(unsigned int hooknum, unsigned int event,
rc = -ETIMEDOUT; rc = -ETIMEDOUT;
break; break;
default: default:
LOGP(DSMS, LOGL_ERROR, "Unhandled paging event: %d\n", event); LOGP(DLSMS, LOGL_ERROR, "Unhandled paging event: %d\n", event);
} }
return rc; return rc;
@ -996,7 +996,7 @@ int gsm411_send_sms_subscr(struct gsm_subscriber *subscr,
void _gsm411_sms_trans_free(struct gsm_trans *trans) void _gsm411_sms_trans_free(struct gsm_trans *trans)
{ {
if (trans->sms.sms) { if (trans->sms.sms) {
LOGP(DSMS, LOGL_ERROR, "Transaction contains SMS.\n"); LOGP(DLSMS, LOGL_ERROR, "Transaction contains SMS.\n");
send_signal(S_SMS_UNKNOWN_ERROR, trans, trans->sms.sms, 0); send_signal(S_SMS_UNKNOWN_ERROR, trans, trans->sms.sms, 0);
sms_free(trans->sms.sms); sms_free(trans->sms.sms);
trans->sms.sms = NULL; trans->sms.sms = NULL;
@ -1018,7 +1018,7 @@ void gsm411_sapi_n_reject(struct gsm_subscriber_connection *conn)
if (trans->conn == conn) { if (trans->conn == conn) {
struct gsm_sms *sms = trans->sms.sms; struct gsm_sms *sms = trans->sms.sms;
if (!sms) { if (!sms) {
LOGP(DSMS, LOGL_ERROR, "SAPI Reject but no SMS.\n"); LOGP(DLSMS, LOGL_ERROR, "SAPI Reject but no SMS.\n");
continue; continue;
} }

View File

@ -45,14 +45,14 @@ static int paging_cb_silent(unsigned int hooknum, unsigned int event,
if (hooknum != GSM_HOOK_RR_PAGING) if (hooknum != GSM_HOOK_RR_PAGING)
return -EINVAL; return -EINVAL;
DEBUGP(DSMS, "paging_cb_silent: "); DEBUGP(DLSMS, "paging_cb_silent: ");
sigdata.conn = conn; sigdata.conn = conn;
sigdata.data = _data; sigdata.data = _data;
switch (event) { switch (event) {
case GSM_PAGING_SUCCEEDED: case GSM_PAGING_SUCCEEDED:
DEBUGPC(DSMS, "success, using Timeslot %u on ARFCN %u\n", DEBUGPC(DLSMS, "success, using Timeslot %u on ARFCN %u\n",
conn->lchan->ts->nr, conn->lchan->ts->trx->arfcn); conn->lchan->ts->nr, conn->lchan->ts->trx->arfcn);
conn->silent_call = 1; conn->silent_call = 1;
/* increment lchan reference count */ /* increment lchan reference count */
@ -61,7 +61,7 @@ static int paging_cb_silent(unsigned int hooknum, unsigned int event,
case GSM_PAGING_EXPIRED: case GSM_PAGING_EXPIRED:
case GSM_PAGING_BUSY: case GSM_PAGING_BUSY:
case GSM_PAGING_OOM: case GSM_PAGING_OOM:
DEBUGP(DSMS, "expired\n"); DEBUGP(DLSMS, "expired\n");
osmo_signal_dispatch(SS_SCALL, S_SCALL_EXPIRED, &sigdata); osmo_signal_dispatch(SS_SCALL, S_SCALL_EXPIRED, &sigdata);
break; break;
default: default:

View File

@ -130,7 +130,7 @@ static void sms_pending_free(struct gsm_sms_pending *pending)
static void sms_pending_resend(struct gsm_sms_pending *pending) static void sms_pending_resend(struct gsm_sms_pending *pending)
{ {
struct gsm_sms_queue *smsq; struct gsm_sms_queue *smsq;
LOGP(DSMS, LOGL_DEBUG, LOGP(DLSMS, LOGL_DEBUG,
"Scheduling resend of SMS %llu.\n", pending->sms_id); "Scheduling resend of SMS %llu.\n", pending->sms_id);
pending->resend = 1; pending->resend = 1;
@ -146,7 +146,7 @@ static void sms_pending_failed(struct gsm_sms_pending *pending, int paging_error
{ {
struct gsm_sms_queue *smsq; struct gsm_sms_queue *smsq;
LOGP(DSMS, LOGL_NOTICE, "Sending SMS %llu failed %d times.\n", LOGP(DLSMS, LOGL_NOTICE, "Sending SMS %llu failed %d times.\n",
pending->sms_id, pending->failed_attempts); pending->sms_id, pending->failed_attempts);
smsq = pending->subscr->net->sms_queue; smsq = pending->subscr->net->sms_queue;
@ -217,7 +217,7 @@ static void sms_submit_pending(void *_data)
unsigned long long first_sub = 0; unsigned long long first_sub = 0;
int attempted = 0, rounds = 0; int attempted = 0, rounds = 0;
LOGP(DSMS, LOGL_NOTICE, "Attempting to send %d SMS\n", attempts); LOGP(DLSMS, LOGL_NOTICE, "Attempting to send %d SMS\n", attempts);
do { do {
struct gsm_sms_pending *pending; struct gsm_sms_pending *pending;
@ -249,7 +249,7 @@ static void sms_submit_pending(void *_data)
/* no need to send a pending sms */ /* no need to send a pending sms */
if (sms_is_in_pending(smsq, sms)) { if (sms_is_in_pending(smsq, sms)) {
LOGP(DSMS, LOGL_DEBUG, LOGP(DLSMS, LOGL_DEBUG,
"SMSqueue with pending sms: %llu. Skipping\n", sms->id); "SMSqueue with pending sms: %llu. Skipping\n", sms->id);
sms_free(sms); sms_free(sms);
continue; continue;
@ -257,7 +257,7 @@ static void sms_submit_pending(void *_data)
/* no need to send a SMS with the same receiver */ /* no need to send a SMS with the same receiver */
if (sms_subscriber_is_pending(smsq, sms->receiver)) { if (sms_subscriber_is_pending(smsq, sms->receiver)) {
LOGP(DSMS, LOGL_DEBUG, LOGP(DLSMS, LOGL_DEBUG,
"SMSqueue with pending sub: %llu. Skipping\n", sms->receiver->id); "SMSqueue with pending sub: %llu. Skipping\n", sms->receiver->id);
sms_free(sms); sms_free(sms);
continue; continue;
@ -265,7 +265,7 @@ static void sms_submit_pending(void *_data)
pending = sms_pending_from(smsq, sms); pending = sms_pending_from(smsq, sms);
if (!pending) { if (!pending) {
LOGP(DSMS, LOGL_ERROR, LOGP(DLSMS, LOGL_ERROR,
"Failed to create pending SMS entry.\n"); "Failed to create pending SMS entry.\n");
sms_free(sms); sms_free(sms);
continue; continue;
@ -277,7 +277,7 @@ static void sms_submit_pending(void *_data)
gsm411_send_sms_subscr(sms->receiver, sms); gsm411_send_sms_subscr(sms->receiver, sms);
} while (attempted < attempts && rounds < 1000); } while (attempted < attempts && rounds < 1000);
LOGP(DSMS, LOGL_DEBUG, "SMSqueue added %d messages in %d rounds\n", attempted, rounds); LOGP(DLSMS, LOGL_DEBUG, "SMSqueue added %d messages in %d rounds\n", attempted, rounds);
} }
/* /*
@ -442,12 +442,12 @@ static int sms_sms_cb(unsigned int subsys, unsigned int signal,
sms_queue_trigger(network->sms_queue); sms_queue_trigger(network->sms_queue);
break; break;
default: default:
LOGP(DSMS, LOGL_ERROR, "Unhandled result: %d\n", LOGP(DLSMS, LOGL_ERROR, "Unhandled result: %d\n",
sig_sms->paging_result); sig_sms->paging_result);
} }
break; break;
default: default:
LOGP(DSMS, LOGL_ERROR, "Unhandled result: %d\n", LOGP(DLSMS, LOGL_ERROR, "Unhandled result: %d\n",
sig_sms->paging_result); sig_sms->paging_result);
} }
@ -471,7 +471,7 @@ int sms_queue_stats(struct gsm_sms_queue *smsq, struct vty *vty)
int sms_queue_set_max_pending(struct gsm_sms_queue *smsq, int max_pending) int sms_queue_set_max_pending(struct gsm_sms_queue *smsq, int max_pending)
{ {
LOGP(DSMS, LOGL_NOTICE, "SMSqueue old max: %d new: %d\n", LOGP(DLSMS, LOGL_NOTICE, "SMSqueue old max: %d new: %d\n",
smsq->max_pending, max_pending); smsq->max_pending, max_pending);
smsq->max_pending = max_pending; smsq->max_pending = max_pending;
return 0; return 0;
@ -479,7 +479,7 @@ int sms_queue_set_max_pending(struct gsm_sms_queue *smsq, int max_pending)
int sms_queue_set_max_failure(struct gsm_sms_queue *smsq, int max_fail) int sms_queue_set_max_failure(struct gsm_sms_queue *smsq, int max_fail)
{ {
LOGP(DSMS, LOGL_NOTICE, "SMSqueue max failure old: %d new: %d\n", LOGP(DLSMS, LOGL_NOTICE, "SMSqueue max failure old: %d new: %d\n",
smsq->max_fail, max_fail); smsq->max_fail, max_fail);
smsq->max_fail = max_fail; smsq->max_fail = max_fail;
return 0; return 0;
@ -490,7 +490,7 @@ int sms_queue_clear(struct gsm_sms_queue *smsq)
struct gsm_sms_pending *pending, *tmp; struct gsm_sms_pending *pending, *tmp;
llist_for_each_entry_safe(pending, tmp, &smsq->pending_sms, entry) { llist_for_each_entry_safe(pending, tmp, &smsq->pending_sms, entry) {
LOGP(DSMS, LOGL_NOTICE, LOGP(DLSMS, LOGL_NOTICE,
"SMSqueue clearing for sub %llu\n", pending->subscr->id); "SMSqueue clearing for sub %llu\n", pending->subscr->id);
sms_pending_free(pending); sms_pending_free(pending);
} }

View File

@ -153,7 +153,7 @@ static int _send_sms_str(struct gsm_subscriber *receiver, char *str,
/* store in database for the queue */ /* store in database for the queue */
if (db_sms_store(sms) != 0) { if (db_sms_store(sms) != 0) {
LOGP(DSMS, LOGL_ERROR, "Failed to store SMS in Database\n"); LOGP(DLSMS, LOGL_ERROR, "Failed to store SMS in Database\n");
sms_free(sms); sms_free(sms);
return CMD_WARNING; return CMD_WARNING;
} }