User Tools

Site Tools


embeddedapi:devel:lua

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revision Both sides next revision
embeddedapi:devel:lua [2011/12/28 11:13]
miconda created
embeddedapi:devel:lua [2014/01/03 16:16]
linuxmaniac [sr.xavp.get]
Line 306: Line 306:
 </code> </code>
  
 +===== SR.XAVP =====
 +
 +xavp management functions.
 +
 +==== sr.xavp.get_keys ====
 +
 +returns an array table with the key names of the xavp variable.
 +
 +Prototype
 +
 +<code c>
 +t = sr.xavp.get_keys("xavp_name", 0)
 +</code>
 +
 +Example
 +
 +<code c>
 +$xavp(test=>one) = 1;
 +$xavp(test[0]=>two) = "two";
 +$xavp(test[0]=>three) = 3;
 +</code>
 +
 +<code c>
 +t = sr.xavp.get_keys("test", 0)
 +for k,v in pairs(t) do
 +  sr.log("info", string.format("%d:%s\n", k, v))
 +end
 +</code>
 +
 +Result
 +
 +<code c>
 +1:three
 +2:two
 +3:one
 +</code>
 +
 +==== sr.xavp.get ====
 +
 +returns a dictionary table with the values of the xavp variable.
 +Third param is optional and it choose between get all the values of a key ( 0, default) or just the first ones (1)
 +
 +If second param is nil will return all indexes. If second param is <0 will return the index counting from then end ( -1 is the last value )
 +
 +Prototype
 +
 +<code c>
 + sr.xavp.get(xavp_name, indx, flag)
 +</code>
 +
 +Example
 +
 +<code c>
 +$xavp(test=>a) = 4;
 +$xavp(test[0]=>b) = "four";
 +$xavp(test[0]=>a) = 5;
 +$xavp(test[0]=>b) = "five";
 +$xavp(test[0]=>a) = 6;
 +$xavp(test[0]=>b) = "six";
 +
 +$xavp(test=>a) = 1;
 +$xavp(test[0]=>a) = 2;
 +$xavp(test[0]=>a) = 3;
 +$xavp(test[0]=>b) = "one";
 +$xavp(test[0]=>b) = "two";
 +$xavp(test[0]=>b) = "three";
 +</code>
 +
 +<code c>
 + t = sr.xavp.get("test", 0, 0)
 + sr.log("dbg", string.format("sr.xavp.get('test', 0, 0)->%s\n", table.tostring(t)))
 + t = sr.xavp.get("test", 0, 1)
 + sr.log("dbg", string.format("sr.xavp.get('test', 0, 1)->%s\n", table.tostring(t)))
 + t = sr.xavp.get("test", nil, 0)
 + sr.log("dbg", string.format("sr.xavp.get('test', nil, 0)->%s\n", table.tostring(t)))
 + t = sr.xavp.get("test", nil, 1)
 + sr.log("dbg", string.format("sr.xavp.get('test', nil, 1)->%s\n", table.tostring(t)))
 + t = sr.xavp.get("test", -1, 1)
 + sr.log("dbg", string.format("sr.xavp.get('test', -1, 1)->%s\n", table.tostring(t)))
 +</code>
 +
 +Result
 +
 +<code c>
 + sr.xavp.get('test', 0, 0)->{a={3,2,1},b={"three","two","one"}}
 + sr.xavp.get('test', 0, 1)->{a=3,b="three"}
 + sr.xavp.get('test', nil, 0)->{{a={3,2,1},b={"three","two","one"}},{a={6,5,4},b={"six","five","four"}}}
 + sr.xavp.get('test', nil, 1)->{{a=3,b="three"},{a=6,b="six"}}
 + sr.xavp.get('test', -1, 1)->{a=6,b="six"}
 +</code>
 ===== SR.SL Package ===== ===== SR.SL Package =====
  
Line 483: Line 573:
 </code> </code>
  
 +==== sr.sqlops.xquery ====
 +
 +Execute SQL query and store in XAVP.
 +
 +Prototype
 +
 +<code c>
 +sr.sqlops.xquery("connection", "query", "xavp")
 +</code>
  
 ===== SR.RR Package ===== ===== SR.RR Package =====
Line 621: Line 720:
  
  
-===== SR.dispatcher Package =====+===== SR.DISPATCHER Package =====
  
 ==== sr.dispatcher.select ==== ==== sr.dispatcher.select ====
Line 674: Line 773:
 sr.xhttp.reply(code, reason, content-type, body) sr.xhttp.reply(code, reason, content-type, body)
 </code> </code>
 +
 +===== SR.MSILO Package =====
 +
 +==== sr.msilo.store ====
 +
 +==== sr.msilo.dump ====
 +
 +===== SR.SDPOPS Package =====
 +
 +==== sr.sdpops.sdp_with_media ====
 +
 +===== SR.PRESENCE Package =====
 +
 +==== sr.presence.pres_auth_status ====
 +
 +==== sr.presence.handle_publish ====
 +
 +==== sr.presence.handle_subscribe ====
 +
 +===== SR.PRESENCE_XML Package =====
 +
 +==== sr.presence_xml.pres_check_basic ====
 +
 +==== sr.presence_xml.pres_check_activities ====
 +
 +===== SR.TEXTOPS Package =====
 +
 +==== sr.textops.is_privacy ====
 +
 +===== SR.PUA_USRLOC Package =====
 +
 +==== sr.pua_usrloc.set_publish ====
 +
 +===== SR.SIPUTILS Package =====
 +
 +==== sr.siputils.has_totag ====
 +
 +==== sr.siputils.is_uri_user_e164 ====
 +
 +===== SR.RLS Package =====
 +
 +==== sr.rls.handle_subscribe ====
 +
 +==== sr.rls.handle_notify ====
 +
 +===== SR.ALIAS_DB Package =====
 +
 +==== sr.alias_db.lookup ====
 +
 +===== SR.UAC Package =====
 +
 +==== sr.uac.replace_from ====
 +
 +===== SR.TMX Package =====
 +
 +==== sr.tmx.t_suspend ====
 +
 +===== SR.MQUEUE Package =====
 +
 +==== sr.mq.add ====
 +
embeddedapi/devel/lua.txt ยท Last modified: 2017/06/23 11:31 by sdamm