Skip to content

Instantly share code, notes, and snippets.

@lgaetz
Last active February 25, 2021 17:03
Show Gist options
  • Save lgaetz/57ffc5bbdd154081894138e983c1f4be to your computer and use it in GitHub Desktop.
Save lgaetz/57ffc5bbdd154081894138e983c1f4be to your computer and use it in GitHub Desktop.
Dialplan to send SMS using Voip Innovations APIDAZE
[send-sms-apidaze]
; latest version https://gist.github.com/lgaetz/57ffc5bbdd154081894138e983c1f4be
;
; In the APIDAZE API portal create a Dev App of type SMS and associate a DID with that APP
; get the secret and key for your app, and set them as variables
; Created by lgaetz, GNU/GPL3+
;
; Create a Custom Destination with Return enabled and with the following target:
; send-sms-apidaze,s,1(${CALLERID(number)},What are you doing Dave?)
;
; arg 1 = destination number for the SMS mesage, in the above example sms goes to CID of caller
; arg 2 = SMS message body
; version history
; 2020-09-20 COVID 19 edition - first commit
exten => s,1,Noop(Entering user defined context send-sms-fixedmessage in extensions_custom.conf)
; app parameters
exten => s,n,Set(apidaze_key=xxxx) ; get from APIDAZE Dev App
exten => s,n,Set(apidaze_secret=xxxx) ; get from APIDAZE Dev App
exten => s,n,Set(from_DID=xxxx) ; DID associated with APIDAZE App
exten => s,n,Set(destination=${ARG1})
exten => s,n,Set(message=${ARG2})
; curl
exten => s,n,set(result=${CURL(https://api.apidaze.io/${apidaze_key}/sms/send?api_secret=${apidaze_secret},from=${from_DID}&to=${destination}&body=${message})})
exten => s,n,Return
@mitchmitchell
Copy link

mitchmitchell commented Feb 25, 2021

I'm going to try and do this with Twilio

@lgaetz
Copy link
Author

lgaetz commented Feb 25, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment