Deprecated app_realtime and replacement

Hey everybody, me again (unfortunately).

Asterisk 1.4 is really great and I love it but:

I’m having a hard time with the replacement function of app_realtime().

I use the REALTIME function in extensions.conf to interact with ODBC -> MySQL.

Unfortunately I see the REALTIME() from app_realtime is deprecated in 1.4, and I continually get the warning:

Warning begone! What do I do to get rid of it? What function usable in extensions.conf can be used to replace REALTIME(), RealTime, ReAlTiMe, R34Lt1M3 or however you want to spell it (if l337sp33k is your thing).

I looked around, found nothing in the wiki, on the forums, or in the text files that came with the asterisk 1.4 source. There’s brief descriptions of using REALTIME() (allcaps?) instead of RealTime, but I think it’s some digium inside joke or something. Googled it up, seems like no one cares about the replacement of RealTime, so what do I use, directly in extensions.conf.

Previously, I used:

exten => 101,1,REALTIME(whoopdeedoo|giggity|potato|var_)And it worked, oh my, beautifully if I may say so. But never again must it be used.

What would my command become now that this delightful command has been deprecated (you monsters!)?

And the CLI function “realtime load” is that deprecated too? Should/Can I use “realtime load” in some AGI stuff or is that a big no-no too?

So I guess in retrospect, my question is by what would I replace my usage of REALTIME in extensions.conf so that I can forever banish this warning into oblivion?

Many thanks to all of you!

Ok, so here goes again.

So I have a mysql table called “namestable” in a mysql database called “asterisk”.

My table is like so:

+---+------+----------+ | id | age | name | +---+------+----------+ | 1 | 32 | eric | | 2 | 61 | cosmo | | 3 | 98 | ernie | | 4 | 82 | bob | | 5 | 17 | john | +---+------+----------+

I had my function previously using app_realtime(), like so:

So it searched in the mysql table named “namestable”, in the column called “name” for some record whose name is “ernie”. It then put all the fields of that particular record in variables prefixed with “var_”.

If I wanted the name, I used ${var_name}. I got “ernie”.
If I wanted the age, I used ${var_age}. I got “98”.
If I wanted the id, I used ${var_id}. I got “3”.

It worked fine.

Now I figured out this much: Using realtime() (whatever the case) always yielded the warning, because it seemed to use, by default app_realtime.

So I modified modules.conf as to not load, since it always seemed to use it.

Now using the REALTIME() function yielded a warning, along the lines of “no such function”.

So I modified modules.conf again as to load the module, to be able to use the new dialplan function REALTIME().

Now the REALTIME() dialplan function “sort of” works. Yields no warnings or errors, but it seems to be flawed in some huge way:

It doesn’t seem to work. It does not seem to interact in with my table properly.

I use it in the following way:

From what I can guess from the documentation, this is accurate to extract a string containing all the values from the “ernie” record of the database.

I think those are the correct arguments… I cannot imagine any other way of using it as it needs three things:
-The table name: “namestable” in this case.
-The column on which I wish to obtain a match: “name” in this case.
-The value I am looking for in said column: “ernie” in this case.

Unfortunately, this doesn’t work at all.
The value I get from this function call is this: ¶

That’s all that there is in my string.

Does anyone know what is going on? If I use app_realtime it works perfectly, so it’s not my mysql table, or the odbc. It’s something with this function, but I can’t seem to figure it out.

edit: corrected a minor syntax error.

Still no luck, and from my point of view it’s really really looking like func_realtime might not work.

Has anyone gotten it to work? Is it my syntax?

Because the database is fine, it works very well with the deprecated app_realtime.

So what do I do here? What happens now? I’m open to suggestion as I’m all out of ideas.

Look at my example on


I realise this is not what you asked for, but…

Use an AGI to get stuff from your DB. I used an example AGI (in PHP), then just put in a mysql-connection, and hey, I was done.

use it, dont use it… :smile:

Thanks for trying to help, but I solved it a while ago without resorting to AEL, AGI or anything.

The wonder thingy is called FUNC_ODBC and it’s brand spanking new in Asterisk, and works like magic.