IVR creation using CLI

:roll_eyes:

Use extensions_custom.conf

Got the same error : server unreachable
asterisk log file and my config on extensions_custom.conf. It was working properly with extensions.conf just want it to point on freepbx extensions
[2019-12-16 16:29:53] VERBOSE[2450][C-00000014] netsock2.c: Using SIP RTP TOS bits 184
[2019-12-16 16:29:53] VERBOSE[2450][C-00000014] netsock2.c: Using SIP RTP CoS mark 5
[2019-12-16 16:29:53] NOTICE[2450][C-00000014] chan_sip.c: Call from ‘1992’ (192.168.20.10:63834) to extension ‘^X’ rejected because extension not found in context 'fr$
[2019-12-16 16:29:57] VERBOSE[2345] asterisk.c: Remote UNIX connection
[2019-12-16 16:29:57] VERBOSE[5277] asterisk.c: Remote UNIX connection disconnected
[2019-12-16 16:29:57] VERBOSE[2450][C-00000015] netsock2.c: Using SIP RTP TOS bits 184
[2019-12-16 16:29:57] VERBOSE[2450][C-00000015] netsock2.c: Using SIP RTP CoS mark 5
[2019-12-16 16:29:57] NOTICE[2450][C-00000015] chan_sip.c: Call from ‘1992’ (192.168.20.10:63834) to extension ‘^X’ rejected because extension not found in context 'fr$
[2019-12-16 16:30:01] VERBOSE[2345] asterisk.c: Remote UNIX connection
[2019-12-16 16:30:01] VERBOSE[5285] asterisk.c: Remote UNIX connection disconnected

[TestofAGI]
exten => 3030,1,Answer()
exten => 3030,n,Dial(SIP/3030,20,tr)
exten => 3030,n,Hangup

exten => 555,1,Answer()
exten => 555,n,Playback(tt-monkeys)
exten => 555,n,Hangup

exten => 666,1,Playback(thank-you-cooperation)
exten => 666,n,Hangup()

exten => 2150,1,Agi(agi://localhost/hello.agi)

exten => 2150,1,Agi(agi://localhost/hello2.agi)
exten => 2150,n,Verbose(2,The channel name is ${MYVAR})
exten => 2150,n,Playback(thank-you-cooperation)
exten => 2150,n,Hangup()
exten => h,1,Verbose(2,Hang-> The channel name is ${MYVAR})
exten => t,1,Verbose(2,timeout t)
exten => T,1,Verbose(2,timeout T)
exten => i,1,Verbose(2,timeout T)

I also get a message saying that the call cannot be completed as dial

What number are you dialing?

2150
It is the number configured in my inbound route.I want that when I receive an external call on my inbound route It will run the agi script

2150 does not seem to be in the from-internal context

I’m really not familiar with AGI script so I have no many informations about this.
I just need an example to test my FastAGI with an incoming call on my freepbx server.
Maybe you can help me with just a few example for testing.
Thanks

Put the below in extensions_custom.conf

[custom-agi-ivr]
exten => s,1,Noop(Entering the custom context in extensions_custom.conf)
exten => s,n,AGI(your-stuff)
exten => s,n,Playback(tt-monkeys)
exten => s,n,Hangup

Create a custom destination, set the target to custom-agi-ivr,s,1
You can point an inbound route to that custom destination, or setup a Misc Application that points to this custom destination so you can call it from an internal extension.

How can I test it with an external number?

Make a custom destination pointed to the IVR context, then make an inbound route pointed at the custom destination.

https://wiki.freepbx.org/display/FPG/Custom+Destinations+User+Guide

1 Like

Here .

Thanks
It works
And I can also run my fastagi server
Thank you very much

1 Like

It works for the custom destination.
Previously for testing my fastagi server I proceed like this :
Create an inbound route with any/any and a custom destination calling 7777 or calling using an external number It works (images below).
Now I’m searching a way to test my server like that :
When I call my freepbx server using an external number on an extension It will point to my fastagi server.
For example I call extension 1000 and it points to my fastagi server.
How can I do that?
Thanks
1

As explained above.

If you want to call this from an internal phone, you can create a Misc Application (You can set the Feature Code/Extension to 1000) and point it to your custom destination.

If you want external callers to reach this custom destination by dialing 1000 from an IVR, then add digits 1000 to your IVR options and point it to the custom destination

1 Like

Thank you I’ll try It.
I’m searching a way to test this on custom_extensions.conf but seems not to be working.I don’t know why
[phones]
exten => 100,1,NoOp(First Line)
exten => 100,2,NoOp(Second Line)
exten => 100,3,Hangup

You can’t just write something there and expect your dialplan to know about this context.

Usually if you dial 100 it’s from-internal context

As a quick additional note, since you’re building a new setup it’d probably be best to start it with chan_pjsip as well. chan_pjsip is the SIP channel driver that receives the most developer love and as of Asterisk 17 chan_sip has been marked as deprecated within Asterisk. chan_sip unfortunately has gotten quite old and most Asterisk developers don’t want to touch it due to internal architectural problems.

3 Likes

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