Is it possible to get the phone number as a variable?

588 views
Skip to first unread message

kirsc...@gmail.com

unread,
Jun 21, 2016, 2:04:54 PM6/21/16
to Tasker
I use Tasker on many phones with many SIM-cards (all of them are Dual-SIM by the way). For the sake of consistency I use the same identical Tasker-configurations for all the phones...

Depending on which SIM-card(s) is in the phone I want to set conditions to determine whether a specific phone with as specific SIM-card is allowed to do something (activate mobile data, activate tethering, etc.).

So, is there a way to identify which SIM-card / telephone number is currently in the phone? If yes, what about DUAL-SIM phones?

Robert Ryan

unread,
Jun 21, 2016, 3:03:41 PM6/21/16
to Tasker
The Phone Number should be in %PNUM and the SIM Serial Number should be in %SIMNUM. 

kirsc...@gmail.com

unread,
Jun 21, 2016, 3:23:26 PM6/21/16
to Tasker
Many thanks, Robert Ryan... I will test it... I am wondering how/whether DUAL-SIM is handled resp. ignored... This was what I was looking for... and in fact... I am an idiot... it's mentioned in the documentation... :-)

kirsc...@gmail.com

unread,
Jun 21, 2016, 3:49:46 PM6/21/16
to Tasker
I just tested it:

%SIMNUM is reliable... so you can do e.g. an if-condition like: if  %SIMNUM matches *12345
%PNUM seems to be dependent on the SIM-card... on some SIM-Cards the value is empty... but %SIMNUM is sufficient to identify the SIM-card...


Am Dienstag, 21. Juni 2016 21:03:41 UTC+2 schrieb Robert Ryan:

Pent

unread,
Jun 22, 2016, 3:56:40 AM6/22/16
to Tasker

%PNUM seems to be dependent on the SIM-card... on some SIM-Cards the value is empty... but %SIMNUM is sufficient to identify the SIM-card...

In the %PNUM description:

>On some phones it doesn't work (Android limitation), seems related to the type of SIM.

Pent

kirsc...@gmail.com

unread,
Jun 22, 2016, 4:42:06 AM6/22/16
to Tasker
Yes, Pent, I've read this... my specific phone number does not even show up in the phone settings within Android...  so no problem with that... Tasker could do what I wanted: to uniquely identify my phone-SIM via %SIMNUM... that did the job for me...
Reply all
Reply to author
Forward
0 new messages