Hi. https://wiki.asterisk.org/wiki/display/AST/Asterisk+16+Application_Originate I need to use Originate() in a dialplan, pointing to another location in the same extension of the same context, so for example: Originate(Local/${Dest}@Dialout,exten,${CONTEXT},${EXTEN},158); I don't seem to be able to substitute the priority 158 with a label - is this deliberate or is this a bug? If it is deliberate, is there any workaround which would enable me to use Originate when the dialplan is written in AEL, which makes it not possible for me to define priority numbers? (Alternatively, is there a way to define priority numbers in AEL?) I'd prefer the first solution - being able to use Originate with a label as the target - as it's neater and more generic. Thanks, Antony. -- "this restriction will not apply in the event of the occurrence (certified by the United States Centers for Disease Control or successor body) of a widespread viral infection transmitted via bites or contact with bodily fluids that causes human corpses to reanimate and seek to consume living human flesh, blood, brain or nerve tissue and is likely to result in the fall of organized civilization." - https://aws.amazon.com/service-terms/ paragraph 42.10 Please reply to the list; please *don't* CC me.
On 8/29/2022 8:31 AM, Antony Stone wrote:> Hi. > > https://wiki.asterisk.org/wiki/display/AST/Asterisk+16+Application_Originate > > I need to use Originate() in a dialplan, pointing to another location in the > same extension of the same context, so for example: > > Originate(Local/${Dest}@Dialout,exten,${CONTEXT},${EXTEN},158); > > I don't seem to be able to substitute the priority 158 with a label - is this > deliberate or is this a bug?The underlying API that Originate uses here (ast_pbx_outgoing_exten_predial) accepts an integer priority, not a string, which would preclude labels. However, Originate itself could accept a string and convert it to the integer priority before making that call. I think that would be an improvement/new feature, not a bug that exists today, per se, but an easy and useful enhancement at that. Another option would be a dialplan function to allow users to manually get the integer priority of a label, which could be useful for existing code that expects numeric priorities. NA
On 8/29/22 08:31, Antony Stone wrote:> Hi. > > https://wiki.asterisk.org/wiki/display/AST/Asterisk+16+Application_Originate > > I need to use Originate() in a dialplan, pointing to another location in the > same extension of the same context, so for example: > > Originate(Local/${Dest}@Dialout,exten,${CONTEXT},${EXTEN},158); > > I don't seem to be able to substitute the priority 158 with a label - is this > deliberate or is this a bug? > > If it is deliberate, is there any workaround which would enable me to use > Originate when the dialplan is written in AEL, which makes it not possible for > me to define priority numbers? > > (Alternatively, is there a way to define priority numbers in AEL?) > > I'd prefer the first solution - being able to use Originate with a label as the > target - as it's neater and more generic. > > > Thanks, > > > Antony. >Hi Anthony, I love to hear about AEL use-cases. I'm happy that AEL is working out for you. Without modifying the code for Originate(), you can do this while staying purely in AEL Here's your workaround: context something { s => { Originate(Local/${Dest}@Dialout,exten,${CONTEXT},GotoLabel,1,,v(GotoExten=${EXTEN}^GotoLabel=LabelName)); } GotoLabel => { goto ${CONTEXT}, ${GotoExten}, ${GotoLabel}; } }