[asterisk-bugs] [Asterisk 0013651]: [patch] Make func_realtime work more like app_realtime

Asterisk Bug Tracker noreply at bugs.digium.com
Tue Nov 18 13:16:00 CST 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13651 
====================================================================== 
Reported By:                Corydon76
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   13651
Category:                   Functions/func_realtime
Reproducibility:            N/A
Severity:                   feature
Priority:                   normal
Status:                     ready for testing
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 147591 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             2008-10-09 08:36 CDT
Last Modified:              2008-11-18 13:15 CST
====================================================================== 
Summary:                    [patch] Make func_realtime work more like
app_realtime
Description: 
As requested on the -users list, make 2 new methods in func_realtime, one
called REALTIME_FIELD, which retrieves a single field from realtime, and
one called REALTIME_HASH, which retrieves a single record from realtime, in
a format appropriate for assigning to the HASH() function.
====================================================================== 

---------------------------------------------------------------------- 
 (0094996) blitzrage (administrator) - 2008-11-18 13:15
 http://bugs.digium.com/view.php?id=13651#c94996 
---------------------------------------------------------------------- 
development*CLI> sip show peers
Name/username              Host            Dyn Nat ACL Port     Status    
Realtime
105/105                    192.168.128.129  D          5060    
Unmonitored Cached RT


mysql> select * from sipfriends;
+------+---------+---------+---------+-----------------+------+------------+
| name | host    | secret  | context | ipaddr          | port | regseconds
|
+------+---------+---------+---------+-----------------+------+------------+
| 105  | dynamic | welcome | start   | 192.168.128.129 | 5060 | 1227024431
| 
+------+---------+---------+---------+-----------------+------+------------+
1 row in set (0.00 sec)


----------------
extconfig.conf |
----------------

sipusers => odbc,asterisk,sipfriends
sippeers => odbc,asterisk,sipfriends


-----------------
extensions.conf |
-----------------

exten => 200,1,NoOp()
exten => 200,n,Answer()
exten => 200,n,Set(RES=${REALTIME_FIELD(sippeers,name,105,context)})
exten => 200,n,Verbose(2,Value of RES is: ${RES})
exten => 200,n,Hangup()


--------
RESULT |
--------

    -- Executing [200 at start:1] NoOp("SIP/105-b0001fc8", "") in new stack
    -- Executing [200 at start:2] Answer("SIP/105-b0001fc8", "") in new
stack
    -- Executing [200 at start:3] Set("SIP/105-b0001fc8", "RES=") in new
stack
    -- Executing [200 at start:4] Verbose("SIP/105-b0001fc8", "2,Value of RES
is: ") in new stack
  == Value of RES is: 
    -- Executing [200 at start:5] Hangup("SIP/105-b0001fc8", "") in new
stack





Perhaps I'm missing something here?  This is just the test I did for
REALTIME_FIELD() function. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2008-11-18 13:16 blitzrage      Note Added: 0094996                          
======================================================================




More information about the asterisk-bugs mailing list