Dialplan application
Modules can add applications to those available to be called in dialplan.
Applications in dialplan are invoked as actions and can have arguments in the data string. An example of application and arguments is the bridge
app, which takes the dialstring as the argument to be used to originate the call leg to be bridged to:
In our implementation, we registered a dialplan app with FreeSWITCH core during the LOAD
function. Here, we'll have a look at how we implemented the actual application's inner workings.
We get the channel object from the session object we were passed.
Then we check if the arg
string we were passed is empty (zero length). If it's empty, we assign a default value to how many loops we'll execute. If it's not empty, we convert it into a number, assigning a default in case of error, and enforcing value boundaries.
For each loop we then print a log line that pretty much displays all the entities we used.
From dialplan, you invoke this application as follows:
<...