[asterisk-bugs] [JIRA] (ASTERISK-29486) Hint-like extension value lookup function without device state

George Joseph (JIRA) noreply at issues.asterisk.org
Wed Aug 4 11:55:33 CDT 2021


    [ https://issues.asterisk.org/jira/browse/ASTERISK-29486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=255780#comment-255780 ] 

George Joseph commented on ASTERISK-29486:
------------------------------------------

I think I get it now.  Would something like this work for you?
{code}
[customer-groups]
exten => _55XXXXX,1,Return(1)
exten => _6[23]3NXXX,1,Return(17)
exten => _652[6-9]XXX,1,Return(${EXTEN:-4:1})

[default]
same = n,DoSomething(${CALL_SUB(customer-groups,${CALLERID(num)},1))})

{code}

CALL_SUB would be a function that calls the GoSub application and _returns_ the value instead of saving it in GOSUB_RETVAL.
Then I think this would solve your problem but also allows users to create custom functions in Lua and AEL and call them easily from the dialplan.

You could implement this in app_stack.c where the Gosub app is implemented to make it even easier.




> Hint-like extension value lookup function without device state
> --------------------------------------------------------------
>
>                 Key: ASTERISK-29486
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-29486
>             Project: Asterisk
>          Issue Type: New Feature
>      Security Level: None
>          Components: Functions/NewFeature
>    Affects Versions: 18.4.0
>            Reporter: N A
>            Assignee: N A
>
> This is a new function that works like the HINT function, only a separate priority is used so that device state overhead is not added. This can provide a mechanism for a fast, efficient, and clean extension value lookup in the dialplan using native core extension pattern matching capabilities to retrieve extension values, including substituting variables.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list