Woo Hoo! - VoIP.ms SMS texting through SIMPLE

All right - I just figured out how to make this work and it’s very cool (empowering even!) - Why aren’t other trunking providers doing this?

Anyways, I have it working, inbound and outbound, but It throws an error (but it does work) - I am not enough of a Dialplan heavy to figure out the problem.

Here is the code in /etc/asterisk/extensions_custom.conf:

[sms-in]
exten => _.,1,NoOp(Inbound SMS dialplan invoked)
exten => _.,n,NoOp(To ${MESSAGE(to)})
exten => _.,n,NoOp(From ${MESSAGE(from)})
exten => _.,n,NoOp(Body ${MESSAGE(body)})
exten => _.,n,Set(NUMBER_TO=${MESSAGE_DATA(X-SMS-To)})
exten => _.,n,Set(HOST_TO=${CUT(MESSAGE(to),@,2)})
exten => _.,n,Set(ACTUAL_FROM=${MESSAGE(from)})
exten => _.,n,Set(ACTUAL_TO=pjsip:${NUMBER_TO}@${HOST_TO})
exten => _.,n,MessageSend(${ACTUAL_TO},${ACTUAL_FROM})
exten => _.,n,NoOp(Send status is ${MESSAGE_SEND_STATUS})
exten => _.,n,Hangup()

Here is the Console Output:

-- Executing [s@sms-in:1] NoOp("Message/ast_msg_queue", "Inbound SMS dialplan invoked") in new stack
-- Executing [s@sms-in:2] NoOp("Message/ast_msg_queue", "To pjsip:[email protected];line=xxxxxx") in new stack
-- Executing [s@sms-in:3] NoOp("Message/ast_msg_queue", "From "505NXXXXXX" <sip:[email protected]>") in new stack
-- Executing [s@sms-in:4] NoOp("Message/ast_msg_queue", "Body Howdy!") in new stack
-- Executing [s@sms-in:5] Set("Message/ast_msg_queue", "NUMBER_TO=505NXXXXXX") in new stack
-- Executing [s@sms-in:6] Set("Message/ast_msg_queue", "HOST_TO=xx.xx.xx.xx;line=xxxxxx") in new stack
-- Executing [s@sms-in:7] Set("Message/ast_msg_queue", "ACTUAL_FROM="505NXXXXXX" <sip:[email protected]>") in new stack
-- Executing [s@sms-in:8] Set("Message/ast_msg_queue", "ACTUAL_TO=pjsip:[email protected];line=xxxxxx") in new stack
-- Executing [s@sms-in:9] MessageSend("Message/ast_msg_queue", "pjsip:[email protected];line=xxxxxx,"505NXXXXXX" <sip:[email protected]>") in new stack

[2021-08-23 17:28:25] WARNING[26847]: res_pjsip_messaging.c:700 update_to_uri: To address ‘[email protected];line=xxxxxx’ is not a valid SIP/SIPS URI
– Executing [s@sms-in:10] NoOp(“Message/ast_msg_queue”, “Send status is SUCCESS”) in new stack
– Executing [s@sms-in:11] Hangup(“Message/ast_msg_queue”, “”) in new stack
== Spawn extension (sms-in, s, 11) exited non-zero on ‘Message/ast_msg_queue’

Like I say, it works, but it throws an error each time - anybody else seen this (and fixed it :wink: )?

2 Likes

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.