Kamailio 3.2.0

I am trying to setup kamailio to do the sip trunking. It  receive the sip traffic from customer and then send it to carrier.

I have two NIC interface’s assigned with three IP’s:

Interface 1: ( Public IP’s)

x.x.130.34

x.x.130.36  floating IP

interface 2: (private IP’s)

10.10.1.31

 

.36 is a floating IP  assigned by Linux-HA (heartbeat/pacemaker).

 

I only want to use .36 to receive and send sip traffic.

I uses  force_send_socket() to send INVITE with .36 IP.  But the ACK message always want to use .34 IP even the Route header has .36 in it unless I force it with force_send_socket() .

 

How can I fix this problem?   

See below for the SIP messages: (x.x.128.205 is customer IP, x.x.129.200 is PSTN gateway IP)

U x.x.128.205:51694 -> x.x.130.36:5060

  INVITE sip:5033441174@x.x.130.36:5060 SIP/2.0..Via: SIP/2.0/UDP  x.x.128.205:5060;branch=z9hG

  4bK1D3CD1..From: <sip:5024427578@x.x.128.205>;tag=24513088-D59..To: <sip:5033441174@x.x.130.3

  6>..Date: Tue, 03 Jul 2012 13:37:41 GMT..Call-ID: 1887588D-C44B11E1-BE38D697-98A3E39A@x.x.128.20

  5..Supported: 100rel,timer,replaces..Min-SE:  1800..Cisco-Guid: 411443261-3293254113-3191264919-256

  0877466..User-Agent: Cisco-SIPGateway/IOS-12.x..Allow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, CO

  MET, REFER, SUBSCRIBE, NOTIFY, INFO, UPDATE, REGISTER..CSeq: 101 INVITE..Max-Forwards: 70..Remote-P

  arty-ID: <sip:5024427578@x.x.128.205>;party=calling;screen=no;privacy=off..Timestamp: 1341322661

  ..Contact: <sip:5024427578@x.x.128.205:5060>..Expires: 180..Allow-Events: telephone-event..Conte

  nt-Type: application/sdp..Content-Length: 366....v=0..o=CiscoSystemsSIP-GW-UserAgent 9094 579 IN IP

  4 x.x.128.205..s=SIP Call..c=IN IP4 x.x.128.205..t=0 0..m=audio 19312 RTP/AVP 125 0 18 100 10

  1..c=IN IP4 x.x.128.205..a=rtpmap:125 X-CCD/8000..a=rtpmap:0 PCMU/8000..a=rtpmap:18 G729/8000..a

  =fmtp:18 annexb=yes..a=rtpmap:100 X-NSE/8000..a=fmtp:100 192-194..a=rtpmap:101 telephone-event/8000

  ..a=fmtp:101 0-16..

#

U x.x.130.36:5060 -> x.x.128.205:51694

  SIP/2.0 100 trying -- your call is important to us..Via: SIP/2.0/UDP  x.x.128.205:5060;branch=z9

  hG4bK1D3CD1;rport=51694..From: <sip:5024427578@x.x.128.205>;tag=24513088-D59..To: <sip:502244117

  4@x.x.130.36>..Call-ID: 1887588D-C44B11E1-BE38D697-98A3E39A@x.x.128.205..CSeq: 101 INVITE..Se

  rver: LVS Proxy 1.0..Content-Length: 0....

#

