Upgrade 3CX to v18 and get it hosted free!

G400P

Author image

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}" [email protected])
 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


Article Reviews

Write a Review

Your email address will not be published. Required fields are marked *

Required Field. Minimum 5 characters.

Required Field. Minimum 5 characters, maximum 50.

Required field.There is an error with this field.

Required Field.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

There are no reviews for this article. Be the first one to write a review.

Related Posts:

Get 3CX - Absolutely Free!
Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.