How to add a function to dialplan ?

Get help with installing, upgrading and running Asterisk.

Moderators: muppetmaster, Moderator, Support

How to add a function to dialplan ?

Postby nwcoaster6 » Thu Jan 21, 2016 5:41 am

// for examples :

// extensions.conf

exten => 123,1,Answer()
exten =>123,n,Fnn()
exten =>123,n,Hangup()

// end

If I add a Fnn function , I want the function execute .

How to do ?

Any help ?
Posts: 6
Joined: Tue Jan 05, 2016 1:41 am

Re: How to add a function to dialplan ?

Postby stuartalt » Thu Jan 21, 2016 8:34 am

Actually, if you are doing like you wrote, you'll be executing an application.

Take a look at the following documentation to help you clarify your mind.

Applications: ... n+commands


Dialplan functions have the following basic syntax:
You reference a function’s name the same way as a variable’s name, but you reference a
function’s value with the addition of a dollar sign, an opening curly brace, and a closing
curly brace:
Functions can also encapsulate other functions, like so:

exten => 123,1,NoOp()
same => n,Set(TEST=example)
same => n,Playback(silence/1)
same => n,SayNumber(${LEN(${TEST})})
Posts: 11
Joined: Thu Dec 10, 2015 2:29 pm

Return to Asterisk Support

Who is online

Users browsing this forum: Exabot [Bot] and 1 guest