U x.x.130.36:5060 -> x.x.129.200:5060

  INVITE sip:15033441174@x.x.129.200:5060 SIP/2.0..Record-Route: <sip:x.x.130.36;lr=on>..Via: S

  IP/2.0/UDP x.x.130.36;branch=z9hG4bKc2ce.17a955a3.0..Via: SIP/2.0/UDP  x.x.128.205:5060;rport

  =51694;branch=z9hG4bK1D3CD1..From: <sip:5024427578@x.x.128.205>;tag=24513088-D59..To: <sip:50224

  41174@x.x.130.36>..Date: Tue, 03 Jul 2012 13:37:41 GMT..Call-ID: 1887588D-C44B11E1-BE38D697-98A3

  E39A@x.x.128.205..Supported: 100rel,timer,replaces..Min-SE:  1800..Cisco-Guid: 411443261-3293254

  113-3191264919-2560877466..User-Agent: Cisco-SIPGateway/IOS-12.x..Allow: INVITE, OPTIONS, BYE, CANC

  EL, ACK, PRACK, COMET, REFER, SUBSCRIBE, NOTIFY, INFO, UPDATE, REGISTER..CSeq: 101 INVITE..Max-Forw

  ards: 69..Remote-Party-ID: <sip:5024427578@x.x.128.205>;party=calling;screen=no;privacy=off..Tim

  estamp: 1341322661..Contact: <sip:5024427578@x.x.128.205:51694>..Expires: 180..Allow-Events: tel

  ephone-event..Content-Type: application/sdp..Content-Length: 375....v=0..o=CiscoSystemsSIP-GW-UserA

  gent 9094 579 IN IP4 10.200.1.51..s=SIP Call..c=IN IP4 10.200.1.51..t=0 0..m=audio 20464 RTP/AVP 12

  5 0 18 100 101..c=IN IP4 10.200.1.51..a=rtpmap:125 X-CCD/8000..a=rtpmap:0 PCMU/8000..a=rtpmap:18 G7

  29/8000..a=fmtp:18 annexb=yes..a=rtpmap:100 X-NSE/8000..a=fmtp:100 192-194..a=rtpmap:101 telephone-

  event/8000..a=fmtp:101 0-16..a=nortpproxy:yes..

U x.x.129.200:5060 -> x.x.130.36:5060

  SIP/2.0 100 Trying..Via: SIP/2.0/UDP x.x.130.36;branch=z9hG4bKc2ce.17a955a3.0,SIP/2.0/UDP  216.4

  9.128.205:5060;rport=51694;branch=z9hG4bK1D3CD1..From: <sip:5024427578@x.x.128.205>;tag=24513088

  -D59..To: <sip:5033441174@x.x.130.36>;tag=F0695368-74F..Date: Tue, 03 Jul 2012 13:37:41 GMT..Cal

  l-ID: 1887588D-C44B11E1-BE38D697-98A3E39A@x.x.128.205..Timestamp: 1341322661..Server: Cisco-SIPG

  ateway/IOS-12.x..CSeq: 101 INVITE..Allow-Events: telephone-event..Content-Length: 0....

#

U x.x.129.200:5060 -> x.x.130.36:5060

  SIP/2.0 183 Session Progress..Via: SIP/2.0/UDP x.x.130.36;branch=z9hG4bKc2ce.17a955a3.0,SIP/2.0/

  UDP  x.x.128.205:5060;rport=51694;branch=z9hG4bK1D3CD1..From: <sip:5024427578@x.x.128.205>;ta

  g=24513088-D59..To: <sip:5033441174@x.x.130.36>;tag=F0695368-74F..Date: Tue, 03 Jul 2012 13:37:4

  1 GMT..Call-ID: 1887588D-C44B11E1-BE38D697-98A3E39A@x.x.128.205..Timestamp: 1341322661..Server:

  Cisco-SIPGateway/IOS-12.x..CSeq: 101 INVITE..Require: 100rel..RSeq: 6708..Allow: INVITE, OPTIONS, B

  YE, CANCEL, ACK, PRACK, COMET, REFER, SUBSCRIBE, NOTIFY, INFO, UPDATE, REGISTER..Allow-Events: tele

  phone-event..Contact: <sip:15033441174@x.x.129.200:5060>..Record-Route: <sip:x.x.130.36;lr=on

  >..Content-Disposition: session;handling=required..Content-Type: application/sdp..Content-Length: 2

  90....v=0..o=CiscoSystemsSIP-GW-UserAgent 2387 2116 IN IP4 x.x.129.200..s=SIP Call..c=IN IP4 216

  .49.129.200..t=0 0..m=audio 18480 RTP/AVP 0 101 100..c=IN IP4 x.x.129.200..a=rtpmap:0 PCMU/8000.

  .a=rtpmap:101 telephone-event/8000..a=fmtp:101 0-16..a=rtpmap:100 X-NSE/8000..a=fmtp:100 192-194..

#

