Custom Call Flow Control Dialplan

Hello everyone.

I’m trying to have a user dial an extension/feature code, reach a CFC feature code and do it’s regular thing of changing the state etc, and then go to an IVR.

I tried to

[cfc-test]
exten => s,1,noop(Entering context in extensions_custom.conf)
exten => s,n,GoSub(to the CFC feature code) ; forgot the actual string
exten => s,n,Playback(hello-world)
exten => s,n,Goto(ivr-1,s,1)

Seems like the CFC has it’s own hangup once it’s done with changing the state, so it does not return to continue with the Playback and Goto the IVR. Anyway of getting the CFC to return to this context, or to do something similar?

Thanks

Instead of doing a GoSub, do an Originate to the CFC feature code and bridge to application wait for 10 seconds or so.

Hey Lorne! Thanks for responding.

I tried

exten => s,n,Originate(local/*282@from-internal)

I see in the log

-- Executing [s@custom-code:4] Originate("SIP/TrunkName-000206d6", "local/*282@from-internal") in new stack
[2019-11-19 08:29:25] ERROR[77326][C-00010b07]: app_originate.c:144 originate_exec: Incorrect number of arguments

What would be the correct string?

Thank you

lorne14-pro*CLI> core show application Originate

  -= Info about application 'Originate' =-

[Synopsis]
Originate a call.

[Description]
This application originates an outbound call and connects it to a specified
extension or application.  This application will block until the outgoing call
fails or gets answered.  At that point, this application will exit with the
status variable set and dialplan processing will continue.
This application sets the following channel variable before exiting:
${ORIGINATE_STATUS}: This indicates the result of the call origination.
    FAILED
    SUCCESS
    BUSY
    CONGESTION
    HANGUP
    RINGING
    UNKNOWN: In practice, you should never see this value.  Please report it to
    the issue tracker if you ever see it.

[Syntax]
Originate(tech_data,type,arg1[,arg2[,arg3[,timeout]]])

[Arguments]
tech_data
    Channel technology and data for creating the outbound channel.
             For example, SIP/1234.
type
    This should be 'app' or 'exten', depending on whether the outbound channel
    should be connected to an application or extension.
arg1
    If the type is 'app', then this is the application name.  If the type is
    'exten', then this is the context that the channel will be sent to.
arg2
    If the type is 'app', then this is the data passed as arguments to the
    application.  If the type is 'exten', then this is the extension that the
    channel will be sent to.
arg3
    If the type is 'exten', then this is the priority that the channel is sent
    to.  If the type is 'app', then this parameter is ignored.
timeout
    Timeout in seconds. Default is 30 seconds.

Something like Originate(local/*282@from-internal,app,wait,15). Didn’t test.

I am having trouble figuring this out. If anyone has some pointers, I’d appreciate it!

If I’m reading the help right, shouldn’t it be

Originate(*282,exten,from-internal,,10)

Similarly, I didn’t test it.

When doing

exten => s,n,Originate(*282,exten,from-internal,,10)

I’m getting:

ERROR[10542][C-000119df]: app_originate.c:159 originate_exec: Channel Tech/Data invalid: '*282'

When doing:

exten => s,n,Originate(local/*282,exten,from-internal,,10)

I’m getting:

NOTICE[11507]: core_local.c:756 local_call: No such extension/context *282@default while calling Local channel

I’m missing something, can’t figure out what…

 arg1 – If the type is ‘app’, then this is the application name. If the type is ‘exten’, then this is the context that the channel will be sent to.
 arg2 – If the type is ‘app’, then this is the data passed as arguments to the application. If the type is ‘exten’, then this is the extension that the channel will be sent to.
 arg3 – If the type is ‘exten’, then this is the priority that the channel is sent to. If the type is ‘app’, then this parameter is ignored

I think you are going to need to use the arguments to make this execute.

you cannot use extension, since there is not a matching extension. You could make an extension that dials the feature code. That might work.

Thank you @lgaetz @cynjut and @comtech

I couldn’t get the originate to work, I ended up doing the below:

[cfc-test]
exten => s,1,noop(Entering context in extensions_custom.conf)
exten => s,n,Dial(local/*282@from-internal,,g)
exten => s,n,Playback(hello-world)
exten => s,n,Goto(ivr-1,s,1)   

From the asterisk docs:

g - Proceed with dialplan execution at the next priority in the current extension if the destination channel hangs up.

If anyone has some ideas how to improve this, feel free to share.

Thanks again

1 Like

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