| Reply | « Previous Thread | Next Thread » |
|
Hello,
i would bind an incoming call, executing a particular function when a call is coming (before the user answers). Is it possible? I found the way to bind keys events, but not this kind of event. Thanks, Renzo |
| renzogiust |
| View Public Profile |
| Find all posts by renzogiust |
|
Quote:
![]() Have you a 3rd or 2nd phone ? In 3rd Nokia has provided since PyS60 1.4.1 new feature for handling this case. Something like that should work (I haven't test it !) Code:
import appuifw
import e32
import telephone
appuifw.app.title = u'Incoming call Test'
def handle_call(state,incoming_call_number):
pass
def cb_calling(state,incoming_call_number):
if (state==telephone.EStatusRinging) and incoming_call_number==u"+1111111113":
handle_call(state,incoming_call_number)
def quit():
app_lock.signal()
appuifw.app.exit_key_handler= quit
app_lock=e32.Ao_lock()
telephone.call_state(cb_calling)
telephone.incoming_call()
app_lock.wait()
Try this : download SMSCoop in it there's a phone_ext.pyd extension. Install it in your phone. This extension provide similar functionalities. I hope that this answer could help you ![]() links SMSCoop Cyke64 pys60 1.4.5,1.9.7,pygame,PyS60 CE on E90 , N810 with Python 2.5.2 and ... last PyS60 1.9.7 with touch ui on 5800 ! pys60 extension modules on http://cyke64.googlepages.com/
Last edited by cyke64 : 2007-11-19 at 15:32.
Reason: typos sorry !
|
|
Thanks a lot Cyke64!
![]() I've a Nokia E65, so it should be a 3rd phone. Your example is very clear and useful: fantastic! ![]() I'll try it as soon as possible. Thank you again, Renzo |
| renzogiust |
| View Public Profile |
| Find all posts by renzogiust |
|
@renzo : I have tried my code but it doesn't work
![]() Perhaps another bug in PyS60 ? Until now I have seen no example of incoming call nor in official documentation nor in DiBo ![]() Is someone can try or fix this example ? Thanks Cyke64 pys60 1.4.5,1.9.7,pygame,PyS60 CE on E90 , N810 with Python 2.5.2 and ... last PyS60 1.9.7 with touch ui on 5800 ! pys60 extension modules on http://cyke64.googlepages.com/ |
|
Quote:
this works: Code:
import appuifw
import e32
import telephone
appuifw.app.title = u'Incoming call Test'
def handle_call(state):
appuifw.note(u"Chiamato", "info")
def cb_calling(state):
appuifw.note(unicode('0:' + str(state[0]) + ';1:' + str(state[1])), "info")
if (state[0]==telephone.EStatusRinging):
handle_call(state)
def quit():
app_lock.signal()
appuifw.app.exit_key_handler= quit
app_lock=e32.Ao_lock()
telephone.call_state(cb_calling)
#telephone.incoming_call()
app_lock.wait()
Renzo |
| renzogiust |
| View Public Profile |
| Find all posts by renzogiust |
|
Quote:
I wrote the code and you have discovered how to use argument in the callback ![]() Now it works on N93 ! Thanks to you ![]() This example is great use for everybody to understand new feature s in the telephone module ![]() BR Cyke64 pys60 1.4.5,1.9.7,pygame,PyS60 CE on E90 , N810 with Python 2.5.2 and ... last PyS60 1.9.7 with touch ui on 5800 ! pys60 extension modules on http://cyke64.googlepages.com/ |
|
Quote:
![]() Now i'm going to continue testing pyS60 features..! Bye, Renzo |
| renzogiust |
| View Public Profile |
| Find all posts by renzogiust |
|
whenever i use the telephone module and try to play a sound i get:
Traceback (most recent call last): File "<console>", line 1, in ? File "c:\resource\audio.py", line 83, in play raise SymbianError,(callback_error[0], SymbianError: [Errno -21] Error playing file: KErrAccessDenied any ideas of what and why is getting blocked? thanks |
|
Hi deepsight and welcome to the Fantastic Python DiBo
!Would you mind sharing your code so that we can make out your error and respond! Best Regards Croozeus |
|
any sample cource for 2nd edition?
|
|
What about for outgoing calls? is it possible to know the number I am dialing? I know when I am making a call, but not the number I am dialing
any ideas? code example? or a definite no, it can't be done with the current code |
| federico2929 |
| View Public Profile |
| Find all posts by federico2929 |
|
What about for outgoing calls? is it possible to know the number I am dialing? I know when I am making a call, but not the number I am dialing
any ideas? code example? or a definite no, it can't be done with the current code This is my example code for blocking all codes: import telephone def cb_calling(state): if (state[0]==telephone.EStatusRinging): handle_call(state) else: print "Not ringing yet" print state def handle_call(state): telephone.incoming_call() telephone.answer() print state telephone.call_state(cb_calling) |
| federico2929 |
| View Public Profile |
| Find all posts by federico2929 |
|
Hi,
I,m new in this forum and haven't done that much of python coding. I have a Nokia N95 8GB, and with this code sample below, I only get "incoming call" or "outgoing call". It should work but i does not on my phone. Anyone with a N95 8GB experiencing same problem? Thanks in advance. Code:
import appuifw import e32 import telephone def handleCall((callState, number)): if callState == telephone.EStatusRinging: if number == "": print "incoming call" else: print "call from " + number elif callState == telephone.EStatusDialling: if number == "": print "outgoing call" else: print "call to " + number 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"Call Manager" telephone.call_state(handleCall) app_lock.wait() |
|
Hello, I'm not sure if I have to open a new post, if so then excuse me and tranfer it.
So I have this code Code:
import appuifw import e32 import logs import audio import telephone filename = u'e:\\record.wav' def handleCall((callState, number)): if callState == telephone.EStatusRinging: if number == "xxxxxxxxx": # where xxx my number global S S=audio.Sound.open(filename) S.record() print u'Recording...' def closing(): try: global S S.stop() S.close() print u'Stopped.' except: print u'Nothing to stop.' def quit(): script_lock.signal() # appuifw.app.set_exit() appuifw.app.exit_key_handler = quit appuifw.app.menu = [(u"Stop", closing)] appuifw.app.title = u'Recorder' telephone.call_state(handleCall) script_lock = e32.Ao_lock() script_lock.wait() I'm new in python so be gentle ![]() Any ideas? Thanks! |
|
Quote:
Should it work on 2nd edition? I'll give a try... |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| how to simulate incoming call by Emulator?? test pragram listening call! | wjcrr | General Symbian C++ | 2 | 2007-05-12 00:11 |
| Active Objects & Incoming Call Problem | jguzman | General Symbian C++ | 5 | 2007-03-21 23:01 |
| Bring App to foreground on incoming call | ag24master | General Symbian C++ | 3 | 2006-06-30 14:00 |
| Error while accepting an incoming call | yogesh14 | Symbian Networking & Messaging | 1 | 2006-03-23 04:55 |
| Series 40 Sound and Incoming Call Confliction | jl1337 | Mobile Java Media (Graphics & Sounds) | 0 | 2005-11-09 06:17 |