[asterisk-bugs] [JIRA] (ASTERISK-29486) Hint-like extension value lookup function without device state
George Joseph (JIRA)
noreply at issues.asterisk.org
Tue Aug 3 13:56:33 CDT 2021
[ https://issues.asterisk.org/jira/browse/ASTERISK-29486?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=255765#comment-255765 ]
George Joseph commented on ASTERISK-29486:
------------------------------------------
>From your email:
With LOOKUP, one could take code like this:
{code}
same => n,Gosub(billing-telnumber,${CALLERID(num)},1)
same => n,Set(btn=${GOSUB_RETVAL})
same => n,Gosub(feature-group,${CALLERID(num)},1)
same => n,Set(fg=${GOSUB_RETVAL})
same => n,DoSomething(${btn},${fg})
{code}
and replace it with:
{code}
same =>
n,DoSomething(${LOOKUP(${CALLERID(num)}@btn)},${LOOKUP(${CALLERID(num)}@fg})
{code}
I'm very confused. Exactly what do billing-telnumber and feature-group do? It appears that they set the btn and fg variables but if so, and the one-liner replaces the 5 lines above it, how do btn and fg get set?
The XML documentation for your function also uses {{extension at context}} but I'm not sure how that fits given that your email example uses variable names (btn and fg) instead of contexts.
Can you _please_ give us a real-world and complete example? The email example just begs the question... Why don't the billing-telnumber and feature-group subroutines just set channel variables? That eliminates the two Sets.
> 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