Go Back   maemo.org - Talk > OS / Platform > Development
 
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
  #1  
Old 2010-07-09, 17:55
karimko karimko is offline
 
Join Date: Jun 2010
Location: Lebanon
Posts: 46
Thanks!: 24
Thanked 31 Times in 14 Posts
Default 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?

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

Thanks
Reply With Quote
  #2  
Old 2010-07-09, 21:18
qwerty12's Avatar
qwerty12 qwerty12 is offline
 
Join Date: Sep 2007
Location: Looking at y'all and sighing
Posts: 4,274
Thanks!: 5,528
Thanked 5,358 Times in 1,954 Posts
Default 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)
Reply With Quote
The Following 3 Users Say Thank You to qwerty12 For This Useful Post:
  #3  
Old 2010-07-09, 21:50
karimko karimko is offline
 
Join Date: Jun 2010
Location: Lebanon
Posts: 46
Thanks!: 24
Thanked 31 Times in 14 Posts
Default 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...)?

Thanks again!
Reply With Quote
  #4  
Old 2010-07-09, 22:01
phedders phedders is offline
 
Join Date: Nov 2009
Posts: 155
Thanks!: 121
Thanked 61 Times in 37 Posts
Default Re: How to get phone call status?

Quote:
Originally Posted by karimko View Post
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...)?

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.
Reply With Quote
The Following 2 Users Say Thank You to phedders For This Useful Post:
  #5  
Old 2010-07-09, 22:18
karimko karimko is offline
 
Join Date: Jun 2010
Location: Lebanon
Posts: 46
Thanks!: 24
Thanked 31 Times in 14 Posts
Default Re: How to get phone call status?

Quote:
Originally Posted by phedders View Post
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
Reply With Quote
  #6  
Old 2010-07-10, 13:59
karimko karimko is offline
 
Join Date: Jun 2010
Location: Lebanon
Posts: 46
Thanks!: 24
Thanked 31 Times in 14 Posts
Default 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?
Reply With Quote
  #7  
Old 2010-07-10, 16:09
karimko karimko is offline
 
Join Date: Jun 2010
Location: Lebanon
Posts: 46
Thanks!: 24
Thanked 31 Times in 14 Posts
Default 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.
Reply With Quote
The Following User Says Thank You to karimko For This Useful Post:
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 19:39.