×

Discussion Board

Results 1 to 2 of 2

Hybrid View

  1. #1
    Registered User
    Join Date
    Nov 2008
    Location
    Finland (Tampere, Hervanta)
    Posts
    41

    Get number of a caller while caller is calling

    hi, I've looked around for this, really I have, but can't find how to get the phone number of a caller while the caller is calling (or maybe even when the call is connected if that's not possible).

    Thanks.
    Last edited by r3bol; 2010-05-31 at 17:06.
    Developing on an E50, S60 3rd Ed. (initial release) -- PyS60 1.4.5 -- My website: http://rebol.vlexo.net

  2. #2
    Registered User
    Join Date
    Nov 2008
    Location
    Finland (Tampere, Hervanta)
    Posts
    41

    Re: Get number of a caller while caller is calling

    Not to worry :P I think i found what i needed from: http://developer.symbian.org/wiki/in..._and_Messaging

    Code:
    import telephone, contacts
    import appuifw, e32, graphics, topwindow
     
    #--------------------------------------------------------------------------------
    #  This function is called when a phone call is made.  It does the
    #  contact lookup and the display of the info window.
    #--------------------------------------------------------------------------------
     
    def displayNotes(infoTuple):
     
        # Get the phone's state
        phoneState = infoTuple[0]
     
        # Only react when the phone is ringing
        if phoneState == telephone.EStatusRinging:
     
            # Start by opening the contacts database and looking up the phone number
            db = contacts.open()
            contactList = db.find(infoTuple[1])
     
            # Build the list of notes in a string, separated by "\n"
            noteString = ""
            if contactList:
                try:
                    for note in contactList[0].find(type='note'):
                        if len(noteString)>0:
                            noteString = noteString + "\n" + note.value
                        else:
                            noteString = note.value
                except:
                    noteString = u"No notes available"
            else:
                noteString = u"The phone number was not found"
     
            # Now we build the topwindow window from the notes
            notes = noteString.split("\n")
            window = topwindow.TopWindow()
            window.size = (350, 40+(30*len(notes)))
            window.position = (10, 40)
            img = graphics.Image.new((310, 30*len(notes)))
            img.clear(0x99CCFF)
            position = 20
            for note in notes:
                img.text((20, position), unicode(note), font = 'title')
                position += 30
            window.add_image(img, (20, 20))
            window.background_color = 0xDDDDDD
            window.shadow = 4
            window.corner_type = 'corner5'
     
            # Display the window and sleep for 5 seconds.  Then hide it.
            window.show()
            e32.ao_sleep(5)
            window.hide()
     
    # Finally, install the function as the phone callback
    telephone.call_state(displayNotes)
    Developing on an E50, S60 3rd Ed. (initial release) -- PyS60 1.4.5 -- My website: http://rebol.vlexo.net

Similar Threads

  1. How to get the phone number that calling me?
    By suiying0792 in forum Symbian
    Replies: 9
    Last Post: 2009-09-27, 04:26
  2. Caller id number in case of incoming CSD call
    By mtc95172003 in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2009-08-31, 02:51
  3. Replies: 99
    Last Post: 2009-02-27, 10:19
  4. how to simulate incoming call or calling a number?
    By wjcrr in forum Symbian Tools & SDKs
    Replies: 5
    Last Post: 2007-05-11, 14:38
  5. Retrieving caller number again. I'm going crazy!
    By EricDrew in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2004-04-21, 02:48

Posting Permissions

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