PIONEERS SMS Toolkit for Incredible PBX

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
We're putting the finishing touches on a new SMS interface to Incredible PBX using SMS-enabled DIDs from Vitelity and VoIP.ms. The idea is you can send an SMS message to your server, and it will call you back or perform the task you requested.

If you'd like to try it out from your smartphone (in the U.S. only), send an SMS message to 843-606-0444 with one of the following words as your message. Upper and lower case don't matter.

news
weather
help
wolfram
asteridex
odbc
cf on (see next message)
cf off (see next message)
cf status

When you get a callback, the first 3 are self-explanatory. For Wolfram Alpha, say something like: "What planes are flying overhead now?" For AsteriDex, this is the Voice Dialer using IBM Voice Recognition. Say "Delta Airlines" or "American Airlines." For ODBC, this documents how to interface Asterisk to an existing MySQL database, AsteriDex in this example. When prompted for DialCode, enter 335 (DELta airlines) or 263 (AMErican airlines). This obviously could be any ODBC-aware database or CRM software.

Other ideas for content are welcomed!

When we turn this loose to implement on your own server, we'll add DISA, SMS, and TM3 support which will make it helpful when you're outside your local country/area and wish to make calls/send messages at cheaper rates from or login to your own PBX. The 10-digit DISA dialing limitation could obviously be reworked for international use as well.
Code:
[custom-disa]
exten => s,1,Answer
exten => s,n,Wait(1)
exten => s,n,Set(TIMEOUT(digit)=7)
exten => s,n,Background(enter-password)
exten => s,n,Read(MYCODE,beep,7)
exten => s,n,GotoIf($["${MYCODE}" = "902101"]?disago:bad)
exten => s,n(disago),Set(TIMEOUT(absolute)=9000)
exten => s,n,Read(NUM2CALL,pls-entr-num-uwish2-call,10)
exten => s,n,Background(calling)
exten => s,n,SayDigits("${NUM2CALL}")
exten => s,n,Goto(outbound-allroutes,${NUM2CALL},1)
exten => s,n(bad),Hangup

Code:
[whitelist-ip]
exten => s,1,Answer
exten => s,n,Wait(1)
exten => s,n,Set(TIMEOUT(digit)=7)
exten => s,n,Background(enter-password)
exten => s,n,Read(MYCODE,beep,7)
exten => s,n,GotoIf($["${MYCODE}" = "902101"]?ipgo:bad)
exten => s,n(ipgo),Set(TIMEOUT(absolute)=9000)
exten => s,n,Background(please-enter-your)
exten => s,n,Read(IPADDR,address,15)
exten => s,n,Set(IPADDRESS=${REPLACE(IPADDR,*,.)})
exten => s,n,Background(you-entered)
exten => s,n,SayAlpha(${IPADDRESS})
exten => s,n,Read(continue,1-yes-2-no,1)
exten => s,n,GotoIf($["${continue}" = "1"]?ipproceed:bad)
exten => s,n(ipproceed),System(sudo /sbin/iptables -A INPUT -s ${IPADDRESS} -j ACCEPT)
exten => s,n,Playback(address)
exten => s,n,Playback(has-been-set-to)
exten => s,n,SayAlpha(${IPADDRESS})
exten => s,n(bad),Playback(goodbye)
exten => s,n,Hangup
 
Last edited:

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
By request, we've added the ability to activate and deactivate call forwarding to your cellphone using an SMS message provided you've done a little advanced planning on your PBX. Before this will work, you'll need to associate cellphone numbers with extensions on your PBX.

From the Asterisk CLI, to associate cell # 8005551212 with extension # 701, issue the following command to register the cell phone:
Code:
database put CELL 8005551212 701

More than one cell phone number can be associated with the same extension, but the same cell phone number cannot be associated with more than one extension.

When you send an SMS message from a registered cell phone with cf on message, it will begin forwarding calls from the registered extension (701 in the example) to your cell.

To turn off call forwarding, just send the following SMS message from the same cell phone: cf off

SMS messages from unregistered cell phone numbers attempting to turn call forwarding on or off will simply fail.

A confirmation call will be made whenever either command is sent via text message.
 
Last edited:

mainenotarynet

Not really a Guru - Just a long time user
Joined
May 29, 2010
Messages
754
Reaction score
155
Good idea, but...
I run my pbx for 4 groups and have a dedicated extension for myself (tells me how to answer the call) so the cf on/off how would that work by associating with more than one extension. my guess is it finds first and would stop at that unless a for each.

To me I use Followme anyway with a press one for my cell phone message. - Just thought I'd throw a monkey wrench at the behest of a devils advocate. Oh yeah, I have many numbers with voip.ms 3 of which have SMS enabled.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
Ah, the beauty of open source code. Just register one extension for your cellphone. Then it would be really easy to customize the dialplan to set all 4 extensions. Just add some more Set(DB) and DBdel lines to the dialplan using the other extensions instead of ${DB_RESULT}:
Code:
[cf-on]
exten => s,1,Answer
exten => s,n,Wait(1)
exten => s,n,NoOp(Searching: CELL/${CID})
exten => s,n,Set(foo=${DB_EXISTS(CELL/${CID})})
exten => s,n,GotoIf($["${foo}" = "1"]?foofound:nofoo)
exten => s,n(foofound),NoOp(Extension: ${DB_RESULT})
exten => s,n,Set(DB(CF/${DB_RESULT})=${CID})
exten => s,n,Flite("Call forwarding to your cell phone activated on the following extension: ")
exten => s,n,SayDigits(${DB_RESULT})
exten => s,n,Playback(goodbye)
exten => s,n,Hangup
exten => s,n(nofoo),Flite("No matching cell phone on file. Call forwarding could not be activated.")
exten => s,n,Playback(goodbye)
exten => s,n,Hangup

[cf-off]
exten => s,1,Answer
exten => s,n,Wait(1)
exten => s,n,NoOp(Searching: CELL/${CID})
exten => s,n,Set(foo=${DB_EXISTS(CELL/${CID})})
exten => s,n,GotoIf($["${foo}" = "1"]?foofound:nofoo)
exten => s,n(foofound),NoOp(Extension: ${DB_RESULT})
exten => s,n,DBdel(CF/${DB_RESULT})
exten => s,n,Flite("Call forwarding deactivated on the following extension: ")
exten => s,n,SayDigits(${DB_RESULT})
exten => s,n,Playback(goodbye)
exten => s,n,Hangup
exten => s,n(nofoo),Flite("No matching cell phone on file. Call forwarding could not be deactivated.")
exten => s,n,Playback(goodbye)
exten => s,n,Hangup
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
Added Vitelity SMS messaging this morning. Working great.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
With a little help from IBM TTS, we've added help to the supported queries list.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
The SMS Toolkit: Integrating Text Messaging into Asterisk
DWpJKtdXcAE8cS_.jpg
 

Members online

No members online now.

Forum statistics

Threads
25,778
Messages
167,504
Members
19,198
Latest member
serhii
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.
Top