0

I am using Putty to simulate my phone's modem connected via serial. When my phone receives a call it outputs 'RING' into putty but when the caller cancel the call Putty doesn't out put any response or result.

How would the modem know that the caller disconnect/cancelled the call, but not output it in putty?

Thanks

Dac
  • 210
  • 3
  • 19

2 Answers2

2

Most modems show the incoming phone number and a RING when a call is received and an END when the call is cancelled. To view the missed calls, you may use the following AT Commands.

AT+CPBS="MC"
AT+CPBR=1,99

First command tells the modem to look in the missed call phone book and the second command loads entries from 1 to 99. Note that this behavior is not standard. I was able to replicate this on a GSM module but not on my 3G modem. Try it on your modem and check if this works. All the best.

Aswin P J
  • 546
  • 4
  • 13
  • Just to clarify, the `MC` - missed calls - phonebook storage is in every way possible standard. However, the number of entries, e.g. 99, is completely manufacturer specific (and strictly speaking MC is only a `defined` storage value of AT+CPBR, and not specifically mandatory. However in practice absolutely all mobile phone manufactures supports this, but perhaps hardware dongles made by companies that do not also make mobile phones have a less sensible subset of supported standard AT commands? There exists zero good reasons for not supporting `MC` today though (and hardly did in early 90s)). – hlovdal Apr 23 '16 at 20:35
  • To find out which phonebook storages are supported and how many entries they support see the last example in chapter "8.57 Informative examples" in the [27.007 standard](http://www.3gpp.org/ftp/Specs/html-info/27007.htm) which both gives the commands and explains them. – hlovdal Apr 23 '16 at 20:39
  • Regarding the `END` result code this is not standard at al, there are no references to it in neither V.250 nor 27.007. The closest thing would be the `NO CARRIER` [double final result code](http://stackoverflow.com/a/15591673/23118) for voice calls initiated with ATD, but that is then not for incoming calls. – hlovdal Apr 23 '16 at 21:03
  • Thank you for your response. :) – Dac Apr 25 '16 at 07:38
2

To detect missed calls you can try three things.

Check if there is a suitable AT+CIND indicator you can turn on. I do not think call will do since I assume it only goes to 1 when the call is answered. If your phone supports callsetup or something similar that should be what you need (you will have to implement logic to detect when a call does not go to state active).

For an example of enabling AT+CIND indicators, see chapter "8.57 Informative examples" in 27.007 for more explanation, and pay close attention to The subparameter order in the command is defined by the query command order, e.g. if AT+CIND=? returns

+CIND: ("abc",(0-1)),("xyz",(0,1)),("call",(0,1))

then call is index 3, and for

+CIND: ("abc",(0-1)),("call",(0,1)),("xyz",(0,1))

call is index 2. Do not hard code any assumptions here, this should be parsed and checked run-time (one check at the beginning is enough).


Alternatively you can upon RING start polling call status with AT+CLCC until the call is no longer listed.


Or you could poll the MC phonebook storage and detect changes.

hlovdal
  • 26,565
  • 10
  • 94
  • 165
  • I used your second method. Every time my modem rings, I send the `AT+CLCC` and see if it returns something other than just `OK`. Thank you for your help. – Dac Apr 25 '16 at 07:38