Incredible PBX - Wiki

Incredible PBX

From Wiki

Jump to: navigation, search


1) A Incredible PBX completly installed.
2) You must have an active DID in your account and a Sub-Account.
3) Your DID Must be routed to the Sub-Account.
4) Your DID must have the option SMS enabled and the option "SMS SIP Account" enabled with the same Sub-Account selected.

Create a PJSIP Trunk

You will need to create a new PJSIP Trunk via your FreePBX portal in order to process calls and SMS messages:

In the PJSIP Settings tab, fill out the General tab.

Username: Will be your sub-account ######_SubAccount.
Password: Will be your Sub-Account password.
SIP Server: Your Preferred POP server associated with your DID. e.g.
Accept the remaining defaults in the General tab.
Click on the Advanced tab and scroll down to Message Context and enter: sms-in.
Click Submit and Reload your Dialplan.

Create a new PJSIP extension

Now, you will need to create a new PJSIP Extension in via your FreePBX portal also to process calls and SMS.

NOTE: The "Incredible PBX 2020" comes with a few preconfigured chan_sip extensions. Do NOT use them. You must create a new "PJSIP" extension.

Click on the Advanced tab and then scroll down to Max Contacts.
Enter a value that is one more than twice the number of phones that will be connected to this extension simultaneously.
For instance, if you have 3 smartphones connecting to this specific extension, you would enter the value: 7.
Now scroll down to Message Context, type: "sms-out".
Click Submit and reload your Dialplan.

Add some code in extensions_custom.conf

Almost done! Now you need to copy/paste the following "context" at the end of this file extensions_custom.conf located in the directory /etc/asterisk:

exten => _.,1,NoOp(Outbound Message dialplan invoked)
exten => _.,n,Set(VOIPMS_DID="5551112222")
exten => _.,n,Set(VOIPMS_ACCTNAME="######_SubAccount")
exten => _.,n,Set(VOIPMS_POP="")
exten => _.,n,Set(VOIPMS_TRUNK="VoIPms-PJsip")
exten => _.,n,NoOp(To ${MESSAGE(to)})
exten => _.,n,NoOp(From ${MESSAGE(from)})
exten => _.,n,NoOp(Body ${MESSAGE(body)})
exten => _.,n,Set(NUMBER_TO=${CUT(CUT(MESSAGE(to),@,1),:,2)})
exten => _.,n,Set(EXTENSION_FROM=${CUT(CUT(MESSAGE(from),@,1),:,2)})
exten => _.,n,Set(ACTUAL_FROM="${VOIPMS_DID}" )
exten => _.,n,Set(ACTUAL_TO=pjsip:${VOIPMS_TRUNK}/sip:${NUMBER_TO}@${VOIPMS_POP}>)
exten => _.,n,MessageSend(${ACTUAL_TO},${ACTUAL_FROM})
exten => _.,n,NoOp(Send status is ${MESSAGE_SEND_STATUS})
exten => _.,n,Hangup()

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(ACTUAL_FROM=${MESSAGE(from)})
exten => _.,n,Set(HOST_TO=${CUT(MESSAGE(to),@,2)})
exten => _.,n,Set(NUMBER_TO=${MESSAGE_DATA(X-SMS-To)})
exten => _.,n,MessageSend(pjsip:747@${HOST_TO},${ACTUAL_FROM})
exten => _.,n,NoOp(Send status is ${MESSAGE_SEND_STATUS})
;exten => _.,n,MessageSend(pjsip:748@${HOST_TO},${ACTUAL_FROM})
;exten => _.,n,NoOp(Send status is ${MESSAGE_SEND_STATUS})
;exten => _.,n,MessageSend(pjsip:749@${HOST_TO},${ACTUAL_FROM})
;exten => _.,n,NoOp(Send status is ${MESSAGE_SEND_STATUS})
exten => _.,n,Hangup()


In the [sms-out] context, edit:

Line [2] Replace 5551112222 with your DID.

Line [3] Replace ######_SubAccount with your sub-account.

Line [4] Replace with the POP associated with your DID.

Line [5] Replace "VoIPms-PJsip" with your PJSIP Trunk name you've created previously.

In the [sms-in] context, edit:

Replace the 747 entry with the PJSIP extension you've created previously.

To notify multiple extensions when a new incoming SMS, uncomment the respective lines (by removing the ; at the beginig of the line) and enter the proper PJSIP extension numbers.

Save the file, and reload the Asterisk dialplan using the command line: asterisk -rx "dialplan reload"

Interesting Fact

If you have an Yealink T46G (not T48G) who is registered the extension created, the SMS will also appear on the IP Phone with an alert tone.

The log can be accessed on the phone by Menu -> Message -> Text Message.

Personal tools
Actions Blog
Guides (Français)
Guías (Español)