Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing to grab SMSC in some cases #21

Open
phhusson opened this issue Jun 25, 2024 · 3 comments
Open

Failing to grab SMSC in some cases #21

phhusson opened this issue Jun 25, 2024 · 3 comments

Comments

@phhusson
Copy link
Owner

06-06 10:11:12.892  6091  6209 D PHH SipHandler: Got smsc , match null
06-06 10:11:12.892  6091  6209 E Phh ImsSms: Failed sending sms
06-06 10:11:12.892  6091  6209 E Phh ImsSms: java.lang.NullPointerException
06-06 10:11:12.892  6091  6209 E Phh ImsSms: 	at me.phh.sip.SipHandler.sendSms(SipHandler.kt:1529)
06-06 10:11:12.892  6091  6209 E Phh ImsSms: 	at me.phh.ims.PhhImsSms.sendSms(PhhImsSms.kt:53)
06-06 10:11:12.892  6091  6209 E Phh ImsSms: 	at android.telephony.ims.feature.MmTelFeature.sendSms(MmTelFeature.java:1808)
06-06 10:11:12.892  6091  6209 E Phh ImsSms: 	at android.telephony.ims.feature.MmTelFeature.-$$Nest$msendSms(Unknown Source:0)
06-06 10:11:12.892  6091  6209 E Phh ImsSms: 	at android.telephony.ims.feature.MmTelFeature$1.lambda$sendSms$19(MmTelFeature.java:303)
06-06 10:11:12.892  6091  6209 E Phh ImsSms: 	at android.telephony.ims.feature.MmTelFeature$1.$r8$lambda$hhASksHvkNfFTYA95Fl5MRrE36I(Unknown Source:0)
06-06 10:11:12.892  6091  6209 E Phh ImsSms: 	at android.telephony.ims.feature.MmTelFeature$1$$ExternalSyntheticLambda22.run(D8$$SyntheticClass:0)
06-06 10:11:12.892  6091  6209 E Phh ImsSms: 	at com.android.internal.telephony.util.TelephonyUtils.runWithCleanCallingIdentity(TelephonyUtils.java:112)
06-06 10:11:12.892  6091  6209 E Phh ImsSms: 	at android.telephony.ims.feature.MmTelFeature$1.lambda$executeMethodAsyncNoException$33(MmTelFeature.java:418)
06-06 10:11:12.892  6091  6209 E Phh ImsSms: 	at android.telephony.ims.feature.MmTelFeature$1$$ExternalSyntheticLambda33.run(D8$$SyntheticClass:0)
06-06 10:11:12.892  6091  6209 E Phh ImsSms: 	at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1780)
06-06 10:11:12.892  6091  6209 E Phh ImsSms: 	at android.app.PendingIntent$$ExternalSyntheticLambda0.execute(D8$$SyntheticClass:0)
06-06 10:11:12.892  6091  6209 E Phh ImsSms: 	at java.util.concurrent.CompletableFuture.asyncRunStage(CompletableFuture.java:1794)
06-06 10:11:12.892  6091  6209 E Phh ImsSms: 	at java.util.concurrent.CompletableFuture.runAsync(CompletableFuture.java:2009)
06-06 10:11:12.892  6091  6209 E Phh ImsSms: 	at android.telephony.ims.feature.MmTelFeature$1.executeMethodAsyncNoException(MmTelFeature.java:417)
06-06 10:11:12.892  6091  6209 E Phh ImsSms: 	at android.telephony.ims.feature.MmTelFeature$1.sendSms(MmTelFeature.java:302)
06-06 10:11:12.892  6091  6209 E Phh ImsSms: 	at android.telephony.ims.aidl.IImsMmTelFeature$Stub.onTransact(IImsMmTelFeature.java:506)
06-06 10:11:12.892  6091  6209 E Phh ImsSms: 	at android.os.Binder.execTransactInternal(Binder.java:1501)
06-06 10:11:12.892  6091  6209 E Phh ImsSms: 	at android.os.Binder.execTransact(Binder.java:1440)

I don't know what we're supposed to do in that case. Can we send an SMS without a SMSC?
Are we supposed to try another way to reach the SMSC? Or maybe just fill in garbage and the IMS server will know anyway

@martinetd
Copy link
Contributor

Oh, I somehow hadn't noticed the code trying to get the smsc from sms manager...
For my provider the smsc we're guessing from the system is completely wrong anyway and the samsung rom was getting it by querying the SIM for "PSISMSC" which I don't see how to get from the system as of my old system version (lineage-20 so android 13)

Looking it up on github code search now I'm getting hits like this:
https://github.com/Reginer/aosp-android-jar/blob/21d16b10c92ccef73b5d6039a900db6b32ff7871/android-34/src/com/android/internal/telephony/uicc/IccRecords.java#L1366
which are promising (android-34 is android 14, so perhaps a current system has it?)

If android 14 has a normal way of querying this that is likely the way to go (or at least yet another place to check if the system doesn't provide it for us automatically); I don't have an android 14 tree locally to check.

@phhusson
Copy link
Owner Author

Okay so looks like we should be able to just replace smsManager.getSmscAddress with smsManager.getSmscIdentity...?

That sounds a tad weird, but I guess I can live with that. I'll try it.

Thanks for the info

@phhusson
Copy link
Owner Author

Looks like a fail. getSmscIdentity returns an empty URL on my Free Mobile sim card

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants