Skip to contentSkip to conversation

isimodem/n900: CLIP and list-operators not working under Alpine Linux

DISCUSSION Sicelo 2 participants 3 messages Oct 16, 2023 – Oct 29, 2023

lore
Share & tools
lore

Sicelo

author
#0 lore raw

Hi

Since a number of versions ago, the Nokia N900 modem does not return anything to the list-operators command under Alpine/PostmarketOS [1]. With recent testing, it was found that even the CLIP is not displayed on an incoming call.

However, both list-operators and CLIP are working fine in Maemo Leste, a distribution derived from Debian.

The major difference between Maemo Leste and PostmarketOS is that the former is a glibc distro, while the latter uses musl. I am mentioning this in case it is useful, otherwise I have not yet found anything specific between the two libraries that could cause the observed differences.

By enabling the environment variables OFONO_ISI_DEBUG and OFONO_ISI_TRACE, I was able to establish that, at least for the CLIP issue, in both cases, the modem provides the CLIP details to ofono, but somehow it gets processed differently. In order for my tests to be consistent, I used the same ofono version in both Maemo and postmarketOS (1.34.8).

With Maemo Leste (glibc), the following snippet is seen ("X" characters are the calling phone number, redacted)

ofonod[4233]: PN_CALL (0x01): CALL_SERVER_STATUS_IND [id=0x10 utid=0x01 len=4]:
ofonod[4233]: * 01 10 01 00 : .....
ofonod[4233]: gisi: Success IND to 0x56dc40 [res=0x01, id=0x10, utid=0x01] ofonod[4233]: src/audio-settings.c:ofono_audio_settings_active_notify() active 1 ofonod[4233]: PN_CALL (0x01): CALL_COMING_IND [id=0x03 utid=0x02 len=32]:
ofonod[4233]: * 02 03 01 02 07 04 01 01 01 18 21 30 00 08 00 3X : ...........!0...X
ofonod[4233]: * 00 3X 00 3X 00 3X 00 3X 00 3X 00 3X 00 3X 00 00 : .X.X.X.X.X.X.X..
ofonod[4233]: PN_CALL (0x01): CALL_STATUS_IND [id=0x0F utid=0x03 len=40]:

ofonod[4233]:     * 03 0F 01 04 0A 04 02 00 07 04 01 01 01 18 21 30 : ...............!0
ofonod[4233]:     * 00 08 00 3X 00 3X 00 3X 00 3X 00 3X 00 3X 00 3X : ...X.X.X.X.X.X.X
ofonod[4233]:     * 00 3X 00 00 BE 04 00 00                         : .X......

ofonod[4233]: gisi: Success IND to 0x56da48 [res=0x01, id=0x0F, utid=0x03]
ofonod[4233]: drivers/isimodem/voicecall.c:isi_call_notify() called with status=CALL_STATUS_COMING (0x02)
ofonod[4233]: PN_CALL (0x01): CALL_STATUS_IND [id=0x0F utid=0x04 len=12]:
ofonod[4233]: * 04 0F 01 02 0A 04 03 00 07 04 01 01 : .............
ofonod[4233]: gisi: Success IND to 0x56da48 [res=0x01, id=0x0F, utid=0x04]
ofonod[4233]: drivers/isimodem/voicecall.c:isi_call_notify() called with status=CALL_STATUS_PROCEEDING (0x03)
ofonod[4233]: PN_CALL (0x01): CALL_MT_ALERT_IND [id=0x05 utid=0x05 len=4]:
ofonod[4233]: * 05 05 01 00 : .....
ofonod[4233]: PN_CALL (0x01): CALL_STATUS_IND [id=0x0F utid=0x06 len=12]:
ofonod[4233]: * 06 0F 01 02 0A 04 05 00 07 04 01 01 : .............
ofonod[4233]: gisi: Success IND to 0x56da48 [res=0x01, id=0x0F, utid=0x06]
ofonod[4233]: drivers/isimodem/voicecall.c:isi_call_notify() called with status=CALL_STATUS_MT_ALERTING (0x05)
ofonod[4233]: drivers/isimodem/voicecall.c:isi_call_notify() id=1,terminated,4,"XXXXXXXX","",161,0
ofonod[4233]: src/voicecall.c:ofono_voicecall_notify() Got a voicecall event, status: incoming (4), id: 1, number: XXXXXXX called_number: , called_name ofonod[4233]: src/voicecall.c:ofono_voicecall_notify() Did not find a call with id: 1

With postmarketOS, the same incoming call event returns the following:

ofonod[27080]: PN_CALL (0x01): CALL_SERVER_STATUS_IND [id=0x10 utid=0x01 len=4]:
ofonod[27080]: * 01 10 01 00 : .....
ofonod[27080]: gisi: No error information IND to 0xb6c8ae90 [res=0x01, id=0x10, utid=0x01] ofonod[27080]: src/audio-settings.c:ofono_audio_settings_active_notify() active 1 ofonod[27080]: PN_CALL (0x01): CALL_COMING_IND [id=0x03 utid=0x02 len=32]:
ofonod[27080]: * 02 03 01 02 07 04 01 01 01 18 21 30 00 08 00 3X : ...........!0...X
ofonod[27080]: * 00 3X 00 3X 00 3X 00 3X 00 3X 00 3X 00 3X 00 0X : .X.X.X.X.X.X.X..
ofonod[27080]: PN_CALL (0x01): CALL_STATUS_IND [id=0x0F utid=0x03 len=40]:

