G400P

The OpenVox G400P


Having recently acquired one of these cards, I am finding documentation is a bit sparse. I hope to rectify this. What follows is gleaned from assorted web sites too numerous to mention individually, the chan_extra Source Code and my own dogged experimentation.

Receiving Text Messages

When a text (SMS) message is received, a call is set up to extension "sms" in the default context (usually "from-gsm") specified in chan_extra.conf. Within this call, certain channel variables are set up as follows:
  • ${SMSSRC} = the sender's number
  • ${SMSTXT} = the message text
  • S{SMSPDU} = the PDU (hexadecimal codes representing message in binary format)
  • ${SMSTIME} = the time at which the message was sent
  • ${SMSTZ} = the time zone from which the message was sent
  • ${DIALSTATUS} = set to "SMS_END"

These can be passed to an AGI script. For example, you could have this in your dialplan:
 exten => sms,1,NoOp(Incoming SMS) 
 exten => sms,2,AGI(sms_to_email.agi,${SMSTXT},${SMSSRC})
 exten => sms,3,Hangup()

This calls up an AGI script called /var/lib/asterisk/agi-bin/sms_to_email with the message text and sender's number as its parameters. This can be written in any language with an AGI library.

Alternate, "quick and dirty" version (no AGI; requires a properly-configured MTA on the Asterisk server; untested at time of writing)

 exten => sms,1,NoOp(Incoming SMS)
 exten => sms,2,SYSTEM(echo "${SMSTXT}" | mail -s"Text from ${SMSSRC}" me@my-domain.co.uk)
 exten => sms,3,Hangup()

If there is no extension in this context called "sms" (or a wildcard with a pattern that "sms" would match), then the "s" extension will be run instead.

See also

The OpenVox G400P


Having recently acquired one of these cards, I am finding documentation is a bit sparse. I hope to rectify this. What follows is gleaned from assorted web sites too numerous to mention individually, the chan_extra Source Code and my own dogged experimentation.

Receiving Text Messages

When a text (SMS) message is received, a call is set up to extension "sms" in the default context (usually "from-gsm") specified in chan_extra.conf. Within this call, certain channel variables are set up as follows:
  • ${SMSSRC} = the sender's number
  • ${SMSTXT} = the message text
  • S{SMSPDU} = the PDU (hexadecimal codes representing message in binary format)
  • ${SMSTIME} = the time at which the message was sent
  • ${SMSTZ} = the time zone from which the message was sent
  • ${DIALSTATUS} = set to "SMS_END"

These can be passed to an AGI script. For example, you could have this in your dialplan:
 exten => sms,1,NoOp(Incoming SMS) 
 exten => sms,2,AGI(sms_to_email.agi,${SMSTXT},${SMSSRC})
 exten => sms,3,Hangup()

This calls up an AGI script called /var/lib/asterisk/agi-bin/sms_to_email with the message text and sender's number as its parameters. This can be written in any language with an AGI library.

Alternate, "quick and dirty" version (no AGI; requires a properly-configured MTA on the Asterisk server; untested at time of writing)

 exten => sms,1,NoOp(Incoming SMS)
 exten => sms,2,SYSTEM(echo "${SMSTXT}" | mail -s"Text from ${SMSSRC}" me@my-domain.co.uk)
 exten => sms,3,Hangup()

If there is no extension in this context called "sms" (or a wildcard with a pattern that "sms" would match), then the "s" extension will be run instead.

See also

Created by: tux_tattoo, Last modification: Thu 16 of Aug, 2012 (18:15 UTC) by admin
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+