I have install sms_client module in my data base. i am using openerp 7. i configured Gateway List in General tab Username,Password,Receipt No,SMS Mesage all this parameters. i am getting SMS in Message Queue status as Queued so, some one tell me how can i set automated action and schedular to get SMS to mobile.
Hello Mozib Khan,
There are no. of script available in python to send message to mobile.
Here you go! for the sample script.
The thing is you need to get register any message service provider, which might be not free.
Once you will have that service provider credential you can develop your own module and scheduler for this.
Hope this will help you.
from getpass import getpass
username = raw_input("Enter your login Username: ")
passwd = getpass()
message = raw_input("Enter Message: ")
number = raw_input("Enter Mobile number:")
message = "+".join(message.split(' '))
# Logging into the SMS Site
url = 'http://site24.way2sms.com/Login1.action?'
data = 'username=' + username + '&password=' + passwd + '&Submit=Sign+in'
# For Cookies:
cj = cookielib.CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
# Adding Header detail:
opener.addheaders = [('User-Agent', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36')]
usock = opener.open(url, data)
print "Error while logging in."
jession_id = str(cj).split('~').split(' ')
send_sms_url = 'http://site24.way2sms.com/smstoss.action?'
send_sms_data = 'ssaction=ss&Token=' + jession_id + '&mobile=' + number + '&message=' + message + '&msgLen=136'
opener.addheaders = [('Referer', 'http://site25.way2sms.com/sendSMS?Token=' + jession_id)]
sms_sent_page = opener.open(send_sms_url, send_sms_data)
print "Error while sending message"
print "SMS has been sent."
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 3/17/15, 2:22 AM|
|Seen: 3574 times|
|Last updated: 3/20/15, 4:19 AM|