Custom extension also possible by user interface?

Hi Guru’s,

So on this moment I have a call-file that I put in the outgoing folder and Asterisk then makes a call for me. I’m doing that by this call file:

MaxRetries: 2
RetryTime: 900
WaitTime: 30
Context: from-internal-custom
Extension: 16031
Priority: 1
Archive: Yes

And I have a piece of code configured in the extensions_custom.conf:
include => deb-reminder

exten => 16031, 1, Wait(3)
exten => 16031, n, Playback(X)
exten => 16031, n, Wait(1)
exten => 16031, n, Playback(X)
exten => 16031, n, Wait(1)
exten => 16031, n, Playback(X)
exten => 16031, n, Wait(1)
exten => 16031, n, Playback(X)
exten => 16031, n, Wait(1)
exten => 16031, n, Hangup

Now I would like to remove the code in the extensions_custom.conf file and do it all trough the user interface of FreePBX.
I already created an extension 16031 and in that extension I see the possibility to set an announcement.
Only how can I hangup the call from the extension?

Instead of a Custom Extension, create a Misc Application that routes to your Announcement, which in turn routes to Terminate Call: Hangup.

As @Stewart1 says use a Misc App which you can get with from-internal,xxxx,1

Misc App -> Announcement1 -> Announcement2 -> Terminate Call (Hangup)

Also when dialing outbound, you might prefer to use your outbound routes by using channel Local/[email protected] instead of using the trunk sip channel.

1 Like

Thanks for your reply, but what if I have 2 trunks and I want to call from a specific one?

The conventional way of doing this is with a dial prefix that forces a specific outbound route.

Whilst I found the new requirement confusing, I think the OP was actually asking about making the message conditional based on the inbound route. They’d been using a custom context, and wanted to reproduce the ability of that to make handling dependent on the source.

I’m sorry but I don’t understand what you mean.

Well I fixed this by creating like you guys suggested a Misc application with extension number 1234. Then in the call file I do an extension: 1234 with context: from-internal. I merged all the sounds together to 1 announcement and after that terminate the call. In the call file I still do the $trunk so I have the possibility to control what trunk will be used. Because I do not understand the outbound rules and how to apply them on this. Thanks for you help!

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.