×

Discussion Board

Results 1 to 9 of 9

Hybrid View

  1. #1
    Registered User
    Join Date
    Jan 2004
    Posts
    15

    How to answer incoming call? telephone.answer not working

    I'm using 1.4.1 final on an E50.

    I'd like to use telephone.incoming_call() and telephone.answer() to answer an incoming call. The documentation says:

    incoming call()
    Wait for incoming call, returns immediately. If a call arrives, answer can be called to answer the call. Without the invocation of function incoming call, the function answer has no effect.

    answer()
    Answers an incoming call - see also incoming call.
    My app looks like this
    Code:
    import appuifw
    import e32
    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"};
    
    def handleCall((callState, number)):
        print "callState = "+STATES[callState]
    
        if callState == telephone.EStatusRinging:
          if number == "":
            print "incoming call"
          else:
            print "call from "+number
          telephone.answer()
        elif callState == telephone.EStatusAnswering:
          print "hanging up"
          telephone.hang_up()
        elif callState == telephone.EStatusDisconnecting:
          print "hung up"
    
    def quit():
        app_lock.signal()
    
    appuifw.app.exit_key_handler = quit
    
    app_lock=e32.Ao_lock()
    
    old_title = appuifw.app.title
    appuifw.app.title = u"Incoming"
    
    telephone.incoming_call()
    telephone.call_state(handleCall)
    
    print "waiting for a call"
    
    app_lock.wait()
    appuifw.app.title = old_title
    When a call comes in I see this in the console:

    waiting for a call
    callState = ringing
    incoming call
    (caller hangs up after 3 rings - the app did not answer the call)
    callState = disconnecting
    hung up
    callState = idle
    The call to telephone.answer() seems to have no effect. I have also tried calling it in other spots: before and after the call to telephone.call_state() and in the ringing case in handleCall. Has anyone else gotten telephone.answer() (or incoming_call()) to work?

    Thanks.

  2. #2
    Registered User
    Join Date
    Mar 2004
    Posts
    3

    Re: How to answer incoming call? telephone.answer not working

    Hi - no idea if this still requires an answer :-)
    but I just added some sleeps around the answer and it seems to work fine - maybe was trying to answer too quick ?

    Code:
          else: print "call from "+number
          e32.ao_sleep(1)
          telephone.answer()
          e32.ao_sleep(10)

  3. #3
    Registered User
    Join Date
    Feb 2005
    Location
    Belgium (Europe)
    Posts
    1,352

    Re: How to answer incoming call? telephone.answer not working

    There's another discussion about these new features in telephone module HERE

    Cyke64
    pys60 1.4.5 and 2.0.0, pygame, PyS60 CE on E90 and 5800 !

    Find my pys60 extension modules on cyke64.googlepages.com

  4. #4
    Registered User
    Join Date
    Jan 2004
    Posts
    15

    Re: How to answer incoming call? telephone.answer not working

    Thanks to you both for your replies. The calls to e32.ao_sleep(1) fixed the problem - thanks, ceejay.

    The new problem is that after my program answers the incoming call, it hangs: no keys have any effect. I have to remove the battery to exit the program (and all programs :-)).

  5. #5
    Regular Contributor
    Join Date
    Sep 2003
    Location
    Finland
    Posts
    209

    Re: How to answer incoming call? telephone.answer not working

    Quote Originally Posted by jellinek View Post
    The calls to e32.ao_sleep(1) fixed the problem - thanks, ceejay.

    The new problem is that after my program answers the incoming call, it hangs: no keys have any effect. I have to remove the battery to exit the program (and all programs :-)).
    There shouldn't be a need to add any sleeps to call answering, you might want to send a bug report on this to SourceForge (if there is a need for the sleeps, this should be at least documented to the API - thanks to ceejay for finding this out).

    The latter problem is worth while checking also, please include firmware information should you file a bug report on this. Unfortunately that is most probably something that we can't fix - rather the fix needs to be in firmware.

    Thanks in advance.

  6. #6
    Registered User
    Join Date
    Dec 2006
    Posts
    3

    Re: How to answer incoming call? telephone.answer not working

    The calls to e32.ao_sleep(1) fixed the problem - thanks,

    But the as soon as the Python code answer the incoming call.
    The script quite.

    Is there a way for the Python script to stay at background?


    Mike,
    www.gta-wireless.com

Similar Threads

  1. Error while accepting an incoming call
    By yogesh14 in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2006-03-23, 03:55
  2. Series 40 Sound and Incoming Call Confliction
    By jl1337 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2005-11-09, 05:17
  3. Series 40 Sound and Incoming Call Confliction
    By jl1337 in forum General Development Questions
    Replies: 0
    Last Post: 2005-11-08, 09:26
  4. Replies: 0
    Last Post: 2002-08-09, 23:03
  5. Replies: 0
    Last Post: 2002-08-08, 22:54

Posting Permissions

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