diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2020-01-09 04:47:49 +0100 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2020-01-09 04:48:43 +0100 |
commit | bf5c0ee70c512f896a3e23496c6feb8cd64a7747 (patch) | |
tree | 85cc1ac7662964179bb0561fafc40170b9a684b6 /src/libmsc/smpp_openbsc.c | |
parent | edaa1f26fed68bab506434fc07a9f3aca05f226f (diff) |
debug hack: add use count on conn for SMPP cmdneels/os4351
Change-Id: I4f027275946521a03ed90f4c936592251560be47
Diffstat (limited to 'src/libmsc/smpp_openbsc.c')
-rw-r--r-- | src/libmsc/smpp_openbsc.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index 98b3b5370..61d797289 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -569,6 +569,12 @@ static void smpp_cmd_free(struct osmo_smpp_cmd *cmd) { osmo_timer_del(&cmd->response_timer); llist_del(&cmd->list); + + if (cmd->msc_a) { + msc_a_put(cmd->msc_a, MSC_A_USE_SMS_SMPP); + cmd->msc_a = NULL; + } + vlr_subscr_put(cmd->vsub, VSUB_USE_SMPP_CMD); talloc_free(cmd); } @@ -589,7 +595,9 @@ void smpp_cmd_ack(struct osmo_smpp_cmd *cmd) if (cmd->is_report) goto out; - msc_a = msc_a_for_vsub(cmd->vsub, true); + msc_a = cmd->msc_a; + if (!msc_a) + msc_a = msc_a_for_vsub(cmd->vsub, true); if (!msc_a) { LOGP(DSMPP, LOGL_ERROR, "No connection to subscriber %s\n", vlr_subscr_name(cmd->vsub)); goto out; @@ -642,6 +650,7 @@ static void smpp_deliver_sm_cb(void *data) } static int smpp_cmd_enqueue(struct osmo_esme *esme, + struct msc_a *msc_a, struct vlr_subscr *vsub, struct gsm_sms *sms, uint32_t sequence_number) { @@ -658,6 +667,12 @@ static int smpp_cmd_enqueue(struct osmo_esme *esme, vlr_subscr_get(vsub, VSUB_USE_SMPP_CMD); cmd->vsub = vsub; + /* Keep the connection open until the ESME responded */ + if (msc_a) { + cmd->msc_a = msc_a; + msc_a_get(msc_a, MSC_A_USE_SMS_SMPP); + } + /* FIXME: No predefined value for this response_timer as specified by * SMPP 3.4 specs, section 7.2. Make this configurable? Don't forget * lchan keeps busy until we get a reply to this SMPP command. Too high @@ -773,7 +788,7 @@ static int deliver_to_esme(struct osmo_esme *esme, struct gsm_sms *sms, if (ret < 0) return ret; - return smpp_cmd_enqueue(esme, vsub, sms, + return smpp_cmd_enqueue(esme, msc_a, vsub, sms, deliver.sequence_number); } |