Am trying to play around with a piece of custom dialplan using MessageSend … but it isn’t working quite as I expect. I’m sure it’s something simple that I’m missing. The dialplan itself flows through as it should when dialing extension 2121. Unfortunately the message is never received.
The message should come from 19995551212 and be sent to sip:[email protected]
Here is the dialplan (that lives in [from-internal-custom])…
exten => 2121,1,Noop(SMS Send Test)
exten => 2121,n,Answer
exten => 2121,n,Set(sms_host=sms.host.blah)
exten => 2121,n,Set(sms_to=19995551000)
exten => 2121,n,Set(sms_from=19995551212)
exten => 2121,n,Set(sms_body=Hello World, this is SMS)
exten => 2121,n,Set(MESSAGE(body)=${sms_body})
exten => 2121,n,MessageSend(sip:${sms_to}@${sms_host},"${sms_from}")
exten => 2121,n,Wait(1)
exten => 2121,n,Playback(activated,noanswer)
exten => 2121,n,Hangup
When looking to the logs I would expect to see…
… MessageSend(“sip:[email protected]”,“19995551212"”) …
But what I’m actually seeing is…
… MessageSend(“SIP/202-0000056a”, "sip:[email protected],“19995551212"”) …
So essentially the calling extension number is being inserted as the to address and the desired “to” address is being merged into the “from” field of the MessageSend call
The MessageSend code itself works fine elsewhere when triggered by a call file… so I’m sure it’s just something I’m forgetting in writing this piece of custom dialplan for ext.2121
Thanks!