maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   How to get phone call status? (https://talk.maemo.org/showthread.php?t=58128)

karimko 2010-07-09 17:55

How to get phone call status?
 
Hello,

I would like to know the status of a phone call once programmatically started.

I know so far that i can start a call by:
Code:

dbus-send --system --type=method_call --print-reply --dest=com.nokia.csd.Call /com/nokia/csd/call com.nokia.csd.Call.CreateWith string:"$NUMBER" uint32:0
And i know that a call has been answered by:
Code:

bus.connect("com.nokia.csd.Call.Instance", "/com/nokia/csd/call/1", "com.nokia.csd.Call.Instance", "AudioConnect", this, SLOT(handleCall(const QDBusMessage&)))
But how do I know that the call has started and that the network is not busy or my contact isn't?:confused:

Are there more members in "com.nokia.csd.Call.Instance" other than "AudioConnect"?

Thanks

qwerty12 2010-07-09 21:18

Re: How to get phone call status?
 
dbus-send --system --type=method_call --print-reply --dest=com.nokia.csd.Call /com/nokia/csd/call/1 com.nokia.csd.Call.Instance.GetStatus

Retvals (AFAICT):
0 == no call in progress;
1 == call initiaited;
8 == call in progress (dial tones can be heard/recipient has picked up the phone)

karimko 2010-07-09 21:50

Re: How to get phone call status?
 
Thanks for taking intrest qwerty12!

Perhaps if I explain the purpose of my request things might become more clear. :)
I'm making a python script, which works on creating a missed call for the other party.
That is, it dials a number, waits for a "valid" dial tone to beep for say 2 seconds, then hangs up.

I got all the mechanics of creating the call and hanging it up and running.
The only problem is, how to distinguish between dialtones (Busy, No Service, etc...)? :confused:

Thanks again!

phedders 2010-07-09 22:01

Re: How to get phone call status?
 
Quote:

Originally Posted by karimko (Post 746585)
Thanks for taking intrest qwerty12!

Perhaps if I explain the purpose of my request things might become more clear. :)
I'm making a python script, which works on creating a missed call for the other party.
That is, it dials a number, waits for a "valid" dial tone to beep for say 2 seconds, then hangs up.

I got all the mechanics of creating the call and hanging it up and running.
The only problem is, how to distinguish between dialtones (Busy, No Service, etc...)? :confused:

Thanks again!

It's been a while, but can you not open the modem device, send "AT DT <number>" then wait for two "RING"s before sending a <CR> to end the call.

karimko 2010-07-09 22:18

Re: How to get phone call status?
 
Quote:

Originally Posted by phedders (Post 746594)
It's been a while, but can you not open the modem device, send "AT DT <number>" then wait for two "RING"s before sending a <CR> to end the call.

phedders, I just need a way to be able to make sure the two "RING"s are actual ones not busy tones, or out of service ones. I'm not familiar with modem commands but in your example, how do I distinguish the tones? Is there a commmand for that?

Thanks :)

karimko 2010-07-10 13:59

Re: How to get phone call status?
 
After some research I found that if I use modem commands using pnatd I could actually poll the status of the call.
Something like: atd<number>;
then poll every 500ms at+clcc

But i'm sure there is something neater than this.
How can I find out the members com.nokia.csd.Call.Instance?
So far I know there is AudioConnect... What else?

karimko 2010-07-10 16:09

Re: How to get phone call status?
 
Well peeps, I am giving up.

To give this thread closure I found a loop hole which I think is impossible to overcome.

The application I was intending to do was supposed to create a missed call for the party being called programatically. I have successfuly started a call then hung it up after x seconds, but the problem is that i couldn't figure out the status of the call (Ie. Busy, Out of service..)

I tried two approaches:
  • Dbus route: I found out that there is no way to find if the status of the call is busy, or anything else. I used the signal AudioConnect & looked at telephony-maemo.c to no avail.
  • AT commands via pnatd: I found that i could get busy & invalid number signals, but when the party has their phones turned off or no signal then it's impossible to know as the modem thinks it's still ringing. This helped me with AT commands.

Thanks qwerty12, & phedders for your suggestions.


All times are GMT. The time now is 15:57.

vBulletin® Version 3.8.8