Crogge
|
2012-08-23
, 21:14
|
Posts: 543 |
Thanked: 151 times |
Joined on Feb 2010
@ Germany
|
#21
|
The Following User Says Thank You to Crogge For This Useful Post: | ||
|
2012-08-23
, 21:21
|
|
Posts: 4,118 |
Thanked: 8,901 times |
Joined on Aug 2010
@ Ruhrgebiet, Germany
|
#22
|
|
2012-08-23
, 21:29
|
|
Posts: 4,118 |
Thanked: 8,901 times |
Joined on Aug 2010
@ Ruhrgebiet, Germany
|
#23
|
Great work, I always wanted to use my business SIM in my beloved N900. Is there any compatibility list which adapters are working / fitting into the N900?
The Following User Says Thank You to peterleinchen For This Useful Post: | ||
|
2012-08-23
, 22:47
|
Posts: 293 |
Thanked: 163 times |
Joined on Jan 2012
@ beijing-islamabad
|
#24
|
The Following User Says Thank You to imo For This Useful Post: | ||
|
2012-08-24
, 08:27
|
Posts: 61 |
Thanked: 64 times |
Joined on Oct 2007
@ EU
|
#25
|
Hey yrannadx,
one question at first:
my app is working for you? So using sim-switcher switches from SIM1 to SIM2 and vice versa?
How do you verify your script dows not switch back to SIM1?
Do not rely on operator name shown on hildon-home!
#!/bin/sh opcountry=$(dbus-send --system --print-reply=literal --dest=com.nokia.phone.net /com/nokia/phone/net \ Phone.Net.get_registration_status | tr '\n' ' ' | awk '{print $8,$10}') opcode=$(echo $opcountry | cut -f1 -d' ') countrycode=$(echo $opcountry | cut -f2 -d' ') dbus-send --system --print-reply --dest=com.nokia.phone.net /com/nokia/phone/net \ Phone.Net.get_operator_name byte:0 uint32:$opcode uint32:$countrycode | grep string \ | awk '{print $2 " " $3}' | tr -d \"
#!/bin/sh # Check no call in progress oncall=`run-standalone.sh dbus-send --system --type=method_call --print-reply=literal --dest=com.nokia.csd.Call /com/nokia/csd/call/1 com.nokia.csd.Call.Instance.GetStatus` if [ $oncall != "uint32 0" ]; then dbus-send --type=method_call --dest=org.freedesktop.Notifications /org/freedesktop/Notifications org.freedesktop.Notifications.SystemNoteDialog string:"No switch while oncall" uint32:0 string:"OK" return fi # Switch SIM opcode=`run-standalone.sh dbus-send --system --print-reply=literal --dest=com.nokia.phone.net /com/nokia/phone/net Phone.Net.get_registration_status | tr '\n' ' ' | awk '{print $8,$10}' | cut -f1 -d' '` # if operator code is from SIM1 switch to SIM2 if [ $opcode == 1 ]; then sim-switcher SIM2 else sim-switcher SIM1 fi
The Following 2 Users Say Thank You to yrannadx For This Useful Post: | ||
|
2012-08-24
, 22:23
|
|
Posts: 4,118 |
Thanked: 8,901 times |
Joined on Aug 2010
@ Ruhrgebiet, Germany
|
#26
|
Also I will check your suggested code improvements although I have doubts this will ever work after so many tests I made.
Sometimes I got the message "Please do NOT call me on already selected SIM ($1) !" which I shouldn't, maybe the currentSIM file got messed when using the command in my script. I think maybe the file is not updated when sim-switcher is run inside a script or maybe other reason.
...
The first switch went fine to SIM2, but then switch back to SIM1 failed and the phone remained with Operator2. This due to "Call not allowed" message when trying to make any call with SIM2. The same as before, I could switch back to SIM1 only after running killall csd. So it is quite clear that for some reason switching the SIM in any other way than from application icon will fail.
I would suggest an improvement in your application:
- possibility to use your script silently without pop-up messages, e.g. if I want to switch by Alarmed I don't want success messages to be displayed.
|
2012-08-25
, 09:05
|
|
Posts: 4,118 |
Thanked: 8,901 times |
Joined on Aug 2010
@ Ruhrgebiet, Germany
|
#27
|
The Following 4 Users Say Thank You to peterleinchen For This Useful Post: | ||
|
2012-08-26
, 22:40
|
|
Posts: 4,118 |
Thanked: 8,901 times |
Joined on Aug 2010
@ Ruhrgebiet, Germany
|
#28
|
|
2012-08-27
, 12:06
|
Posts: 61 |
Thanked: 64 times |
Joined on Oct 2007
@ EU
|
#29
|
The Following User Says Thank You to yrannadx For This Useful Post: | ||
|
2012-08-27
, 20:36
|
|
Posts: 4,118 |
Thanked: 8,901 times |
Joined on Aug 2010
@ Ruhrgebiet, Germany
|
#30
|
The Following User Says Thank You to peterleinchen For This Useful Post: | ||