<div dir="ltr"><div>thanks,</div>
<div>i will try it.</div>
<div>probably the best way i have.</div>
<div> </div>
<div>did you use the CFG_DB module somewhere?</div>
<div> </div>
<div>BR,</div>
<div> </div>
<div>--------------</div>
<div> </div>
<div>Hi,<br><br>you can easily use command substitution e.g. -A $(hostname) in your<br>script which starts kamailio or use mysql batch query to retrieve the<br>result if you wish to store it in database.<br><br>Michal<br>
<br>Uri Shacked píše v Pá 10. 02. 2012 v 15:32 +0200:<br>&gt;<i> thanks,<br></i>&gt;<i> it is good see there is a wayto start with -A... and it might make it<br></i>&gt;<i> easier a little (cause i use the define as the group the server<br>
</i>&gt;<i> belongs to).<br></i>&gt;<i> but, it doesn&#39;t help me fully in my case.<br></i>&gt;<i> i would like to have a generic start, and generic cfg file (it is much<br></i>&gt;<i> easier when you need to maintain).<br>
</i>&gt;<i> the best thing i would like to do is something like that:<br></i>&gt;<i>  <br></i>&gt;<i> let say i have &quot;route on start&quot; or &quot;get data from DB on start&quot;...<br></i>&gt;<i> then, i set something like:<br>
</i>&gt;<i>  <br></i>&gt;<i> get &quot;myself&quot; <br></i>&gt;<i> from list of kamailio servers&quot;<br></i>&gt;<i> and set my group to &quot;the value set on me&quot;<br></i>&gt;<i> <br></i>&gt;<i> it seems to me something very usefull, when you use 2 and more<br>
</i>&gt;<i> kamailio at different sites, and still want a generic code and<br></i>&gt;<i> functions.<br></i>&gt;<i>  <br></i>&gt;<i> if i was a programer... i might try to write some module :-)<br></i>&gt;<i>  <br></i>&gt;<i> thanks anyway,<br>
</i>&gt;<i> Uri<br></i>&gt;<i> <br></i>&gt;<i>  <br></i>&gt;<i> On Fri, Feb 10, 2012 at 2:51 PM, Daniel-Constantin Mierla<br></i>&gt;<i> &lt;<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">miconda at gmail.com</a>&gt; wrote:<br>
</i>&gt;<i>         Hello,<br></i>&gt;<i>         <br></i>&gt;<i>         you can use defines to control the order (the values of NP<br></i>&gt;<i>         servers), here is an example of defining NP servers (to str<br></i>&gt;<i>         value, for sake of explanation):<br>
</i>&gt;<i>         <br></i>&gt;<i>         #!ifdef SRV1<br></i>&gt;<i>         #!define NPSRV1 &quot;abc&quot;<br></i>&gt;<i>         #!define NPSRV2 &quot;xyz&quot;<br></i>&gt;<i>         #!else<br></i>&gt;<i>         #!define NPSRV2 &quot;abc&quot;<br>
</i>&gt;<i>         #!define NPSRV1 &quot;xyz&quot;<br></i>&gt;<i>         #!endif<br></i>&gt;<i>         <br></i>&gt;<i>         and start kamailio with parameter &#39;-A SRV1&#39; for the first<br></i>&gt;<i>         instance.<br>
</i>&gt;<i>         <br></i>&gt;<i>         Cheers,<br></i>&gt;<i>         Daniel <br></i>&gt;<i>         <br></i>&gt;<i>         <br></i>&gt;<i>         <br></i>&gt;<i>         On 2/10/12 6:28 AM, Uri Shacked wrote: <br>
</i>&gt;<i>         &gt; Hi again...<br></i>&gt;<i>         &gt; (i do find myself ask many questions these days.... :-))<br></i>&gt;<i>         &gt; <br></i>&gt;<i>         &gt; well, now here is one more:<br></i>&gt;<i>         &gt; <br>
</i>&gt;<i>         &gt; i have 2 kamailio servers that i use in 2 locations. both<br></i>&gt;<i>         &gt; use the same<br></i>&gt;<i>         &gt; tables and DBURL.<br></i>&gt;<i>         &gt; each of my server turns to a number portability (NP) server<br>
</i>&gt;<i>         &gt; at its same<br></i>&gt;<i>         &gt; location.<br></i>&gt;<i>         &gt; for example, if server 1 has the call, it will turn to NP<br></i>&gt;<i>         &gt; server 1 with the<br></i>&gt;<i>         &gt; query, and if the query fails, it will then turn to NP<br>
</i>&gt;<i>         &gt; server 2.<br></i>&gt;<i>         &gt; the kamailio server 2 does the same. but, turns to NP server<br></i>&gt;<i>         &gt; 2 first and if<br></i>&gt;<i>         &gt; it fails, to NP server 1.<br>
</i>&gt;<i>         &gt; <br></i>&gt;<i>         &gt; once this is understood....<br></i>&gt;<i>         &gt; <br></i>&gt;<i>         &gt; here is my issue - i want to have 1 generic cfg file for my<br></i>&gt;<i>         &gt; 2 servers.<br>
</i>&gt;<i>         &gt; today, i use the same cfg file, but in server 1 i set it in<br></i>&gt;<i>         &gt; the cfg to its<br></i>&gt;<i>         &gt; group, and on server 2 the same but a different group....<br></i>&gt;<i>         &gt; <br>
</i>&gt;<i>         &gt; i tried to understand how do i get each server to &quot;pull&quot; its<br></i>&gt;<i>         &gt; group from the<br></i>&gt;<i>         &gt; DB. something like &quot;what is my group when my IP is X.Y.Z.Q ?<br>
</i>&gt;<i>         &gt; i raed the cfg_db module but didn&#39;t understand how to set it<br></i>&gt;<i>         &gt; on my cfg file<br></i>&gt;<i>         &gt; and on the DB.<br></i>&gt;<i>         &gt; <br></i>&gt;<i>         &gt; what is the best way to do what i want?<br>
</i>&gt;<i>         &gt; hope i was clear....<br></i>&gt;<i>         &gt; <br></i>&gt;<i>         &gt; BR,<br></i>&gt;<i>         &gt; thanks to all the guys that help me so far, i appriciate it<br></i>&gt;<i>         &gt; a lot!<br>
</i>&gt;<i>         &gt; Uri<br></i>&gt;<i>         &gt; <br></i>&gt;<i>         &gt; <br></i>&gt;<i>         &gt; <br></i></div></div>