Asterisk 10 SMS Example?

Does anyone have a full working example of routing incoming SMS messages to an AGI script and/or sending SMS messages from an AGI script?

I get the inbound SIP message:

<— SIP read from UDP:67.231.8.XXX:50XX —>
MESSAGE sip:1503597XXXX@107.22.85.XXX SIP/2.0
Record-Route: sip:67.231.8.XXX;lr=on;ftag=;vsf=AAAAAAAAAAAAAAAAAAAAABEYABcaGkoWCUAKEhEQFQVGTRwUbml2ZXJzZS5jb20-
Record-Route: sip:67.231.8.XX;lr=on;ftag=
Via: SIP/2.0/UDP 67.231.8.XXX;branch=z9hG4bKaa21.7cc978d2.0
Via: SIP/2.0/UDP 67.231.8.XX;branch=z9hG4bKaa21.89cd6ff3.0
Via: SIP/2.0/UDP 205.174.182.XX:50XX;branch=z9hG4bK+de79adc6fd47bf0ee8e3b035d5d089d61+
Max-Forwards: 68
Call-ID: 866E48B8@172.21.1.XXX338
CSeq: 1040427416 MESSAGE
Content-Length: 5
Content-Type: text/plain
X-CustomerIp: 205.174.182.XX

— (14 headers 1 lines) —
Receiving message!
Looking for 1503597XXXX in messages (domain 107.22.85.XXX)

I am trying to experiment with the new MessageSend functionality as a test in my dial plan I have:

exten => 7777,1,Set(=${MESSAGE(“Hello World!”)})
exten => 7777,1,Set(i=${MESSAGE_DATA(“Hello World!”)})
exten => 7777,2,MessageSend(SIP/BWSMS/+1503xxxxxxx)

but so far it’s not quite working. Thanks!


please show the debug info?

I was able to get this further, please see this post: