How to get phone number of SMS recipient in Android -
i have seen many questions asking how sms sender's phone number, not recipient's phone number. have used tool on site generate pdu , can see recipient's phone number in it:
useful pdu details , pdu translation tool
however, don't see anywhere in smsmessage class provided android can recipient's phone number. reason want have dual sim phone, don't see anywhere in android can determine sim port being used incoming sms. @ least, want @ each sms message , determine phone number sent to.
this question seems similar mine no answers:
how sms recipient's phone number in android
my question different because have detailed link site pdus, may useful extracting phone number form raw pdu bytes smsmessage class provides.
any ideas?
it depends point watch sms message. sms pdu lies on top of map protocol.
when send sms message, phone puts recipient number in tp-destination within pdu, when receive sms message, there no recipient number anywhere. reason how sms works. when sends sms, gsm network on side request srism message you, means hlr try find either in home network, or through home hlr. response hlr imsi number (your simcard) , vlr/msc number, sender network must send sms. in second packet, sms message (forward-mt), therefore imsi number. since have dual sim, can try find based on number, sim card sms destined. note imsi number not part of pdu rather lower map protocol.
Comments
Post a Comment