[SR-Users] Help with sip balancer

Bruno d4rkstar at gmail.com
Tue Aug 11 23:19:52 CEST 2015


Hello,
i'm on my first try with kamailio. I need to build a SIP balancer that
should keep SIP
registration from VoIP provider and route the calls to the asterisk boxes
where an IVR
will take care to answer.

Here's my network topology:

                                      +---> [asterisk1]
[public_ip]                           |    10.50.10.131
 [router]  <---NAT---> [kamailio] <---+
10.50.10.1            10.50.10.120    |
                                      +---> [asterisk2]
                                           10.50.10.132

In my setup i planned to use UAC and DISPATCHER modules. I started from the
"kamailio-basic.cfg" and added some extra lines to handle UAC and
DISPATCHER.

All is working fine when i do a test call from a softphone inside network
10.50.10.0/24.

When a call is coming from the sip carrier, troubles occurs because
asterisk boxes
are sending their internal ip in SDP.

I understand that i need to rewrite SDP in that case, but i actually don't
know how/where.

I've attached kamailio configuration and a sip trace taken with sngrep
where the problem
is visible.

For security reasons, i would like to force the RTP through RTPProxy.

I'm missing something, and need your help me to understand my errors.

Best Regards,
Bruno
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20150811/056d4556/attachment.html>
-------------- next part --------------
                                                     Call flow for 929B936-3F1111E5-9C28C7E1-A16E3F0E (Color by Request/Response)
                                                                                           │SIP/2.0 200 OK
            80.110.120.10:5060            10.50.10.120:5060             10.50.10.132:5060  │Via: SIP/2.0/UDP 10.50.10.120;branch=z9hG4bKe82d.a3414799f56e1046d9fede67b168a2ae.0;recei
          ──────────┬─────────          ──────────┬─────────          ──────────┬───────── │d=10.50.10.120;rport=5060
  05:37:29.196212   │  INV (80.110.120.12:57662)  │                             │          │Via: SIP/2.0/UDP 80.110.120.10:5060;rport=5060;branch=z9hG4bKe82d.0079d4c5.0
                    │ ──────────────────────────> │                             │          │Via: SIP/2.0/UDP 80.110.16.2:5060;rport=61413;received=80.110.16.2;x-route-tag="tgrp:Slot
  05:37:29.204187   │  100 trying -- your call is │                             │          │;branch=z9hG4bKA4079B1AD1
                    │ <────────────────────────── │                             │          │Record-Route: <sip:10.50.10.120;lr=on;ftag=32CDDD90-24CE>
  05:37:29.205294   │                             │  INV (80.110.120.12:57662)  │          │Record-Route: <sip:80.110.120.10;lr;ftag=32CDDD90-24CE;did=bb31.a983e793>
                    │                             │ ──────────────────────────> │          │From: <sip:8231288481 at 80.110.16.2>;tag=32CDDD90-24CE
  05:37:29.229975   │                             │         100 Trying          │          │To: <sip:9822147941 at voip.carrier.me>;tag=as355bc928
                    │                             │ <────────────────────────── │          │Call-ID: 929B936-3F1111E5-9C28C7E1-A16E3F0E at 80.110.16.2
  05:37:29.233990   │                             │  200 (10.50.10.132:10832)   │          │CSeq: 101 INVITE
                    │                             │ <────────────────────────── │          │Server: Asterisk PBX 13.1-cert2
  05:37:29.235113   │  200 (10.50.10.132:10832)   │                             │          │Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAG
                    │ <────────────────────────── │                             │          │Supported: replaces, timer
  05:37:29.333226   │                             │  200 (10.50.10.132:10832)   │          │Contact: <sip:9822147941 at 10.50.10.132:5060>
                    │                             │ <<<──────────────────────── │          │Content-Type: application/sdp
  05:37:29.335947   │  200 (10.50.10.132:10832)   │                             │          │Content-Length: 347
                    │ <<<──────────────────────── │                             │          │
  05:37:29.533537   │                             │  200 (10.50.10.132:10832)   │          │v=0
                    │                             │ <<<──────────────────────── │          │o=root 397373482 397373482 IN IP4 10.50.10.132
  05:37:29.535938   │  200 (10.50.10.132:10832)   │                             │          │s=Asterisk PBX 13.1-cert2
                    │ <<<──────────────────────── │                             │          │c=IN IP4 10.50.10.132
  05:37:29.934272   │                             │  200 (10.50.10.132:10832)   │          │t=0 0
                    │                             │ <<<──────────────────────── │          │m=audio 10832 RTP/AVP 3 18 8 0 101
  05:37:29.935421   │  200 (10.50.10.132:10832)   │                             │          │a=rtpmap:3 GSM/8000
                    │ <<<──────────────────────── │                             │          │a=rtpmap:18 G729/8000
  05:37:30.734051   │                             │  200 (10.50.10.132:10832)   │          │a=fmtp:18 annexb=no
                    │                             │ <<<──────────────────────── │          │a=rtpmap:8 PCMA/8000
  05:37:30.735388   │  200 (10.50.10.132:10832)   │                             │          │a=rtpmap:0 PCMU/8000
                    │ <<<──────────────────────── │                             │          │a=rtpmap:101 telephone-event/8000
  05:37:32.333693   │                             │  200 (10.50.10.132:10832)   │          │a=fmtp:101 0-16
                    │                             │ <<<──────────────────────── │          │a=ptime:20
  05:37:32.336746   │  200 (10.50.10.132:10832)   │                             │          │a=maxptime:150
                    │ <<<──────────────────────── │                             │          │a=sendrecv
  05:37:35.534111   │                             │  200 (10.50.10.132:10832)   │          │
                    │                             │ <<<──────────────────────── │          │
  05:37:35.535607   │  200 (10.50.10.132:10832)   │                             │          │
                    │ <<<──────────────────────── │                             │          │
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kamailio.cfg
Type: application/octet-stream
Size: 17576 bytes
Desc: not available
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20150811/056d4556/attachment.obj>


More information about the sr-users mailing list