U x.x.130.36:5060 -> x.x.128.205:51694

  SIP/2.0 183 Session Progress..Via: SIP/2.0/UDP  x.x.128.205:5060;rport=51694;branch=z9hG4bK1D3CD

  1..From: <sip:5024427578@x.x.128.205>;tag=24513088-D59..To: <sip:5033441174@x.x.130.36>;tag=F

  0695368-74F..Date: Tue, 03 Jul 2012 13:37:41 GMT..Call-ID: 1887588D-C44B11E1-BE38D697-98A3E39A@216.

  49.128.205..Timestamp: 1341322661..Server: Cisco-SIPGateway/IOS-12.x..CSeq: 101 INVITE..Require: 10

  0rel..RSeq: 6708..Allow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, COMET, REFER, SUBSCRIBE, NOTIFY,

   INFO, UPDATE, REGISTER..Allow-Events: telephone-event..Contact: <sip:15033441174@x.x.129.200:50

  60>..Record-Route: <sip:x.x.130.36;lr=on>..Content-Disposition: session;handling=required..Conte

  nt-Type: application/sdp..Content-Length: 305....v=0..o=CiscoSystemsSIP-GW-UserAgent 2387 2116 IN I

  P4 x.x.130.66..s=SIP Call..c=IN IP4 x.x.130.66..t=0 0..m=audio 19480 RTP/AVP 0 101 100..c=IN

  IP4 x.x.130.66..a=rtpmap:0 PCMU/8000..a=rtpmap:101 telephone-event/8000..a=fmtp:101 0-16..a=rtpm

  ap:100 X-NSE/8000..a=fmtp:100 192-194..a=nortpproxy:yes..

#

U x.x.128.205:51694 -> x.x.130.36:5060

  PRACK sip:15033441174@x.x.129.200:5060 SIP/2.0..Via: SIP/2.0/UDP  x.x.128.205:5060;branch=z9h

  G4bK1D4474..From: <sip:5024427578@x.x.128.205>;tag=24513088-D59..To: <sip:5033441174@x.x.130.

  36>;tag=F0695368-74F..Date: Tue, 03 Jul 2012 13:37:41 GMT..Call-ID: 1887588D-C44B11E1-BE38D697-98A3

  E39A@x.x.128.205..CSeq: 102 PRACK..RAck: 6708 101 INVITE..Route: <sip:x.x.130.36;lr=on>..Max-

  Forwards: 70..Content-Length: 0....

#

U x.x.130.34:5060 -> x.x.129.200:5060

  PRACK sip:15033441174@x.x.129.200:5060 SIP/2.0..Via: SIP/2.0/UDP x.x.130.34;branch=z9hG4bK92c

  e.4def8436.0..Via: SIP/2.0/UDP  x.x.128.205:5060;rport=51694;branch=z9hG4bK1D4474..From: <sip:50

  24427578@x.x.128.205>;tag=24513088-D59..To: <sip:5033441174@x.x.130.36>;tag=F0695368-74F..Dat

  e: Tue, 03 Jul 2012 13:37:41 GMT..Call-ID: 1887588D-C44B11E1-BE38D697-98A3E39A@x.x.128.205..CSeq

  : 102 PRACK..RAck: 6708 101 INVITE..Max-Forwards: 69..Content-Length: 0....

#

U x.x.129.200:5060 -> x.x.130.34:5060

  SIP/2.0 200 OK..Via: SIP/2.0/UDP x.x.130.34;branch=z9hG4bK92ce.4def8436.0,SIP/2.0/UDP  x.x.12

  8.205:5060;rport=51694;branch=z9hG4bK1D4474..From: <sip:5024427578@x.x.128.205>;tag=24513088-D59

  ..To: <sip:5033441174@x.x.130.36>;tag=F0695368-74F..Date: Tue, 03 Jul 2012 13:37:41 GMT..Call-ID

  : 1887588D-C44B11E1-BE38D697-98A3E39A@x.x.128.205..Server: Cisco-SIPGateway/IOS-12.x..CSeq: 102

  PRACK..Content-Length: 0....

#

U x.x.130.36:5060 -> x.x.128.205:51694

  SIP/2.0 200 OK..Via: SIP/2.0/UDP  x.x.128.205:5060;rport=51694;branch=z9hG4bK1D4474..From: <sip:

  5024427578@x.x.128.205>;tag=24513088-D59..To: <sip:5033441174@x.x.130.36>;tag=F0695368-74F..D

  ate: Tue, 03 Jul 2012 13:37:41 GMT..Call-ID: 1887588D-C44B11E1-BE38D697-98A3E39A@x.x.128.205..Se

  rver: Cisco-SIPGateway/IOS-12.x..CSeq: 102 PRACK..Content-Length: 0....

 

