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