...
[alex.git] / supervision / sendsms.py
CommitLineData
8d4137ed
AD
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
8import pprint
9from SOAPpy import WSDL
10from conf import *
11
12soap = WSDL.Proxy('https://www.ovh.com/soapi/soapi-re-1.21.wsdl')
13
14#login
15session = soap.login(cptovh, pwdovh, 'fr', 0)
16#print "login successfull"
17
18def 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