ClearlyIP’s Tips and Tricks
For those of you who love to use the terminal when it comes to debugging Asterisk issues, today we will talk about one helpful command.
When we are working remotely on an Asterisk/FreePBX environment, sometimes we would like to test things, but what happens when nobody is at the remote location? How can we test, for example, if the PBX can dial out? Or how can we have a sense of the call quality or replicate any NAT issue?
For this we can take advantage of Asterisk Command Line using the following command:
Let’s Break Down This Command Into Its Parts:
- channel originate
This will create a new channel inside Asterisk and connect it to a dialplan extension or a specific application.
- Local/[email protected]
In this case, we are dialing within Asterisk into the Asterisk dialplan. With this Asterisk will dial XXXXXXXXXX (which is our destination number, for example, our cell number). It will start searching for any dialing pattern in the from-internal context. In this case, if there is a pattern for a 10-digit number, Asterisk will dial out to this number using the associated trunk
- extension *[email protected]
With this, the channel originate command will connect the originated channel when dialing our cell number to extension *[email protected] *[email protected] is the default feature code for the echo test function.
Here’s An Example Showing How to Run the Command:
Since FreePBX dialplan is standard in terms of contexts and functions, we can assume our command will dial our cell phone and send that call to the echo test feature, and with this, we can check if our PBX can dial out and detect any NAT issue with the echo test.
Finally, you can modify this command to dial an internal extension instead of the echo test feature.