[SR-Users] New functionality LCR + force_send_socket() - sanity check

Geoffrey Mina geoffreymina at gmail.com
Fri Jun 25 21:58:16 CEST 2010


Hey everyone,
Just wanted to bounce some things off the list to make sure I'm not heading
down the wrong path here.  I'll quickly explain my problem and then explain
my plan to deal with it.  Please let me know if anyone sees an issue here.

Problem: I need to send FROM two different IP addresses based on the LCR
group returned from next_gw();.  For example, if the gateway returned is in
group_id=1 from the LCR I need to send FROM 1.1.1.1:5060, if it's from
group_id=2, I need to send FROM 1.1.1.2:5060.  I need to do this on
REQUEST_ROUTE and FAILURE_ROUTE.  Here is what I am thinking will work:

modparam("pv","shvset","gw_one=s:1.1.1.1:5060")
modparam("pv","shvset","gw_two=s:1.1.1.2:5060")

route{

  load_gws();
  next_gw();

  if(to_gw("1")){
      force_send_socket($shv(gw_one));
   }else if(to_gw("2")){
      force_send_socket($shv(gw_two));
  }

}


Sorry for not just trying this out on my own.  I currently don't have access
to a dev machine, and I need to make changes to the live script... so I
would prefer not to have a ton of restarts while trying to work the bugs
out.


Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20100625/c04b2a27/attachment.htm>


More information about the sr-users mailing list