ofonod[27080]:     * 03 0F 01 04 0A 04 02 00 07 04 01 01 01 18 21 30 : ...............!0
ofonod[27080]:     * 00 08 00 3X 00 3X 00 3X 00 3X 00 3X 00 3X 00 3X : ...X.X.X.X.X.X.X
ofonod[27080]:     * 00 3X 00 00 BE 04 00 00                         : .X......

ofonod[27080]: gisi: No error information IND to 0xb6c93e10 [res=0x01, id=0x0F, utid=0x03]
ofonod[27080]: drivers/isimodem/voicecall.c:isi_call_notify() called with status=CALL_STATUS_COMING (0x02)
ofonod[27080]: PN_CALL (0x01): CALL_STATUS_IND [id=0x0F utid=0x04 len=12]:
ofonod[27080]: * 04 0F 01 02 0A 04 03 00 07 04 01 01 : .............
ofonod[27080]: gisi: No error information IND to 0xb6c93e10 [res=0x01, id=0x0F, utid=0x04]
ofonod[27080]: drivers/isimodem/voicecall.c:isi_call_notify() called with status=CALL_STATUS_PROCEEDING (0x03) ofonod[27080]: PN_NETWORK (0x0A): NET_RSSI_IND [id=0x1E utid=0x00 len=4]:
ofonod[27080]: * 00 1E 64 5D : ...d]
ofonod[27080]: gisi: No error information IND to 0xb6c8f1e0 [res=0x0A, id=0x1E, utid=0x00]
ofonod[27080]: src/network.c:ofono_netreg_strength_notify() strength 100
ofonod[27080]: PN_CALL (0x01): CALL_MT_ALERT_IND [id=0x05 utid=0x05 len=4]:
ofonod[27080]: * 05 05 01 00 : .....
ofonod[27080]: PN_CALL (0x01): CALL_STATUS_IND [id=0x0F utid=0x06 len=12]:
ofonod[27080]: * 06 0F 01 02 0A 04 05 00 07 04 01 01 : .............
ofonod[27080]: gisi: No error information IND to 0xb6c93e10 [res=0x01, id=0x0F, utid=0x06]
ofonod[27080]: drivers/isimodem/voicecall.c:isi_call_notify() called with status=CALL_STATUS_MT_ALERTING (0x05) ofonod[27080]: drivers/isimodem/voicecall.c:isi_call_notify() id=1,terminated,4,"","",128,2
ofonod[27080]: src/voicecall.c:ofono_voicecall_notify() Got a voicecall event, status: incoming (4), id: 1, number: called_number: , called_name ofonod[27080]: src/voicecall.c:ofono_voicecall_notify() Did not find a call with id: 1

From this it can be seen that the modem provided the same information to ofono, but the evaluation was different in the two cases. Maemo returns phone number type as 161, and clip_validity as 0, while postmarketOS returns 128 and 2, respectively, in the isi_call_notify function of drivers/isimodem/voicecall.c.

I would like to debug the issue further, and will appreciate any pointers that may help me.

Regards
Sicelo

[1] https://gitlab.com/postmarketOS/pmaports/-/issues/86

author
#1 lore raw

Hi

Quoted 7 lines · Sicelo

Hi

Since a number of versions ago, the Nokia N900 modem does not return anything to the list-operators command under Alpine/PostmarketOS [1]. With recent testing, it was found that even the CLIP is not displayed on an incoming call.

Quoted 8 lines

However, both list-operators and CLIP are working fine in Maemo Leste, a distribution derived from Debian.

The major difference between Maemo Leste and PostmarketOS is that the former is a glibc distro, while the latter uses musl. I am mentioning this in case it is useful, otherwise I have not yet found anything specific between the two libraries that could cause the observed differences.

The patch below fixes both issues (tested against ofono 1.34). Should I submit it as a real patch, or there is a possibility that it would negatively affect other systems?

The documentation for g_convert states "Using extensions such as “//TRANSLIT” may not work (or may not work well) on many platforms. Consider using g_str_to_ascii() instead."

Thanks for help.

Sincerely
Sicelo

gisi/iter.c +1 -1
index 3cc1ae37..f36d38a9 100644
@@ -257,7 +257,7 @@ gboolean g_isi_sb_iter_get_alpha_tag(const GIsiSubBlockIter *restrict iter,
        if (ucs2 + len > iter->end)
                return FALSE;
 
-       *utf8 = g_convert((const char *) ucs2, len, "UTF-8//TRANSLIT",
+       *utf8 = g_convert((const char *) ucs2, len, "UTF-8",
                                "UCS-2BE", NULL, NULL, NULL);
        return *utf8 != NULL;
 }
#2 lore raw

Hi Sicelo,

Quoted 6 lines
Quoted 6 lines

The major difference between Maemo Leste and PostmarketOS is that the former is a glibc distro, while the latter uses musl. I am mentioning this in case it is useful, otherwise I have not yet found anything specific between the two libraries that could cause the observed differences.

Yes, most likely musl doesn't provide iconv functionality. See man 3 iconv.

Quoted 4 lines

The patch below fixes both issues (tested against ofono 1.34). Should I submit it as a real patch, or there is a possibility that it would negatively affect other systems?

Please submit against upstream and use git-send-email.

Quoted 4 lines

The documentation for g_convert states "Using extensions such as “//TRANSLIT” may not work (or may not work well) on many platforms. Consider using g_str_to_ascii() instead."

Please use l_utf8_from_ucs2be instead.

Regards,
-Denis