Custom Destinations

I’m creating a new IVR that needs to retrieve data from a web service. I’m trying to use a Custom Destination and then creating a context in extensions_custom.conf which will call my agi script. I’ve named my Custom Destination Main-IVR, and created my entry in extensions_custom.conf, but I get a Gosub address is invalid: 'Main-IVR(). For now, I have test code just to see if I can reach my Custom Destination and playback some digits.

The custom destination code in extensions_additional.conf

[customdests]
exten => dest-1,1,Noop(Entering Custom Destination Main-IVR)
exten => dest-1,n,Gosub(Main-IVR())
exten => dest-1,n,Noop(Returned from Custom Destination Main-IVR)
exten => dest-1,n,Goto(app-announcement-1,s,1)

The extensions_customer.conf code
[Main-IVR]
exten => s,1,SayDigits(8675309)

Any advice on what my issue is would be greatly appreciated!! I’m running version 12 right now (need to upgrade!)

Mistyped question … should have said extensions_custom.conf, not extensions_customer.conf.

If you read the tooltip for the Custom Destination you will see that the field is expected to be formatted exactly as you would for a goto/gosub application, which is “context, exten, priority”. In your case it would be:

Main-IVR,s,1

If you are using a Gosub, then you will need to ensure there is a return statement added to your user defined context.

Thank you! I should have paid closer attention to that.

I’m still getting the following and can’t seem to find the issue …

Attempt to reach a non-existent destination for Gosub(Context:Main-IVR, Extension: s, Priority:1)

extensions_custom.conf looks like this now … it’s the only thing in the extension_custom.conf file.

[Main-IVR]
exten => s,1,SayDigits(8675309)
exten => s,n, Return()

I gave you the exact string you need for the custom dest.

Yes, you did. And that’s exactly what is in my custom destination under Admin/Customer Destinations. However, the error I am getting is

“Attempt to reach a non-existent destination for Gosub(Context:Main-IVR, Extension: s, Priority:1)”

Maybe I am misunderstanding you.

To clarify, this is the error in the CLI when I make my test call and it attempts to go to the custom destination.

http://asteriskdocs.org/en/3rd_Edition/asterisk-book-html-chunk/GoSub.html

At the asterisk CLI what is the output from:

dialplan show Main-IVR
dialplan show customdests

Thank you! Lorne … here it is.

dialplan show Main-IVR

[ Context 'Main-IVR' created by 'pbx_config' ]
  's' =>            1. SayDigits(8675309)                         [pbx_config]
                    2. Return()                                   [pbx_config]

-= 1 extension (2 priorities) in 1 context. =-

dialplan show customdests

[ Context 'customdests' created by 'pbx_config' ]
  'dest-1' =>       1. Noop(Entering Custom Destination Main-IVR) [pbx_config]
                    2. Gosub(Main-IVR, s, 1())                    [pbx_config]
                    3. Noop(Returned from Custom Destination Main-IVR) [pbx_config]
                    4. Goto(app-announcement-1,s,1)               [pbx_config]

-= 1 extension (4 priorities) in 1 context. =-

The stray spaces in the gosub string are at fault. Never saw that one before.

That did it! Thanks so much for your help!! I’ll be more aware of my syntax and spaces moving forward.

1 Like