Compare commits
No commits in common. "smsgwultimate" and "master" have entirely different histories.
smsgwultim
...
master
1 changed files with 13 additions and 11 deletions
24
mail2sms
24
mail2sms
|
@ -3,7 +3,7 @@
|
||||||
#
|
#
|
||||||
# Mail2SMS
|
# Mail2SMS
|
||||||
#
|
#
|
||||||
# Postfix transport to sending SMS by using SMS Gateway Ultimate Android App
|
# Postfix transport to sending SMS by using SMS Gateway Android App
|
||||||
#
|
#
|
||||||
# SMS recipients are detected in call arguments and To, CC and BCC
|
# SMS recipients are detected in call arguments and To, CC and BCC
|
||||||
# mail headers. The phone number detection mechamism look for a suite
|
# mail headers. The phone number detection mechamism look for a suite
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
# in master.cf :
|
# in master.cf :
|
||||||
#
|
#
|
||||||
# sms unix - n n - 1 pipe
|
# sms unix - n n - 1 pipe
|
||||||
# flags=Rq user=nobody:nogroup argv=/usr/local/sbin/mail2sms -H [SMS Host] -p [SMS Port] -s ${user}
|
# flags=Rq user=nobody:nogroup argv=/usr/local/sbin/mail2sms ${user}
|
||||||
#
|
#
|
||||||
# in transport :
|
# in transport :
|
||||||
#
|
#
|
||||||
|
@ -32,10 +32,13 @@
|
||||||
#
|
#
|
||||||
# Android App :
|
# Android App :
|
||||||
# * Install this app :
|
# * Install this app :
|
||||||
# https://play.google.com/store/apps/details?id=com.icecoldapps.smsgatewayultimate
|
# https://play.google.com/store/apps/details?id=eu.apksoft.android.smsgateway
|
||||||
# * In App
|
# * In App
|
||||||
# * Add SMS Gateway and keep attention on port
|
# * In Settings screen :
|
||||||
# * Start SMS gateway in main screen
|
# * check "Listen for HTTP send SMS commands"
|
||||||
|
# * check "Prevent CPU sleep mode" (adviced)
|
||||||
|
# * check "Start gateway automatically after phone boot" (adviced)
|
||||||
|
# * Start server in main screen
|
||||||
#
|
#
|
||||||
# Usage :
|
# Usage :
|
||||||
#
|
#
|
||||||
|
@ -141,9 +144,8 @@ def send_sms(recipient, text):
|
||||||
start=stop
|
start=stop
|
||||||
return True
|
return True
|
||||||
url_params={
|
url_params={
|
||||||
'smstype': 'sms',
|
'phone': recipient,
|
||||||
'smsto': recipient,
|
'text': text.encode('utf8')
|
||||||
'smsbody': text.encode('utf8')
|
|
||||||
}
|
}
|
||||||
if options.smspwd:
|
if options.smspwd:
|
||||||
url_params['password']=options.smspwd
|
url_params['password']=options.smspwd
|
||||||
|
@ -151,7 +153,7 @@ def send_sms(recipient, text):
|
||||||
url_parts=[
|
url_parts=[
|
||||||
'http',
|
'http',
|
||||||
'%s:%s' % (options.smshost, options.smsport),
|
'%s:%s' % (options.smshost, options.smsport),
|
||||||
'/send.html',
|
'/sendsms',
|
||||||
'',
|
'',
|
||||||
urlencode(url_params),
|
urlencode(url_params),
|
||||||
''
|
''
|
||||||
|
@ -165,7 +167,7 @@ def send_sms(recipient, text):
|
||||||
logging.fatal('Fail to open URL %s : %s' % (url,e))
|
logging.fatal('Fail to open URL %s : %s' % (url,e))
|
||||||
return False
|
return False
|
||||||
logging.debug(u'SMS gateway return : "%s"' % data)
|
logging.debug(u'SMS gateway return : "%s"' % data)
|
||||||
if re.search('The SMS has been sent', data):
|
if re.search('Mess?age SENT!', data):
|
||||||
return True
|
return True
|
||||||
logging.error('Fail to send SMS. Gateway return : "%s"' % data)
|
logging.error('Fail to send SMS. Gateway return : "%s"' % data)
|
||||||
return False
|
return False
|
||||||
|
@ -179,7 +181,7 @@ def check_gateway_status():
|
||||||
logging.fatal('Fail to open URL %s : %s' % (url,e))
|
logging.fatal('Fail to open URL %s : %s' % (url,e))
|
||||||
return False
|
return False
|
||||||
logging.debug(u'SMS gateway return : "%s"' % data)
|
logging.debug(u'SMS gateway return : "%s"' % data)
|
||||||
if re.search('Text:', data):
|
if re.search('Welcome to SMS Gateway', data):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue