...
[alex.git] / supervision / sendsms.py
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3
4 # Script envoie de SMS, pack SMS OVH, API SOAP
5 # Option a ajouter : controler le nombre de SMS disponible
6 # Attention, les varaibles sont dans le fichier conf.py
7
8 import pprint
9 from SOAPpy import WSDL
10 from conf import *
11
12 soap = WSDL.Proxy('https://www.ovh.com/soapi/soapi-re-1.21.wsdl')
13
14 #login
15 session = soap.login(cptovh, pwdovh, 'fr', 0)
16 #print "login successfull"
17
18 def smsender(sujet):
19 #login
20 session = soap.login(cptovh, pwdovh, 'fr', 0)
21
22 for tel in tels:
23 #telephonySmsSend
24 result = soap.telephonySmsSend(session, cptsms, numtelenr, tel, sujet, '48', '1', '', '', '', '')
25 #result = soap.telephonySmsCreditLeft(session, cptsms)
26 #print result, sujet
27
28 #logout
29 soap.logout(session)
30
31
32