U x.x.129.200:5060 -> x.x.130.36:5060

  SIP/2.0 200 OK..Via: SIP/2.0/UDP x.x.130.36;branch=z9hG4bKc2ce.17a955a3.0,SIP/2.0/UDP  x.x.12

  8.205:5060;rport=51694;branch=z9hG4bK1D3CD1..From: <sip:5024427578@x.x.128.205>;tag=24513088-D59

  ..To: <sip:5033441174@x.x.130.36>;tag=F0695368-74F..Date: Tue, 03 Jul 2012 13:37:41 GMT..Call-ID

  : 1887588D-C44B11E1-BE38D697-98A3E39A@x.x.128.205..Timestamp: 1341322661..Server: Cisco-SIPGatew

  ay/IOS-12.x..CSeq: 101 INVITE..Allow: INVITE, OPTIONS, BYE, CANCEL, ACK, PRACK, COMET, REFER, SUBSC

  RIBE, NOTIFY, INFO, UPDATE, REGISTER..Allow-Events: telephone-event..Contact: <sip:15033441174@216.

  49.129.200:5060>..Record-Route: <sip:x.x.130.36;lr=on>..Content-Type: application/sdp..Content-L

  ength: 290....v=0..o=CiscoSystemsSIP-GW-UserAgent 2387 2116 IN IP4 x.x.129.200..s=SIP Call..c=IN

   IP4 x.x.129.200..t=0 0..m=audio 18480 RTP/AVP 0 101 100..c=IN IP4 x.x.129.200..a=rtpmap:0 PC

  MU/8000..a=rtpmap:101 telephone-event/8000..a=fmtp:101 0-16..a=rtpmap:100 X-NSE/8000..a=fmtp:100 19

  2-194..

#

U x.x.130.36:5060 -> x.x.128.205:51694

  SIP/2.0 200 OK..Via: SIP/2.0/UDP  x.x.128.205:5060;rport=51694;branch=z9hG4bK1D3CD1..From: <sip:

  5024427578@x.x.128.205>;tag=24513088-D59..To: <sip:5033441174@x.x.130.36>;tag=F0695368-74F..D

  ate: Tue, 03 Jul 2012 13:37:41 GMT..Call-ID: 1887588D-C44B11E1-BE38D697-98A3E39A@x.x.128.205..Ti

  mestamp: 1341322661..Server: Cisco-SIPGateway/IOS-12.x..CSeq: 101 INVITE..Allow: INVITE, OPTIONS, B

  YE, CANCEL, ACK, PRACK, COMET, REFER, SUBSCRIBE, NOTIFY, INFO, UPDATE, REGISTER..Allow-Events: tele

  phone-event..Contact: <sip:15033441174@x.x.129.200:5060>..Record-Route: <sip:x.x.130.36;lr=on

  >..Content-Type: application/sdp..Content-Length: 305....v=0..o=CiscoSystemsSIP-GW-UserAgent 2387 2

  116 IN IP4 x.x.130.66..s=SIP Call..c=IN IP4 x.x.130.66..t=0 0..m=audio 19480 RTP/AVP 0 101 10

  0..c=IN IP4 x.x.130.66..a=rtpmap:0 PCMU/8000..a=rtpmap:101 telephone-event/8000..a=fmtp:101 0-16

  ..a=rtpmap:100 X-NSE/8000..a=fmtp:100 192-194..a=nortpproxy:yes..

#

U x.x.128.205:51694 -> x.x.130.36:5060

  ACK sip:15033441174@x.x.129.200:5060 SIP/2.0..Via: SIP/2.0/UDP  x.x.128.205:5060;branch=z9hG4

  bK1D5DA6..From: <sip:5024427578@x.x.128.205>;tag=24513088-D59..To: <sip:5033441174@x.x.130.36

  >;tag=F0695368-74F..Date: Tue, 03 Jul 2012 13:37:41 GMT..Call-ID: 1887588D-C44B11E1-BE38D697-98A3E3

  9A@x.x.128.205..Route: <sip:x.x.130.36;lr=on>..Max-Forwards: 70..CSeq: 101 ACK..Content-Lengt

  h: 0....

