I've recently upgraded my N95 to firmware 30.0.015 and I'm experiencing a strange problem with messaging.sms_send() (PyS60 1.4.4). When I try to send an SMS, I will be able to send a single SMS and the next one will give me the exception "Already sending". If I then restart Python on the N95, I will then be able to send a message again but still ONLY a single one.

I thought this problem was strange so I decided to set the callback property. This gave me the result 0 and I wasn't even able to send a single message. What happened when using the callback property was the fact that my N95 kept showing the "sending" icon in the top right corner. I then had to restart the phone in order to make it disappear. I also checked if it added something to outbox/sent but it didn't.

Here's the definition that calls the code. Please note that I'm using dynamic code:

Code:
def phonethread(code):
	try:
		fn = "E:\\Python\\phone.py"
		fh = open(fn, "wb")
		fh.write(code)
		fh.close()
		execfile(fn, {}, {})
	except Exception, E:
		print str(E)
That definition is called with:

Code:
thread.start_new_thread(phonethread, (code, ))
Where the code variable is filled with content received from a remote server. The content (the script) that fails is the following:

Code:
import messaging
def cb(state):
	print "Message status: ", state
try:
	messaging.sms_send("+45<numberhidden>", "test", callback=cb)
except Exception, E:
	print str(E)
Where I've of course also tested it without the callback property.

If I run the phone.py script outside the main script, it will work every time. It must therefore be a problem with some global sms status checking. I'm not familiar with the PyS60 source so I don't know how it checks the SMS state (sending/receiving/...). I therefore hope that someone in here knows why it fails.