Using cidlookup causes an inconsistent pause before the main IVR starts, so would it make sense to run the cidlookup in the background? I was thinking about starting a script in the background using luarun, and having it set the cid_name before the caller is done with the IVR. The question is how to pass the variable to the main thread? Or am I looking for too much trouble here? -- Steve
If you get an outside thread -- via ESL or it does seem like luarun goes into the background, then all it has to do is know the UUID and it can use uuid_setvar <http://wiki.freeswitch.org/wiki/Mod_commands#uuid_setvar> to set effective_caller_id_name after the lookup. Just if that doesn't finish before the bridge, it's not very helpful. Once you get this working, putting the example on the lua or cidlookup page would be great. -Avi Marcus BestFone On Tue, Mar 12, 2013 at 3:04 AM, Steven Schoch < schoch+freeswitch.org@xwin32.com> wrote:
Using cidlookup causes an inconsistent pause before the main IVR starts, so would it make sense to run the cidlookup in the background? I was thinking about starting a script in the background using luarun, and having it set the cid_name before the caller is done with the IVR. The question is how to pass the variable to the main thread?
Or am I looking for too much trouble here?
-- Steve
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
That worked! I'll put it on the mod_cidlookup page as soon as my wiki account is set up. -- Steve On Tue, Mar 12, 2013 at 1:34 AM, Avi Marcus <avi@avimarcus.net> wrote:
If you get an outside thread -- via ESL or it does seem like luarun goes into the background, then all it has to do is know the UUID and it can use uuid_setvar <http://wiki.freeswitch.org/wiki/Mod_commands#uuid_setvar> to set effective_caller_id_name after the lookup. Just if that doesn't finish before the bridge, it's not very helpful.
Once you get this working, putting the example on the lua or cidlookup page would be great.
Don't forget to find some way to handle the race condition of the bridge ending before the cidlookup has finished, and to add a note on that when putting the info on the wiki. -Steve On 12 March 2013 17:49, Steven Schoch <schoch+freeswitch.org@xwin32.com>wrote:
That worked! I'll put it on the mod_cidlookup page as soon as my wiki account is set up.
-- Steve
On Tue, Mar 12, 2013 at 1:34 AM, Avi Marcus <avi@avimarcus.net> wrote:
If you get an outside thread -- via ESL or it does seem like luarun goes into the background, then all it has to do is know the UUID and it can use uuid_setvar <http://wiki.freeswitch.org/wiki/Mod_commands#uuid_setvar> to set effective_caller_id_name after the lookup. Just if that doesn't finish before the bridge, it's not very helpful.
Once you get this working, putting the example on the lua or cidlookup page would be great.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
On Tue, Mar 12, 2013 at 11:14 AM, Steven Ayre <steveayre@gmail.com> wrote:
Don't forget to find some way to handle the race condition of the bridge ending before the cidlookup has finished, and to add a note on that when putting the info on the wiki.
The script ends with these lines: number = api:executeString("uuid_getvar " .. uuid .. " caller_id_number"); name = api:executeString("cidlookup " .. number); api:executeString("uuid_setvar " .. uuid .. " effective_caller_id_name " .. name); I'm assuming that if the channel is destroyed while in the middle of the cidlookup, that the uuid_setvar call will simply fail. The script will exit in either case. Am I missing something? -- Steve
That would be okay, although you might want to print a little debug info somewhere, just in case you need to troubleshoot. In any case, if the uuid isn't there then the uuid_setvar would return an error and no harm would be done. -MC On Tue, Mar 12, 2013 at 1:03 PM, Steven Schoch < schoch+freeswitch.org@xwin32.com> wrote:
On Tue, Mar 12, 2013 at 11:14 AM, Steven Ayre <steveayre@gmail.com> wrote:
Don't forget to find some way to handle the race condition of the bridge ending before the cidlookup has finished, and to add a note on that when putting the info on the wiki.
The script ends with these lines:
number = api:executeString("uuid_getvar " .. uuid .. " caller_id_number"); name = api:executeString("cidlookup " .. number); api:executeString("uuid_setvar " .. uuid .. " effective_caller_id_name " .. name);
I'm assuming that if the channel is destroyed while in the middle of the cidlookup, that the uuid_setvar call will simply fail. The script will exit in either case. Am I missing something?
-- Steve
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Michael S Collins Twitter: @mercutioviz http://www.FreeSWITCH.org http://www.ClueCon.com http://www.OSTAG.org
Well it depends on whether you're trying to use the variable after the bridge, or whether you expect it to be in your CDR. If you don't then yes it won't matter if it isn't set in time, and uuid_setvar will fail on a non-existant UUID without causing a problem. -Steve On 12 March 2013 20:03, Steven Schoch <schoch+freeswitch.org@xwin32.com>wrote:
On Tue, Mar 12, 2013 at 11:14 AM, Steven Ayre <steveayre@gmail.com> wrote:
Don't forget to find some way to handle the race condition of the bridge ending before the cidlookup has finished, and to add a note on that when putting the info on the wiki.
The script ends with these lines:
number = api:executeString("uuid_getvar " .. uuid .. " caller_id_number"); name = api:executeString("cidlookup " .. number); api:executeString("uuid_setvar " .. uuid .. " effective_caller_id_name " .. name);
I'm assuming that if the channel is destroyed while in the middle of the cidlookup, that the uuid_setvar call will simply fail. The script will exit in either case. Am I missing something?
-- Steve
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
On Tue, Mar 12, 2013 at 1:34 AM, Avi Marcus <avi@avimarcus.net> wrote:
Once you get this working, putting the example on the lua or cidlookup page would be great.
I stuck it on the mod_cidlookup page. Please, critique and modify as necessary. Perhaps someone could add code that logs a failure of the race condition you mentioned. -- Steve
participants (4)
-
Avi Marcus
-
Michael Collins
-
Steven Ayre
-
Steven Schoch