#

U x.x.130.34:5060 -> x.x.129.200:5060

  ACK sip:15033441174@x.x.129.200:5060 SIP/2.0..Via: SIP/2.0/UDP x.x.130.34;branch=z9hG4bKcydzi

  gwkX..Via: SIP/2.0/UDP  x.x.128.205:5060;rport=51694;branch=z9hG4bK1D5DA6..From: <sip:5024427578

  @x.x.128.205>;tag=24513088-D59..To: <sip:5033441174@x.x.130.36>;tag=F0695368-74F..Date: Tue,

  03 Jul 2012 13:37:41 GMT..Call-ID: 1887588D-C44B11E1-BE38D697-98A3E39A@x.x.128.205..Max-Forwards

  : 69..CSeq: 101 ACK..Content-Length: 0....

#

U x.x.128.205:51694 -> x.x.130.36:5060

  BYE sip:15033441174@x.x.129.200:5060 SIP/2.0..Via: SIP/2.0/UDP  x.x.128.205:5060;branch=z9hG4

  bK1D61CE7..From: <sip:5024427578@x.x.128.205>;tag=24513088-D59..To: <sip:5033441174@x.x.130.3

  6>;tag=F0695368-74F..Date: Tue, 03 Jul 2012 13:37:41 GMT..Call-ID: 1887588D-C44B11E1-BE38D697-98A3E

  39A@x.x.128.205..User-Agent: Cisco-SIPGateway/IOS-12.x..Max-Forwards: 70..Route: <sip:x.x.130

  .36;lr=on>..Timestamp: 1341322666..CSeq: 103 BYE..Reason: Q.850;cause=16..Content-Length: 0....

#

U x.x.130.34:5060 -> x.x.129.200:5060

  BYE sip:15033441174@x.x.129.200:5060 SIP/2.0..Via: SIP/2.0/UDP x.x.130.34;branch=z9hG4bKa2ce.

  4ba2ee65.0..Via: SIP/2.0/UDP  x.x.128.205:5060;rport=51694;branch=z9hG4bK1D61CE7..From: <sip:502

  4427578@x.x.128.205>;tag=24513088-D59..To: <sip:5033441174@x.x.130.36>;tag=F0695368-74F..Date

  : Tue, 03 Jul 2012 13:37:41 GMT..Call-ID: 1887588D-C44B11E1-BE38D697-98A3E39A@x.x.128.205..User-

  Agent: Cisco-SIPGateway/IOS-12.x..Max-Forwards: 69..Timestamp: 1341322666..CSeq: 103 BYE..Reason: Q

  .850;cause=16..Content-Length: 0....

#

U x.x.129.200:5060 -> x.x.130.34:5060

  SIP/2.0 200 OK..Via: SIP/2.0/UDP x.x.130.34;branch=z9hG4bKa2ce.4ba2ee65.0,SIP/2.0/UDP  x.x.12

  8.205:5060;rport=51694;branch=z9hG4bK1D61CE7..From: <sip:5024427578@x.x.128.205>;tag=24513088-D5

  9..To: <sip:5033441174@x.x.130.36>;tag=F0695368-74F..Date: Tue, 03 Jul 2012 13:37:46 GMT..Call-I

  D: 1887588D-C44B11E1-BE38D697-98A3E39A@x.x.128.205..Server: Cisco-SIPGateway/IOS-12.x..Timestamp

  : 1341322666..Content-Length: 0..CSeq: 103 BYE....

#

U x.x.130.36:5060 -> x.x.128.205:51694

  SIP/2.0 200 OK..Via: SIP/2.0/UDP  x.x.128.205:5060;rport=51694;branch=z9hG4bK1D61CE7..From: <sip

  :5024427578@x.x.128.205>;tag=24513088-D59..To: <sip:5033441174@x.x.130.36>;tag=F0695368-74F..

  Date: Tue, 03 Jul 2012 13:37:46 GMT..Call-ID: 1887588D-C44B11E1-BE38D697-98A3E39A@x.x.128.205..S

  erver: Cisco-SIPGateway/IOS-12.x..Timestamp: 1341322666..Content-Length: 0..CSeq: 103 BYE....