SIP Session Establishment Through Two Proxies with Kamailio

514 views Asked by At

I want to implement a session establishment SIP call through two SIP proxies. For that I am using Kamailio Server, but I do not know how to change kamailio.cfg (/etc/kamailio/kamailio.cfg) config file to do it. Any help?

This is the scenario I want to implement, where Alice and Bob are the SIP Clients (ekiga, blink, twinkle...) and Proxy 1 and Proxy 2 are two Kamailio servers.

Alice           Proxy 1          Proxy 2            Bob
 |                |                |                |
 |   INVITE F1    |                |                |
 |--------------->|                |                |
 |     407 F2     |                |                |
 |<---------------|                |                |
 |     ACK F3     |                |                |
 |--------------->|                |                |
 |   INVITE F4    |                |                |
 |--------------->|   INVITE F5    |                |
 |     100  F6    |--------------->|   INVITE F7    |
 |<---------------|     100  F8    |--------------->|
 |                |<---------------|                |
 |                |                |     180 F9     |
 |                |    180 F10     |<---------------|
 |     180 F11    |<---------------|                |
 |<---------------|                |     200 F12    |
 |                |    200 F13     |<---------------|
 |     200 F14    |<---------------|                |
 |<---------------|                |                |
 |     ACK F15    |                |                |
 |--------------->|    ACK F16     |                |
 |                |--------------->|     ACK F17    |
 |                |                |--------------->|
 |                Both Way RTP Media                |
 |<================================================>|
 |                |                |     BYE F18    |
 |                |    BYE F19     |<---------------|
 |     BYE F20    |<---------------|                |
 |<---------------|                |                |
 |     200 F21    |                |                |
 |--------------->|     200 F22    |                |
 |                |--------------->|     200 F23    |
 |                |                |--------------->|
 |                |                |                |

Thank you very much,

Alice

1

There are 1 answers

0
miconda On

If each proxy has its own DNS domain, then the routing is done via dns -- e.g., when [email protected] (user on proxy 1) is calling [email protected] (user on proxy 2). No specific change would be required in the default config.

If both proxies have the same domain, then you have to start from the default configuration file and change to:

  • in route[LOCATION] if lookup("location") is false and the request didn't come from the other server, send the request to the other server, like:
if(src_ip!=the.other.proxy.ip) {
    $du = "sip:the.other.proxy.ip";
    route(RELAY);
}
  • if the request is coming from the other server and lookup("location") is still false, then callee is offline, let kamailio return 404