Created
September 11, 2013 15:55
-
-
Save eliezerfot123/6525652 to your computer and use it in GitHub Desktop.
Como enviar mensaje con gammu vía python. Teléfono de prueba ALCATEL 0T-800A
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Ejemplo de como enviar SMS usando gammu y python | |
import gammu | |
import sys | |
# se crea un objeto stateMachine, para hablar con el telefono | |
sm = gammu.StateMachine() | |
# Leer la configuracion desde (~/.gammurc) | |
sm.ReadConfig() | |
# De esta manera iniciamos la conexin con el telefono | |
sm.Init() | |
# SMSC es un numero que se obtiene interrogando el telefono | |
message = { | |
'Number': '+581234567890',#telefono a enviar... | |
'SMSC': {'Number': '+580987654321'},#telefono de origen | |
'Text': 'Hello world!',# mensaje que deseas enviar... | |
'Class': 0, | |
} | |
# Enviar el mensaje | |
sm.SendSMS(message) | |
#by @eliezerfot123 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment