Setup:
sudo apt-get install ofono-phonesim-autostart
reboot
check if the modem-objpath with "mc-tool dump" is /phonesim (vs /ril_0), if it isn't:
mc-tool update ofono/ofono/account0 string:modem-objpath=/phonesim
mc-tool reconnect ofono/ofono/account0
To fake incoming call:
/usr/share/ofono/scripts/dial-number 199
or to fake incoming text:
mkdir /home/phablet/sms
echo 'tabSMS.gbMessage1.leMessageSender.text = "Yang";
tabSMS.gbMessage1.leSMSClass.text = "1";
tabSMS.gbMessage1.teSMSText.setPlainText("Sent from phonesim");
tabSMS.gbMessage1.pbSendSMSMessage.click();' > /home/phablet/sms/sms.js
export DBUS_SESSION_BUS_ADDRESS=`cat /run/lock/ofono-phonesim-dbus.address`
dbus-send --session --print-reply --dest=org.ofono.phonesim / org.ofono.phonesim.Script.SetPath string:/home/phablet/sms
dbus-send --session --print-reply --dest=org.ofono.phonesim / org.ofono.phonesim.Script.Run string:sms.js