You Are Here:

Community: Developer Discussion Boards

#1 Old Talking More details on call_state - 2009-01-24, 11:11

Join Date: Sep 2008
Posts: 37
RickTheGreat
Offline
Registered User
Hello Everyone,

I am looking for detail information about call_state. I know that the call_state is a Tuple of which the first is the call state, and the second is confusing. Please provide more information on the second part of the Tuple.

I have read that the second part of the Tuple is the number of an incoming call. What is the call_state for an outgoing call (is it the outgoing call phone number)??

RickTheGreat
Reply With Quote

#2 Old Re: More details on call_state - 2009-01-24, 16:11

Join Date: Feb 2008
Posts: 743
Location: Belo Horizonte, Brazil
Send a message via Skype™ to Rafael T.
Rafael T.'s Avatar
Rafael T.
Offline
Forum Nokia Champion
Quote:
Originally Posted by RickTheGreat View Post
Hello Everyone,

I am looking for detail information about call_state. I know that the call_state is a Tuple of which the first is the call state, and the second is confusing. Please provide more information on the second part of the Tuple.

I have read that the second part of the Tuple is the number of an incoming call. What is the call_state for an outgoing call (is it the outgoing call phone number)??

RickTheGreat
Actually it's not a tuple. The call states are variables from telephone module to detect if the telephone is ringing, disconnecting, answering, etc. Some people like to group them inside a dictionary:

Code:
import telephone

STATES = {telephone.EStatusUnknown:          "unknown",
          telephone.EStatusIdle:             "idle",
          telephone.EStatusDialling:         "dialing",
          telephone.EStatusRinging:          "ringing",
          telephone.EStatusAnswering:        "answering",
          telephone.EStatusConnecting:       "connecting",
          telephone.EStatusConnected:        "connected",
          telephone.EStatusReconnectPending: "reconnect pending",
          telephone.EStatusDisconnecting:    "disconnecting",
          telephone.EStatusHold:             "hold",
          telephone.EStatusTransferring:     "transferring",
          telephone.EStatusTransferAlerting: "transfer alerting"};

BR,

Rafael.
Reply With Quote

#3 Old Talking Re: More details on call_state - 2009-01-24, 17:41

Join Date: Sep 2008
Posts: 37
RickTheGreat
Offline
Registered User
Hello,

According to "Pys60 Library Reference Release 1.4.5 Final", page 53.

Link to document -->

http://downloads.sourceforge.net/pys...3&big_mirror=0

Clearly states that the argument for the callable is a tuple (see below).

call state(callable)
The callable will be called when there are changes in the telephone line (lines) in the device. The
argument for the call is a tuple with rst item the possible new state and the second item, the
possible incoming call number as a Unicode string.

The possible states in the tuple are defned as telephone module constants.

Can someone tell me what the components of the tuple are. I know that the first one is the status of the phone line, but not what the second component is.

RickTheGreat
Reply With Quote

#4 Old Re: More details on call_state - 2009-01-24, 19:55

Join Date: Feb 2008
Posts: 743
Location: Belo Horizonte, Brazil
Send a message via Skype™ to Rafael T.
Rafael T.'s Avatar
Rafael T.
Offline
Forum Nokia Champion
Sorry, but the variables of call state are not a tuple

It seems that call_state() passes a tuple to the callable argument

But the call state variables are not tuples! If you try printing the variables, you will see that it returns an integer:

Code:
import telephone

print telephone.EStatusIdle # prints 1
print telephone.EStatusHold # prints 9
You may see the content of the tuple by printing them too:

Code:
import e32, telephone

STATES = {telephone.EStatusUnknown:          "unknown",
          telephone.EStatusIdle:             "idle",
          telephone.EStatusDialling:         "dialing",
          telephone.EStatusRinging:          "ringing",
          telephone.EStatusAnswering:        "answering",
          telephone.EStatusConnecting:       "connecting",
          telephone.EStatusConnected:        "connected",
          telephone.EStatusReconnectPending: "reconnect pending",
          telephone.EStatusDisconnecting:    "disconnecting",
          telephone.EStatusHold:             "hold",
          telephone.EStatusTransferring:     "transferring",
          telephone.EStatusTransferAlerting: "transfer alerting"};

def handlecall((callState, number)):
    print "callState = "+STATES[callState]
    print "call from "+number
    
    if callState == telephone.EStatusRinging:
        telephone.asnwer()
      
    elif callState == telephone.EStatusAnswering:
      print "hanging up"
      telephone.hang_up()
    elif callState == telephone.EStatusDisconnecting:
      print "hung up"


telephone.incoming_call()
telephone.call_state(handlecall)

app_lock = e32.Ao_lock()
app_lock.wait()
PS: didn't test it, but should work ...

You may also want to check this tutorial.



Hope it helps,

Rafael.
Last edited by Rafael T. : 2009-01-24 at 20:26.
Reply With Quote

#5 Old Talking What are the elements of the tuple? - 2009-01-24, 23:34

Join Date: Sep 2008
Posts: 37
RickTheGreat
Offline
Registered User
Hello Rafael T.,

Thanks for the quick response to my questions. I am still un-sure of what the elements of the tuple are in this situation. I believe the first element is the Line Status, and I think the second element is the phone number of the outgoing call. I want to be able to review the outgoing phone number of a call being place (dialed) on a cell phone.

My question are still:
1. What are the elements of the tuple?
2. Are the elements of the tuple the Line Status and the Phone Number of the outgoing call?

I have reviewed some of the coding on the web site and it seem to indicate that the second element in the tuple is the outgoing phone number. Please tell me if this is true.

Regards,

RickTheGreat
Reply With Quote

#6 Old Re: What are the elements of the tuple? - 2009-01-25, 03:09

Join Date: Feb 2008
Posts: 743
Location: Belo Horizonte, Brazil
Send a message via Skype™ to Rafael T.
Rafael T.'s Avatar
Rafael T.
Offline
Forum Nokia Champion
Quote:
Originally Posted by RickTheGreat View Post
Hello Rafael T.,

Thanks for the quick response to my questions. I am still un-sure of what the elements of the tuple are in this situation. I believe the first element is the Line Status, and I think the second element is the phone number of the outgoing call. I want to be able to review the outgoing phone number of a call being place (dialed) on a cell phone.

My question are still:
1. What are the elements of the tuple?
2. Are the elements of the tuple the Line Status and the Phone Number of the outgoing call?

I have reviewed some of the coding on the web site and it seem to indicate that the second element in the tuple is the outgoing phone number. Please tell me if this is true.

Regards,

RickTheGreat
The elements of the tuple are the call satate and the number. But this code is for an incoming call. No extended code for outgoing calls and it's not possible to get the number that the user dialed (unless he makes the call using your application), sorry
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
While reading callLog i am only getting the voice call details, no details about sms dejies General Symbian C++ 4 2009-01-20 01:29
[moved]How to get software details from mobile device using j2me api or any other api azar_sheik Mobile Java General 5 2008-08-29 07:22
Symbian C++ - Series 60 - How can i extract details for an SMS message? periakaruppan Symbian User Interface 2 2005-09-05 08:40
Symbian C++ - Series 60 - How can i extract details for an SMS message? periakaruppan Symbian Networking & Messaging 2 2005-08-03 03:18
"Web Address" setting in Midlet Details jinja2 Mobile Java General 0 2004-12-08 02:21

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia