Odoo Help

0

How to send SMS to mobile from openerp SMS Gateway

By
mozib khan
on 3/17/15, 2:22 AM 4,759 views


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.

I have canny service provider credentials.with out creating new module i can't perform this action??. by using sms_client Module? and i have created server and automated action also. message are coming in to openerp sms gateway->message queue. i want that message to come to my mobile. how can i do that? help me in that

mozib khan
on 3/20/15, 1:49 AM
2

Anil R. Kesariya

--Anil R. Kesariya--
4852
| 6 5 8
Gandhinagar, India
--Anil R. Kesariya--
ERP Consultant

Key Skill
-
Technical & Functional Expert
Anil R. Kesariya
On 3/17/15, 3:36 AM

Hello Mozib Khan,

There are no. of script available in python to send message to mobile.

Here you go! for the sample script.

Click Here 

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.

Rgds,

Anil.





1
Anand
On 3/18/15, 2:10 AM

I have developed one module to use way2sms api to send SMS.

But problem is that, in way2sms we can send only 100 SMS per day.

So its good to use 

twilio 

Its a good one but subscriptions charges are must... :)

I think your prob is solved.

0
Demirel yakito
On 3/20/15, 3:47 AM

import urllib2

import cookielib

from getpass import getpass

import sys

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')]

try:

usock = opener.open(url, data)

except IOError:

print "Error while logging in."

sys.exit(1)

jession_id = str(cj).split('~')[1].split(' ')[0]

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)]

try:

sms_sent_page = opener.open(send_sms_url, send_sms_data)

except IOError:

print "Error while sending message"

sys.exit(1)

print "SMS has been sent."

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 3/17/15, 2:22 AM
Seen: 4759 times
Last updated: 3/20/15, 4:19 AM