You Are Here:

Community: Developer Discussion Boards

#1 Old Unhappy Phonebook request by SMS but gives error.. - 2006-11-03, 18:18

Join Date: Aug 2004
Posts: 146
krtrivdi's Avatar
krtrivdi
Offline
Forum Nokia Champion
Hi all

I have written a small code, The purpose of the code is that if i want to get any mobile number from my mobile when it is with someone else, i can send an sms by the name of the contact as keyword via sms to my own number.

The code will serach for that contact in phonebook and will create an sms, will send back to the number (here i have written that sms is to be sent to the searched number). After sending an sms it will miscall on that number too.

Now the problem is: everthing works fine !!!! but when the sms is sent it should be stored in sent items but if the Messaging application is not in forground the sent item sms disappears from sent items, if the messaging application is at the forground if i m looking at outbox and then sent items the sms gets stored. Why such funny problem?

Another problem is that after finishing the job my interpreter gives following error: what is the meanig of it?
  • SymbainError: [Errno-2] KErrGeneral

The code :

import messaging
import appuifw
import socket
from messaging import *
import contacts
import time
import e32
import string
import telephone
import inbox

i =inbox.Inbox()
m = i.sms_messages()
re_number=i.content(m[0])
nam=i.content(m[0])
nam=string.upper(nam)
d = i.address(m[0])
appuifw.note(u'SMS Received From ' + unicode(d))
appuifw.note(unicode(d)+u' has requested for '+ unicode(nam) +u's number')
db=contacts.open()
f=db.find(re_number)
k=f[0]
mobile=k.find('mobile_number')[0].value
appuifw.note(u'Number Found:' + u'\n'+unicode(mobile))

messaging.sms_send(unicode(mobile),u'The requested number of '+ unicode(nam)+ u' is: ' + unicode(mobile)+u'\n\n\nTEST SMS: Please Ignore')
e32.ao_sleep(2)
appuifw.note(u'Message Sent...', u'conf')

e32.ao_sleep(1)
telephone.dial(mobile)
e32.ao_sleep(5)
telephone.hang_up()
e32.ao_sleep(1)


I hope i will get to run it prefectly without error and the sent items problem will also be solved

Thanks

Kiran trivedi
Last edited by krtrivdi : 2006-11-03 at 18:24. Reason: needed some changes paste wrong code
Reply With Quote

#2 Old Re: Phonebook request by SMS but gives error.. - 2006-11-03, 18:22

Join Date: Aug 2004
Posts: 146
krtrivdi's Avatar
krtrivdi
Offline
Forum Nokia Champion
One more thing while working with code: if i remove

k=f[0] then the program gives error: i refered the code provided by Nokia and add this to my code: so it works fine, what exactly this k=f[0] does?

thanks

Kiran
Reply With Quote

#3 Old Re: Phonebook request by SMS but gives error.. - 2006-11-03, 21:10

Join Date: Feb 2005
Posts: 1,353
Location: Belgium (Europe)
cyke64's Avatar
cyke64
Offline
Super Contributor
hello ,

Next time use code tag for code examples

Code:
import messaging
import appuifw
import socket
from messaging import *
import contacts
import time
import e32
import string
import telephone
import inbox

i =inbox.Inbox()
m = i.sms_messages()
re_number=i.content(m[0])
nam=i.content(m[0])
nam=string.upper(nam)
d = i.address(m[0])
appuifw.note(u'SMS Received From ' + unicode(d))
appuifw.note(unicode(d)+u' has requested for '+ unicode(nam) +u's number')
db=contacts.open()
f=db.find(re_number)
k=f[0]
mobile=k.find('mobile_number')[0].value
appuifw.note(u'Number Found:' + u'\n'+unicode(mobile))

messaging.sms_send(unicode(mobile),u'The requested number of '+ unicode(nam)+ u' is: ' + unicode(mobile)+u'\n\n\nTEST SMS: Please Ignore')
e32.ao_sleep(2)
appuifw.note(u'Message Sent...', u'conf')

e32.ao_sleep(1)
telephone.dial(mobile)
e32.ao_sleep(5)
telephone.hang_up()
e32.ao_sleep(1)
I download your code and try on my mobiles
Comments soon


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/
Reply With Quote

#4 Old Re: Phonebook request by SMS but gives error.. - 2006-11-04, 05:49

Join Date: Aug 2004
Posts: 146
krtrivdi's Avatar
krtrivdi
Offline
Forum Nokia Champion
thanks cyke

actually i tried but there are php tags. where is the tag for code


||Kiran ||
Nokia E-65
Nokia 7610
Nokia N95 8GB
Nokia E90
Nokia 5110 !!
Nokia 6110i !!
Reply With Quote

