[SR-Users] SIP routing configuration howto

Klaus Darilion klaus.mailinglists at pernau.at
Wed Aug 22 08:02:52 CEST 2012


Hi Michael!

Routing at IP layer would only happen if the proxy servers are also 
configured as routers and you have routing entries in the servers.

Depending an what you really need the configuration may differ. Below I 
sketch a very simple scenario with static routing.

On 21.08.2012 22:52, Kaplan, Michael A wrote:
> Folks,
>
> I’m working on a 5 node network in the following topology:
>
> Host1 – Edge Proxy 1 --- Core Proxy – Edge Proxy 2 – Host2

Ok. Lets give them names and addresses.

Host1 – Edge Proxy 1 --- Core Proxy – Edge Proxy 2 – Host2
           2.2.2.2                     4.4.4.4
1 at 1.1.1.1                 3.3.3.3                   5 at 5.5.5.5

UAC1 has the SIP URI sip:1 at 1.1.1.1, UAC2 has the SIP URI sip:5 at 5.5.5.5.

UAC1 calls UAC2 with static routing. UAC1 is configured to use 2.2.2.2 
as outbound proxy. Thus, UAC1 sends to Edge Proxy1 (ep1):

INVITE sip:5 at 5.5.5.5
Via: SIP/2.0/1.1.1.1:5060....

ep1 is configured to send everything, which does not come from the core 
proxy (cp), to the core proxy:

   if ($si != "3.3.3.3") {
     # forward to cp without changing the request URI
     $du = "sip:3.3.3.3";
   }
   t_relay();
   exit;

Thus, ep1 sends to cp:

INVITE sip:5 at 5.5.5.5
Via: SIP/2.0/2.2.2.2:5060....
Via: SIP/2.0/1.1.1.1:5060....

The cp has a static routing and knows which ep is responsible for a 
respective user.

   if ($ru == "sip:1 at 1.1.1.1") {
     # forward to ep without changing the request URI
     $du = "sip:2.2.2.2";
   } else if ($ru == "sip:5 at 5.5.5.5") {
     # forward to ep without changing the request URI
     $du = "sip:4.4.4.4";
   } else {
     sl_send_reply("404","Unknown User");
     exit;
   }
   t_relay();
   exit;

Thus, cp sends to ep2:

INVITE sip:5 at 5.5.5.5
Via: SIP/2.0/3.3.3.3:5060....
Via: SIP/2.0/2.2.2.2:5060....
Via: SIP/2.0/1.1.1.1:5060....


ep2 uses the same config as ep1 above and you are done (with this simple 
scenario). In dialog can be routed directly end-2-end or via the proxys 
when using record_route() and loose_route.

Note: This simple routing config does not give you any security (if this 
is relevant in your setup).

PS: With registration things get more complex and you should really 
understand the default configuration file and start playing around with 
1 proxy, or 1 proxy and 1 edge proxy, before building such complex networks.

PSS: If the proxyies are multihomed you should set mhomed=1

regards
Klaus





>
> The proxy machines contain SIP Server installations, the hosts contain
> user agent software. I am able to make a call end to end between the
> hosts, but when I look at the traffic in wireshark, the core proxy is
> actually just forwarding the messages at the IP-layer. I would like
> actual SIP routing to occur, where a host would send the INVITE to the
> edge, and the edge has to forward it to the core etc, with these
> messages actually being processed at the SIP layer for all proxy nodes.
> I’ve been trying to use the dynamic routing module, thought I’m not sure
> this is really right for what I need, simple static routing would likely
> work as well. Is it necessary for me to rewrite the route{} functions of
> a proxy script? I’m not sure if I’m approaching this problem the right
> way. Eventually I would like to have multiple core servers and be able
> to failover between them, but trying to keep it simple for now.
>
> Thanks,
>
> Mike
>
> --------------------------------
>
> Michael A. Kaplan
>
> Senior Research Scientist
>
> Applied Communication Sciences
>
> 732-699-3805 (office)
>
> 973-699-6775 (cell)
>
> mkaplan at appcomsci.com
>
> **
>
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>



More information about the sr-users mailing list