[asterisk-users] about REALTIME application

Rilawich Ango maillisting at gmail.com
Mon Aug 13 05:51:12 CDT 2007


Hi all,
  In version 1.2, there is a realtime function and it is very easy to
use with prefix.
exten => s,1,RealTime(table|name|peter|user_)
and we can easy get back the value as user_name, user_id, etc.
However, I found the the function will be depreciated in 1.4.  There
is a replacement using application REALTIME.  I found that it is very
troublesome to use it.
---------from web site---------
   Set(row="${REALTIME(sipusers,callerid,${EXTEN})}"); //executing
SELECT * FROM <sipusers>* WHERE callerid=${EXTEN} into variable $row
   NoOp(${row});
   Set(col_name_pair=${CUT(row,"|",1)});
   NoOp(${col_name_pair}); //col_name_pair become: name=mysipuser
   Set(col_name=${CUT(col_name_pair,"=",2)});
   NoOp(${col_name}); //col_name become: mysipuser (and that's what we want)
------------------------------------
As you can see, we need to count the position of the key-value pair
that we can to get.  It causes many problems.
1. Changing the table scheme will change that position
2. If there is a null field, the position will be shifted.

I want to know how you can make use of the REALTIME application.  It
seems RealTime function is much better, in term of using in dial plan,
than REALTIME application.  Any comment?

Ango



More information about the asterisk-users mailing list