[Asterisk-code-review] func_lookup: Fork of HINT function (asterisk[master])

George Joseph asteriskteam at digium.com
Mon Aug 2 12:03:17 CDT 2021


Attention is currently required from: N A.
George Joseph has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/16075 )

Change subject: func_lookup: Fork of HINT function
......................................................................


Patch Set 9: Code-Review-1

(1 comment)

Patchset:

PS9: 
I think there are existing ways to do this... The one that comes to mind immediately is
a Lua function with DB and EVAL:

extensions.lua:
function mlookup(ctx, exten)
	key=channel['ARG1']:get()
	app.Return(channel.EVAL(channel.DB("lookups/" .. key):get()):get())
end
extensions['mlookup'] = { ["s"] = mlookup }

function madd(ctx, exten)
	key=channel['ARG1']:get()
	value=channel['ARG2']:get()
	channel.DB("lookups/" .. key):set(value)
	app.Return(0)
end
extensions['madd'] = { ["s"] = madd }

extensions.conf:
exten = 9999,1,Gosub(madd,s,1(abcdef,something))
same  = n,Gosub(mlookup,s,1(abcdef))
same  = n,Verbose(${GOSUB_RETVAL})



-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/16075
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Iad81019689674c9f4ac77d235f5d7234adbb1432
Gerrit-Change-Number: 16075
Gerrit-PatchSet: 9
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Sarah Autumn <sarah at endlesstemple.org>
Gerrit-Attention: N A <mail at interlinked.x10host.com>
Gerrit-Comment-Date: Mon, 02 Aug 2021 17:03:17 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210802/ab8e7d52/attachment.html>


More information about the asterisk-code-review mailing list