<html><head></head><body><div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;"><div></div>
            <div>Awesome.</div><div><br></div><div>Thanks</div><div><br></div><div>KD</div><div><br></div>
            
            <div id="yahoo_quoted_6627034238" class="yahoo_quoted">
                <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
                    
                    <div>
                        On Thursday, May 17, 2018, 11:38:14 AM EDT, Ovidiu Sas <osas@voipembedded.com> wrote:
                    </div>
                    <div><br></div>
                    <div><br></div>
                    <div><div dir="ltr">1. Here's the documentation for while loop:<br clear="none"><a shape="rect" href="http://www.kamailio.org/wiki/cookbooks/devel/core#while" target="_blank">http://www.kamailio.org/wiki/cookbooks/devel/core#while</a><br clear="none"><br clear="none">2. Here are some string helper functions:<br clear="none"><a shape="rect" href="http://www.kamailio.org/wiki/cookbooks/devel/transformations#ssubstr_offset_length" target="_blank">http://www.kamailio.org/wiki/cookbooks/devel/transformations#ssubstr_offset_length</a><br clear="none"><a shape="rect" href="http://www.kamailio.org/wiki/cookbooks/devel/transformations#sselect_index_separator" target="_blank">http://www.kamailio.org/wiki/cookbooks/devel/transformations#sselect_index_separator</a><br clear="none"><br clear="none">3. You can browse documentation here:<br clear="none"><a shape="rect" href="http://www.kamailio.org/wiki/#cookbooks" target="_blank">http://www.kamailio.org/wiki/#cookbooks</a><br clear="none"><br clear="none"><br clear="none">Regards,<br clear="none">Ovidiu Sas<br clear="none"><div class="yqt9799354107" id="yqtfd60700"><br clear="none">On Wed, May 16, 2018 at 5:59 PM, KamDev Essa <<a shape="rect" ymailto="mailto:kamdevessa@yahoo.com" href="mailto:kamdevessa@yahoo.com">kamdevessa@yahoo.com</a>> wrote:<br clear="none">> I have decided to do Hunting DIY. I needed some help with the cfg script<br clear="none">> part and using a database dip.<br clear="none">><br clear="none">> Say I do the db dip<br clear="none">><br clear="none">> sql_xquery("ca", "call usp_GetHuntBranches( '$rU', '$rd');", "ra");<br clear="none">><br clear="none">> that will return the uri/q pairs and I will add using append_branch<br clear="none">> dynamically.<br clear="none">><br clear="none">> How do I do the looping in the script?<br clear="none">><br clear="none">> I have 2 ways to deliver the list via the sp.<br clear="none">><br clear="none">> Rows with uri and q values. easiest<br clear="none">> Single row with variable paired fields like say ur1,q1,ur2,q2 etc etc<br clear="none">><br clear="none">> Questions :<br clear="none">><br clear="none">> Can the script handle  sql_xquery with multiple rows. If so, can I get a<br clear="none">> code snippet or example that show me how to iterate through. Is there a<br clear="none">> "while" loop capability in the script?<br clear="none">> Is there a "substring" or "split" function in the script that could allow me<br clear="none">> to get the data as a single text with uri and q separated by a \ or |.<br clear="none">> Or is there a document that explains the various generic functions I can use<br clear="none">> the cfg script area.<br clear="none">><br clear="none">> KD</div><br clear="none">><br clear="none">> _______________________________________________<br clear="none">> Kamailio (SER) - Users Mailing List<br clear="none">> <a shape="rect" ymailto="mailto:sr-users@lists.kamailio.org" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a><br clear="none">> <a shape="rect" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br clear="none">><br clear="none"><br clear="none"><br clear="none"><br clear="none">-- <br clear="none">VoIP Embedded, Inc.<br clear="none"><a shape="rect" href="http://www.voipembedded.com" target="_blank">http://www.voipembedded.com</a><br clear="none"><br clear="none">_______________________________________________<br clear="none">Kamailio (SER) - Users Mailing List<br clear="none"><a shape="rect" ymailto="mailto:sr-users@lists.kamailio.org" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a><br clear="none"><a shape="rect" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><div class="yqt9799354107" id="yqtfd21323"><br clear="none"></div></div></div>
                </div>
            </div></div></body></html>