[asterisk-users] make func_realtime work like app_realtime (1.6)

Wesley Haut wes at wesleyhaut.com
Wed Oct 8 12:33:15 CDT 2008


Yell at me if you will, but I hate func_realtime - it's not very usable nor
is it change-friendly (update your database and your dialplan completely
breaks).

I'm getting a new 1.6 box built out and working, and wanted to emulate the
functionality of APP_realtime somehow, so I started digging around in the
func_realtime source - here's what I came up with:

For 1.6.0, look at line 86 of func_realtime.c

ast_str_append(&out, 0, "%s%s%s%s", var->name, args.delim2, var->value, args
.delim1);

I simply changed this to:

pbx_builtin_setvar_helper(chan, var->name, var->value);

Now when I call the realtime function, I get the channel variables populated
instead of having to parse that godawful string to get at my data.

Again, yell at me if you will, but even Mark Spencer commented on how
func_realtime wasn't all that great, but nobody seems to have done anything
about it.

BTW - I don't code in C at all - this was just a bunch of searching and a
lucky guess...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20081008/845bb8b8/attachment.htm 


More information about the asterisk-users mailing list