Asterisk dialplan & CURL (additional example)

In this post I put another example of using curl in asterisk dialplan. Here, we use curl command to get the IP of the Asterisk server using www.whatismyip.com

Add this to /etc/asterisk/extensions_custom.conf:

[custom-sayIP]
exten => s,1,NoOp(This must read back your internet public IP)
exten => s,n,Answer()
exten => s,n,Set(MyIPAddressIs=${CURL(http://www.whatismyip.org/)})
exten => s,n,sayAlpha("IP")
exten => s,n,SayAlpha(${MyIPAddressIs})
exten => s,n,Hangup()

You may also like