Hello all<div><br></div><div>we&#39;ve been thinking of extending the dialplan module for using redis as its backend. These are our thoughts of how we to use it.</div><div>For a regular sql backend, each table has 4 main fields:</div>
<div>dpid,match_exp,subst_exp,repl_exp</div><div>dpid is given as argument to the only function exported by the module (dp_translate). There are two additional arguments to the function, the source variable upon which the lookup and translation are to be performed and the variable where the transformation will be stored. There are no tables/rows in redis, so the approach we were thinking -there are many- was using a hash for each pair (dpid,match_exp). </div>
<div>An example might help:</div><div>Let&#39;s say we have this row in potsgres:</div><div>dpid|match_exp|subst_exp|repl_exp</div><div>1  | ^34 | ^34(.*) | \1</div><div><br></div><div>According to this approach it would translate into this redis structure:</div>
<div>key = 1:^34</div><div>field 1 name = subst_exp ; value = ^34(.*)</div><div>field 2 name = repl_exp ; value = \1</div><div><br></div><div>The field names could be configurable as module parameters, and we could add &quot;redis&quot; and driver in the dburl parameter.</div>
<div><br></div><div>It would be great to now the opinions of the list about this approach, since there are several other ways to accomplish this:</div><div><br></div><div>-&quot;by hand&quot; from the kamailio script</div>
<div>-LUA </div><div>-Implementing a new module</div><div><br></div><div>We would be happy to implement it once there is an agreement on how to proceed. As far as I see it, several modules could be extended in a similar way.</div>
<div><br></div><div>Thanks in advance</div><div><br></div><div>Javi</div><div><br></div><div><br></div>