subscribe to our Youtube


14455 questions

17168 answers


0 members

We are migrating to our new platform at Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
1,129 views 1 comments

I would like to get indications of incoming calls via HTTP POST / GET. I know that the interface currently only supports SMS.

Could you tell me if this is something I could implement myself with the SDK?

If yes, can you point me to right direction, how to do it?

What I need is to get a list of received calls with callers' numbers since last reading, similar to the list of received SMS.

Could I "hook" to the AT command socket without disturbing other functionality, or read from Event log (where the calls are also recorded), or read some tmp / var file?

Then, what is the best way to implement the web request / response? E.g. editing the already existing sms-utils script for SMS? Are there other files that I would need to modify?

1 Answer

+1 vote
by anonymous

cgi-bin can execute lua or C compiled files.

You can place your script or C program to /www/cgi-bin/ and don't forget to give it executable rights.

Modem do not save list of calls. The only place you can read it is events log.

Script header should contain continent type line, there is an example:

io.stdout:write("Content-Type: text/plain\r\n\r\n")

to access events log try:

eventslog -p -t EVENTS

you can write your own query for database it is sqlite based. Database is placed to /mnt/mtdblock7/log.db you can download and try to write queries in your PC.

Thanks for the tips!

I guess I could also use JSON RPC to read the event log, that would work with standard firmware, which is always a benefit.

I played with the eventslog command but I can't find documentation other than the --help usage.

Filtering with -n or --type doesn't seem to work. (It doesn't recognize the long option at all!)

This seems to do the trick:

eventslog -p -t EVENTS -q "WHERE NAME='Call'"

But is there a way to limit results to e.g. *last* ten lines (without piping the output to other tools, this is not possible over JSON RPC or is it)?

Using the limit option e.g. -l 10 gives the *first* ten lines.

I also tried negative numbers, -l "-10" and -l "-10,10", didn't work.

When the number of calls in log grows, it could eventually cause problems. Although realistically the log probably rotates before there are too many calls recorded.

EDIT: Figured this out already. This can be done with the db query.

E.g. "WHERE NAME='Call' ORDER BY Time DESC LIMIT 10" would output the last 10 entries, although in descending order (sub-queries to re-order is not possible?).

Or, if I have saved the timestamp of the last call event I have read, I could query new ones in ascending order: "WHERE NAME='Call' AND Time > 1234567890"