Sent SMS not getting deleted from Modem

Amol Lad Amol.Lad at 4rf.com
Wed May 4 12:58:00 UTC 2022


Hi Aleksander,

I'm trying to investigate this issue. My observation is "mm_sms_part_get_index ((MMSmsPart *)ctx->current->data)" returns SMS_PART_INVALID_INDEX in the function delete_next_part () in the file mm-sms-mbim.c. As a result delete_next_part() returns from inside if (!ctx->current) check.

However, when I restart modemmanager and all the "deleted" SMS are listed again and then if I try to delete them then mm_sms_part_get_index() returns a valid index in delete_next_part and finaly mbim_device_command is called.

So the problem seems mm_sms_part_get_index ((MMSmsPart *)ctx->current->data) not returning correct idx during delete. Any suggestion how to proceed from here?

Amol

===

mm-sms-mbim.c:

static void
delete_next_part (GTask *task)
{
    SmsDeletePartsContext *ctx;
    MbimMessage *message;
    MMSmsMbim *self;

    self = g_task_get_source_object (task);
    ctx = g_task_get_task_data (task);
    /* Skip non-stored parts */
    while (ctx->current &&
           mm_sms_part_get_index ((MMSmsPart *)ctx->current->data) == SMS_PART_INVALID_INDEX) < - - This returns SMS_PART_INVALID_INDEX
        ctx->current = g_list_next (ctx->current);


    /* If all removed, we're done */
    if (!ctx->current) {
        mm_obj_err(self, "Inside NULL... %d", ctx->n_failed);
        if (ctx->n_failed > 0)
            g_task_return_new_error (task,
                                     MM_CORE_ERROR,
                                     MM_CORE_ERROR_FAILED,
                                     "Couldn't delete %u parts from this SMS",
                                     ctx->n_failed);
        else
            g_task_return_boolean (task, TRUE);

        g_object_unref (task); < - - Function returns from here
        return;
    }

    message = mbim_message_sms_delete_set_new (MBIM_SMS_FLAG_INDEX,
                                               (guint32)mm_sms_part_get_index ((MMSmsPart *)ctx->current->data),
                                               NULL);
    mbim_device_command (ctx->device,
                         message,
                         10,
                         NULL,
                         (GAsyncReadyCallback)sms_delete_set_ready,
                         task);
    mbim_message_unref (message);

}

-----Original Message-----
From: Aleksander Morgado <aleksander at aleksander.es> 
Sent: Wednesday, 4 May 2022 1:16 PM
To: Amol Lad <Amol.Lad at 4rf.com>
Cc: ModemManager (development) <modemmanager-devel at lists.freedesktop.org>
Subject: Re: Sent SMS not getting deleted from Modem

Hey,

On Wed, May 4, 2022 at 9:15 AM Amol Lad <Amol.Lad at 4rf.com> wrote:
>
> Hi,
>
> I've observed this issue in MM 1.18.6. If I create and send SMS from ModemManager and then delete the message, ModemManager reports message successfully deleted but actually no QMI command is sent to the modem to delete the message. As a result, if I restart ModemManager, then that "deleted" SMS is again listed in ModemManager. If I try to delete it now then delete is successful. Sorry for confusing statement :).
>

This deserves a new issue in gitlab, could you open it with the details?
https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/new