#5 Old Re: Phonebook request by SMS but gives error.. - 2006-11-06, 13:04

Join Date: May 2006
Posts: 622
Location: Oulu, Finland
lfd
Offline
Super Contributor
it's the little ' # ' button


Devices:
Nokia E61 3rd Edition - pys60 1.4.0

Tips and modules:
http://www.lfdm.net/thesis
Reply With Quote

#6 Old Re: Phonebook request by SMS but gives error.. - 2006-11-06, 13:15

Join Date: Aug 2004
Posts: 146
krtrivdi's Avatar
krtrivdi
Offline
Forum Nokia Champion
what??? where is # in the code?>


||Kiran ||
Nokia E-65
Nokia 7610
Nokia N95 8GB
Nokia E90
Nokia 5110 !!
Nokia 6110i !!
Reply With Quote

#7 Old Re: Phonebook request by SMS but gives error.. - 2006-11-06, 13:17

Join Date: Aug 2004
Posts: 146
krtrivdi's Avatar
krtrivdi
Offline
Forum Nokia Champion
Code:
oh you mean this ok ok, i thougth error in code due to # sign
thanks i will use this tag now onwards. please reply my questions i have many questions asked but nobody replies.


||Kiran ||
Nokia E-65
Nokia 7610
Nokia N95 8GB
Nokia E90
Nokia 5110 !!
Nokia 6110i !!
Reply With Quote

#8 Old Re: Phonebook request by SMS but gives error.. - 2006-11-17, 18:12

Join Date: Sep 2003
Posts: 25
joyce973
Offline
Registered User
Hi, I found this subject very interesting. I'm also involved in writing an application which reads SMS from the inbox. I successfully tried the cyke64's example, but it also happened something wrong:
it correctly shows the sender's name/number and the message text, but finally it also says:
"Python\my\sms3.py", line 22, in ?
k=f[0]
IndexError: list index out of range.
how comes? Is there some issue in the example code or something else?
thanks in advance.
Antonio
Reply With Quote

#9 Old Re: Phonebook request by SMS but gives error.. - 2006-11-17, 20:26

Join Date: Aug 2004
Posts: 146
krtrivdi's Avatar
krtrivdi
Offline
Forum Nokia Champion
hi, it has been a long time but nobody has replied to this issue, i am surprised why great python developers are silent to this question? please help


||Kiran ||
Nokia E-65
Nokia 7610
Nokia N95 8GB
Nokia E90
Nokia 5110 !!
Nokia 6110i !!
Reply With Quote

#10 Old Re: Phonebook request by SMS but gives error.. - 2006-11-17, 21:19

Join Date: Sep 2003
Posts: 25
joyce973
Offline
Registered User
Hi, I did a mystake. Now it works. .. the problem was that I had no names in the address book, so the second part of the program did not find anything to search for. Anyway, now it does not give any error.
Krtrivdi, I'm sorry but I don't understand what is your question. Please explain it to me, then I will be happy to help you, if possible.
Antonio
Reply With Quote

#11 Old Re: Phonebook request by SMS but gives error.. - 2006-11-18, 08:42

Join Date: Aug 2004
Posts: 146
krtrivdi's Avatar
krtrivdi
Offline
Forum Nokia Champion
Thanks Joyce for interecting with this issue: My difficulty is

the problem is: everthing works fine !!!! but when the sms is sent it should be stored in sent items but if the Messaging application is not in forground the sent item sms disappears from sent items, if the messaging application is at the forground if i m looking at outbox and then sent items the sms gets stored. Why such funny problem?

Another problem is that after finishing the job my interpreter gives following error: what is the meanig of it?

* SymbainError: [Errno-2] KErrGeneral


||Kiran ||
Nokia E-65
Nokia 7610
Nokia N95 8GB
Nokia E90
Nokia 5110 !!
Nokia 6110i !!
Reply With Quote

#12 Old Re: Phonebook request by SMS but gives error.. - 2006-11-20, 10:18

Join Date: Sep 2003
Posts: 25
joyce973
Offline
Registered User
Hi, sorry but I don't know what is this trouble due to.
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
[newbie here] Link error xitpu General Symbian C++ 3 2007-01-24 17:53
carbide build problem help please berkcekisbas Carbide.c++ IDE and plug-ins 1 2006-09-26 20:41
problem with the XML Parser SyExpat Vitaly_iva General Symbian C++ 2 2006-06-05 12:09
新手求救!錯誤訊息! wgarnett Symbian 2 2005-09-26 03:21
sms coding error boogieeee Symbian Tools & SDKs 1 2004-07-21 10:32

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