Using CURL to create command in dialplan

What I am trying to do is:

exten => _X.,1,Set(DialCommand=${CURL( … ngNumber=${CALLERID(dnid)})})
exten => _X.,n,${DialCommand}

The CURL command returns “Dial(SIP/|300)â€


I don’t think you can have an application in a variable, Never tried it but it would make sense that you cant.


No, you can’t have a command within a variable like that.

When Asterisk is started, the dial plan is read and the steps of execution are parsed in the order of their priority (or listing).

If there’s command to execute, Asterisk doesn’t know what to do at that step when a call must be processed.