[OpenSER-Users] Relaying to outbound proxy

Adrian A adrianvoip at gmail.com
Mon Mar 17 22:43:26 CET 2008


Thanks, that is what I thought as well after reading the module
documentation.

I'm still looking for ways to solve this so any pointers are much
appreciated.

Currently I have the following at the end of the main route:

if (avp_db_query("SELECT ob_proxy FROM subscriber WHERE username = '$rU'",
"$avp(s:ob_proxy)")) {
            xlog("L_INFO", "SIP Request: method [$rm] from [$fu] to [$tu]
after avp [$avp(s:ob_proxy)]\n");
            avp_printf("$du", "sip:$avp(s:ob_proxy):5060");
        };

This sets the destination URI to be the outbound proxy that the user is
provisioned with. I would prefer an alternative solution without the need of
an extra DB call and avp operations. This also does not seem to work if
there are multiple branches (multiple locations for the user) - only one of
them is relayed to the other proxy.

Thanks,
Adrian




On Mon, Mar 17, 2008 at 1:40 PM, Andreas Granig <agranig at sipwise.com> wrote:

> Adrian,
>
> I see. So on the proxy where you call add_path_received(), you don't
> send out the request again but just call save() then? For such a
> scenario it unfortunately doesn't work.
>
> Andreas
>
> Adrian A wrote:
> > Hi Andreas,
> >
> > I have set the configuration as you mentioned below but it does not seem
> > to help. Let me give you some more details about what I'm trying to
> > accomplish.
> >
> > In my setup, there are 2 proxies: Proxy A and Proxy B. Depending on the
> > physical location, some users register to Proxy A and some to Proxy B.
> > The openser database is shared between the two proxies.
> >
> > Here is the call scenario that I'm looking to get working:
> >
> > 1. User Bob registers to Proxy A with a particular NAT binding
> > 2. External call comes in to Proxy B for user Bob.
> > 3. Proxy B tries to contact Bob at the location from the usrloc table
> > but because the NAT binding does not know anything about Proxy B's IP,
> > the request is not passed trough.
> >
> > What I need is for Proxy B to send the request to Proxy A so this can
> > then relay to client.
> >
> > I have added the modparam settings on both proxies (since both can act
> > as both outbound proxies and registrar for different users) and added
> > inside the route:
> >
> > ...
> > If (uri == myself) {
> >    ...
> >    If (is_method("REGISTER")) {
> >         add_path_received();
> >         ...
> >
> > I would have expected that this would add something to the 'path' value
> > in the location table, but this is still NULL after user registers.
> >
> > Thanks,
> > Adrian
> >
> >
> > On Mon, Mar 17, 2008 at 7:57 AM, Andreas Granig <agranig at sipwise.com
> > <mailto:agranig at sipwise.com>> wrote:
> >
> >     Hi Adrian,
> >
> >     I wrote the path module for exactly the scenario you describe here,
> so
> >     it should work for you as well :)
> >
> >     So, on your outbound proxy you have to set:
> >
> >     loadmodule "path.so"
> >     modparam("path", "use_received", 1)
> >
> >     As well as something like the following in your routes:
> >
> >     if(method=="REGISTER") { add_path_received(); }
> >
> >     An on your registrar/proxy, you have to set:
> >
> >     modparam("registrar", "use_path", 1)
> >     modparam("registrar", "path_mode", 0)
> >     modparam("registrar", "path_use_received", 1)
> >
> >     Cheers,
> >     Andreas
> >
> >
> >
> >     Adrian A wrote:
> >      > Does anyone know how to use the Path functions or has an
> alternative
> >      > method of solving this issue with multiple proxies?
> >      >
> >      > Thanks in advance.
> >      >
> >      >
> >      > On Sat, Mar 15, 2008 at 7:45 PM, Iñaki Baz Castillo
> >     <ibc at aliax.net <mailto:ibc at aliax.net>
> >      > <mailto:ibc at aliax.net <mailto:ibc at aliax.net>>> wrote:
> >      >
> >      >     El Domingo, 16 de Marzo de 2008, Adrian A escribió:
> >      >      > I've looked over the RFC and the module and while they
> >     describe a
> >      >     slightly
> >      >      > different scenario (with a load balancer and separate
> >      >     registrars), it seems
> >      >      > like it should work.
> >      >      >
> >      >      > I've added the required parameters to the config:
> >      >      >
> >      >      > modparam("registrar", "use_path", 1)
> >      >      > modparam("registrar", "path_mode", 0)
> >      >      > modparam("registrar", "path_use_received", 1)
> >      >      > modparam("path", "use_received", 1)
> >      >      >
> >      >      > Then, in my auth section, I store the path:
> >      >      >
> >      >      > if (is_method("REGISTER")) {
> >      >      >             add_path();
> >      >      >
> >      >      > This does not seem to do anything however, the proxy still
> >     forwards
> >      >      > directly to the client instead of sending it to the proper
> >      >     outbound proxy.
> >      >      > I looked in the location table and I see path is set to
> >     NULL so
> >      >     unless this
> >      >      > is stored in some other place, the proxy would not know
> >     where to
> >      >     send it
> >      >      > anyway.
> >      >      >
> >      >      > Have you used this? Am I doing something wrong? I could
> >     not find
> >      >     on this
> >      >      > list or anywhere a sample openser config that uses it...
> >      >
> >      >     Sorry, I've not used it, but I'm 100% sure that it's what you
> >     need.
> >      >
> >      >
> >      >     --
> >      >     Iñaki Baz Castillo
> >      >
> >      >     _______________________________________________
> >      >     Users mailing list
> >      >     Users at lists.openser.org <mailto:Users at lists.openser.org>
> >     <mailto:Users at lists.openser.org <mailto:Users at lists.openser.org>>
> >      >     http://lists.openser.org/cgi-bin/mailman/listinfo/users
> >      >
> >      >
> >      >
> >      >
> >
> ------------------------------------------------------------------------
> >      >
> >      > _______________________________________________
> >      > Users mailing list
> >      > Users at lists.openser.org <mailto:Users at lists.openser.org>
> >      > http://lists.openser.org/cgi-bin/mailman/listinfo/users
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kamailio.org/pipermail/users/attachments/20080317/498c71ec/attachment.htm 


More information about the Users mailing list