Call File sintaxis

I’d like know which is the best way to call a DID then when the system answer, call a extension (the extension number can change each time) through a call file; I have to pass the extension number indicating it on the call file.
Thank you in advance.

What do you mean by “call a DID”? The I in did stands for “In” and so DID’s are only defined for incoming calls.

In what way does your requirement differ from the normal use of call files with extensions, rather than applications?


the call files call a telephone number. The call go to a asterisk server
where I have to call a specific extension I have indicated on the call
file (can change for each call).


That’s the standard use of callfiles. Please explain exactly where you are getting lost.

More specific:

I have a web application where I put the DID number I want call, the
internal extension and the destination number.

I configure the DID number on the Asterisk and receive the calls on the
[from-did] context (for example).

In this context I need to dial the specific extension indicate on the
web application. When the extension answer, call the second number.

Which is the best way to do this?

Thank you


You are making call the other way round.

Use a Local channel to call the extension (unless you know the device name and no set up is required. Run Dial as the application, and use a dial string that specifies your ITSP (NB this is not a DID) and the PSTN number to call. Alternatively use the extension you would have used to manually dial the call, if your first outgoing leg had been on incoming one.

Also google for “click to dial”, although that would more likely be done with AMI than call files.