> Please refer to below steps along with the logs for what I'm trying to explain.
>
> Please advise what is going wrong
>
> # mmcli -m 0
>   ----------------------------------
>   General  |                   path: /org/freedesktop/ModemManager1/Modem/0
>            |              device id: c6ffa92f0ce17a12c39b4a5e5c8e53f67bac2be2
>   ----------------------------------
>   Hardware |           manufacturer: Sierra Wireless, Incorporated
>            |                  model: Sierra Wireless EM7565 Qualcomm(r) Snapdragon(tm) X16 LTE-A
>            |      firmware revision: SWI9X50C_01.08.04.00
>            |         carrier config: default
>            |           h/w revision: EM7565
>            |              supported: gsm-umts, lte
>            |                current: gsm-umts, lte
>            |           equipment id: 353533100762262
>   ----------------------------------
>   System   |                 device: /sys/devices/platform/soc/soc:internal-regs/f10f0000.usb3/usb2/2-1
>            |                drivers: qcserial, cdc_mbim
>            |                 plugin: sierra
>            |           primary port: cdc-wdm0
>            |                  ports: cdc-wdm0 (mbim), ttyUSB0 (qcdm), ttyUSB1 (gps),
>            |                         ttyUSB2 (at), wwan0 (net)
>   ----------------------------------
>   Status   |         unlock retries: sim-pin2 (3)
>            |                  state: connected
>            |            power state: on
>            |            access tech: lte
>            |         signal quality: 19% (recent)
>   ----------------------------------
>   Modes    |              supported: allowed: 3g; preferred: none
>            |                         allowed: 4g; preferred: none
>            |                         allowed: 3g, 4g; preferred: 4g
>            |                         allowed: 3g, 4g; preferred: 3g
>            |                current: allowed: 4g; preferred: none
>   ----------------------------------
>   Bands    |              supported: utran-1, utran-4, utran-6, utran-5, utran-8, utran-9,
>            |                         utran-2, eutran-1, eutran-2, eutran-3, eutran-4, eutran-5, eutran-7,
>            |                         eutran-8, eutran-9, eutran-12, eutran-13, eutran-18, eutran-19,
>            |                         eutran-20, eutran-26, eutran-28, eutran-29, eutran-30, eutran-32,
>            |                         eutran-41, eutran-42, eutran-43, eutran-46, eutran-48, eutran-66,
>            |                         utran-19
>            |                current: eutran-1, eutran-2, eutran-3, eutran-4, eutran-5, eutran-7,
>            |                         eutran-8, eutran-9, eutran-12, eutran-13, eutran-18, eutran-19,
>            |                         eutran-20, eutran-26, eutran-28, eutran-29, eutran-30, eutran-32,
>            |                         eutran-41, eutran-42, eutran-43, eutran-46, eutran-48, eutran-66
>   ----------------------------------
>   IP       |              supported: ipv4, ipv6, ipv4v6
>   ----------------------------------
>   3GPP     |                   imei: 353533100762262
>            |          enabled locks: fixed-dialing
>            |            operator id: 40445
>            |          operator name: airtel
>            |           registration: home
>   ----------------------------------
>   3GPP EPS |   ue mode of operation: csps-2
>            |    initial bearer path: /org/freedesktop/ModemManager1/Bearer/0
>            |     initial bearer apn: internet
>            | initial bearer ip type: ipv4
>   ----------------------------------
>   SIM      |       primary sim path: /org/freedesktop/ModemManager1/SIM/0
>            |         sim slot paths: slot 1: /org/freedesktop/ModemManager1/SIM/0 (active)
>            |                         slot 2: none
>   ----------------------------------
>   Bearer   |                  paths: /org/freedesktop/ModemManager1/Bearer/1
>
>
> # mmcli -m 0 --messaging-create-sms="text='Hi',number='+919886559096'"
> Successfully created new SMS: /org/freedesktop/ModemManager1/SMS/0
>
> # mmcli -s 0 --send
> successfully sent the SMS
>
> debug 2022-05-04T06:39:16+00:00 : [/dev/cdc-wdm0] Sent message...
> <<<<<< RAW:
> <<<<<<   length = 76
> <<<<<<   data   = 03:00:00:00:4C:00:00:00:2B:00:00:00:01:00:00:00:00:00:00:00:53:3F:BE:EB:14:FE:44:67:9F:90:33:A2:23:E5:6C:3F:03:00:00:00:01:00:00:00:1C:00:00:00:00:00:00:00:08:00:00:00:10:00:00:00:00:01:00:0C:91:19:89:68:55:09:69:00:00:02:C8:34
> debug 2022-05-04T06:39:16+00:00 : [/dev/cdc-wdm0] Sent message (translated)...
> <<<<<< Header:
> <<<<<<   length      = 76
> <<<<<<   type        = command (0x00000003)
> <<<<<<   transaction = 43
> <<<<<< Fragment header:
> <<<<<<   total   = 1
> <<<<<<   current = 0
> <<<<<< Contents:
> <<<<<<   service = 'sms' (533fbeeb-14fe-4467-9f90-33a223e56c3f)
> <<<<<<   cid     = 'send' (0x00000003)
> <<<<<<   type    = 'set' (0x00000001)
> <<<<<< Fields:
> <<<<<<   Format = '0'
> <<<<<<   PduMessage = {
> <<<<<<       PduData = '00:01:00:0c:91:19:89:68:55:09:69:00:00:02:c8:34'
> <<<<<<   }
>
> >>>>>> RAW:
> >>>>>>   length = 52
> >>>>>>   data   = 03:00:00:80:34:00:00:00:2B:00:00:00:01:00:00:00:00:00:00:00:53:3F:BE:EB:14:FE:44:67:9F:90:33:A2:23:E5:6C:3F:03:00:00:00:00:00:00:00:04:00:00:00:A8:00:00:00
> debug 2022-05-04T06:39:16+00:00 : [/dev/cdc-wdm0] Received message (translated)...
> >>>>>> Header:
> >>>>>>   length      = 52
> >>>>>>   type        = command-done (0x80000003)
> >>>>>>   transaction = 43
> >>>>>> Fragment header:
> >>>>>>   total   = 1
> >>>>>>   current = 0
> >>>>>> Contents:
> >>>>>>   status error = 'None' (0x00000000)
> >>>>>>   service      = 'sms' (533fbeeb-14fe-4467-9f90-33a223e56c3f)
> >>>>>>   cid          = 'send' (0x00000003)
> >>>>>> Fields:
> >>>>>>   MessageReference = '168'
>
> # mmcli -m 0 --messaging-list-sms
>     /org/freedesktop/ModemManager1/SMS/0 (sent)
>
> # mmcli -m 0 --messaging-delete-sms=0
> successfully deleted SMS from modem
>
> < NO QMI MESSAGES ARE PRINTED HERE>
>
> # mmcli -m 0 --messaging-list-sms
> No sms messages were found
>
> RESTART MODEMMANAGER
>
> # /etc/init.d/modemmanager restart
>
> # mmcli -m 0 --messaging-list-sms
>     /org/freedesktop/ModemManager1/SMS/0 (sent)  < - - This message was deleted above and it got reappeared
>
> # mmcli -m 0 --messaging-delete-sms=0
> successfully deleted SMS from modem
>
> NOW THE MESSAGE GOT DELETED:
>
> debug 2022-05-04T06:41:23+00:00 : [/dev/cdc-wdm0] Sent message...
> <<<<<< RAW:
> <<<<<<   length = 56
> <<<<<<   data   = 03:00:00:00:38:00:00:00:2A:00:00:00:01:00:00:00:00:00:00:00:53:3F:BE:EB:14:FE:44:67:9F:90:33:A2:23:E5:6C:3F:04:00:00:00:01:00:00:00:08:00:00:00:01:00:00:00:01:00:00:00
> debug 2022-05-04T06:41:23+00:00 : [/dev/cdc-wdm0] Sent message (translated)...
> <<<<<< Header:
> <<<<<<   length      = 56
> <<<<<<   type        = command (0x00000003)
> <<<<<<   transaction = 42
> <<<<<< Fragment header:
> <<<<<<   total   = 1
> <<<<<<   current = 0
> <<<<<< Contents:
> <<<<<<   service = 'sms' (533fbeeb-14fe-4467-9f90-33a223e56c3f)
> <<<<<<   cid     = 'delete' (0x00000004)
> <<<<<<   type    = 'set' (0x00000001)
> <<<<<< Fields:
> <<<<<<   Flag = 'index'
> <<<<<<   MessageIndex = '1'
> debug 2022-05-04T06:41:23+00:00 : [/dev/cdc-wdm0] Received message...
> >>>>>> RAW:
> >>>>>>   length = 48
> >>>>>>   data   = 03:00:00:80:30:00:00:00:2A:00:00:00:01:00:00:00:00:00:00:00:53:3F:BE:EB:14:FE:44:67:9F:90:33:A2:23:E5:6C:3F:04:00:00:00:00:00:00:00:00:00:00:00
> debug 2022-05-04T06:41:23+00:00 : [/dev/cdc-wdm0] Received message (translated)...
> >>>>>> Header:
> >>>>>>   length      = 48
> >>>>>>   type        = command-done (0x80000003)
> >>>>>>   transaction = 42
> >>>>>> Fragment header:
> >>>>>>   total   = 1
> >>>>>>   current = 0
> >>>>>> Contents:
> >>>>>>   status error = 'None' (0x00000000)
> >>>>>>   service      = 'sms' (533fbeeb-14fe-4467-9f90-33a223e56c3f)
> >>>>>>   cid          = 'delete' (0x00000004)
> debug 2022-05-04T06:41:23+00:00 : [/dev/cdc-wdm0] Received message...
> >>>>>> RAW:
> >>>>>>   length = 52
> >>>>>>   data   = 07:00:00:80:34:00:00:00:00:00:00:00:01:00:00:00:00:00:00:00:53:3F:BE:EB:14:FE:44:67:9F:90:33:A2:23:E5:6C:3F:05:00:00:00:08:00:00:00:00:00:00:00:00:00:00:00
> debug 2022-05-04T06:41:23+00:00 : [/dev/cdc-wdm0] Received message (translated)...
> >>>>>> Header:
> >>>>>>   length      = 52
> >>>>>>   type        = indicate-status (0x80000007)
> >>>>>>   transaction = 0
> >>>>>> Fragment header:
> >>>>>>   total   = 1
> >>>>>>   current = 0
> >>>>>> Contents:
> >>>>>>   service = 'sms' (533fbeeb-14fe-4467-9f90-33a223e56c3f)
> >>>>>>   cid     = 'message-store-status' (0x00000005)
> >>>>>> Fields:
> >>>>>>   Flag = 'none'
> >>>>>>   MessageIndex = '0'
>
> # mmcli -m 0 --messaging-list-sms
> No sms messages were found



-- 
Aleksander
https://aleksander.es


More information about the ModemManager-devel mailing list