I am getting started with Kamailio (or restarted, used it briefly years ago), with the final objective to do load balancing.
My idea is that asterisk runs on port 5080, while kamailio on port 5060. Client interacts with Kamailio on port 5060.
It almost works... Registration is fine, but when I send an invite, it is properly acknowledged (by asterisk 100 trying then 200 OK) - but the OK message gets repeated multiple times and asterisk issues its infamous 'Retransmission timeout reached ...' - as if Kamailio wasnt processing it. See below ngrep traces between asterisk and kamailio
J.
#
INVITE sip:102@192.168.2.228 SIP/2.0..Record-Route: <sip:192.168.2.228;lr=on;ftag=1034946464>..Via: SIP/2.0/UDP 192.168.2.228;branch=z9hG4bK9e22.bff83e1026a667df63b9922 4198ef593.0..Via: SIP/2.0/UDP 192.168.2.200:5085;received=192.168.2.200;rport=5085;branch=z9hG4bK1247964647..From: <sip:199@192.168.2.228>;tag=1034946464..To: <sip:102@ 192.168.2.228>..Call-ID: 1571382735..CSeq: 21 INVITE..Contact: <sip:iper@(null)>..Content-Type: application/sdp..Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY
, MESSAGE, SUBSCRIBE, INFO..Max-Forwards: 69..User-Agent: Linphone/3.6.1 (eXosip2/4.1.0)..Subject: Phone call..Content-Length: 437....v=0..o=199 2799 2990 IN IP4 192.
168.2.200..s=Talk..c=IN IP4 192.168.2.200..t=0 0..m=audio 7078 RTP/AVP 124 111 110 0 8 101..a=rtpmap:124 opus/48000..a=fmtp:124 useinbandfec=1; usedtx=1..a=rtpmap:111 s
peex/16000..a=fmtp:111 vbr=on..a=rtpmap:110 speex/8000..a=fmtp:110 vbr=on..a=rtpmap:101 telephone-event/8000..a=fmtp:101 0-11..m=video 9078 RTP/AVP 103 99..a=rtpmap:103
VP8/90000..a=rtpmap:99 MP4V-ES/90000..a=fmtp:99 profile-level-id=3..
#
..User-Agent: Asterisk PBX 11.3.0..Date: Tue, 16 May 2017 21:08:29 GMT..Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH..Supported: re
places, timer..Content-Length: 0....
#
..User-Agent: Asterisk PBX 11.3.0..Date: Tue, 16 May 2017 21:08:29 GMT..Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH..Supported: re
places, timer..Content-Length: 0....
#
SIP/2.0 100 Trying..Via: SIP/2.0/UDP 192.168.2.228;branch=z9hG4bK9e22.bff83e1026a667df63b99224198ef593.0;received=192.168.2.228..Via: SIP/2.0/UDP 192.168.2.200:5085;rec
eived=192.168.2.200;rport=5085;branch=z9hG4bK1247964647..Record-Route: <sip:192.168.2.228;lr=on;ftag=1034946464>..From: <sip:199@192.168.2.228>;tag=1034946464..To: <sip :102@192.168.2.228>..Call-ID: 1571382735..CSeq: 21 INVITE..Server: Asterisk PBX 11.3.0..Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLIS #
SIP/2.0 200 OK..Via: SIP/2.0/UDP 192.168.2.228;branch=z9hG4bK9e22.bff83e1026a667df63b99224198ef593.0;received=192.168.2.228..Via: SIP/2.0/UDP 192.168.2.200:5085;receive
d=192.168.2.200;rport=5085;branch=z9hG4bK1247964647..Record-Route: <sip:192.168.2.228;lr=on;ftag=1034946464>..From: <sip:199@192.168.2.228>;tag=1034946464..To: <sip:102 @192.168.2.228>;tag=as497f35c0..Call-ID: 1571382735..CSeq: 21 INVITE..Server: Asterisk PBX 11.3.0..Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, I NFO, PUBLISH..Supported: replaces, timer..Contact: <sip:102@192.168.2.228:5080>..Content-Type: application/sdp..Content-Length: 312....v=0..o=root 350189084 350189084 I N IP4 192.168.2.228..s=Asterisk PBX 11.3.0..c=IN IP4 192.168.2.228..t=0 0..m=audio 17148 RTP/AVP 0 8 101..a=rtpmap:0 PCMU/8000..a=rtpmap:8 PCMA/8000..a=rtpmap:101 telep
hone-event/8000..a=fmtp:101 0-16..a=silenceSupp:off - - - -..a=ptime:20..a=sendrecv..m=video 0 RTP/AVP 103 99..
#
0>;tag=524348182..Call-ID: 52fa034372ce18ca2b93fc1817ad38a5@192.168.2.228:5080..CSeq: 102 OPTIONS..Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, SUBSCRIBE, NOTIFY,
INFO..Accept: application/sdp..User-Agent: Linphone/3.6.1 (eXosip2/4.1.0)..Content-Length: 0....
#
0>;tag=939659485..Call-ID: 4331da391bca02965b2af65254717a18@192.168.2.228:5080..CSeq: 102 OPTIONS..Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, SUBSCRIBE, NOTIFY,
INFO..Accept: application/sdp..User-Agent: Linphone/3.6.1 (eXosip2/4.1.0)..Content-Length: 0....
#
SIP/2.0 200 OK..Via: SIP/2.0/UDP 192.168.2.228;branch=z9hG4bK9e22.bff83e1026a667df63b99224198ef593.0;received=192.168.2.228..Via: SIP/2.0/UDP 192.168.2.200:5085;receive
d=192.168.2.200;rport=5085;branch=z9hG4bK1247964647..Record-Route: <sip:192.168.2.228;lr=on;ftag=1034946464>..From: <sip:199@192.168.2.228>;tag=1034946464..To: <sip:102 @192.168.2.228>;tag=as497f35c0..Call-ID: 1571382735..CSeq: 21 INVITE..Server: Asterisk PBX 11.3.0..Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, I NFO, PUBLISH..Supported: replaces, timer..Contact: <sip:102@192.168.2.228:5080>..Content-Type: application/sdp..Content-Length: 312....v=0..o=root 350189084 350189084 I N IP4 192.168.2.228..s=Asterisk PBX 11.3.0..c=IN IP4 192.168.2.228..t=0 0..m=audio 17148 RTP/AVP 0 8 101..a=rtpmap:0 PCMU/8000..a=rtpmap:8 PCMA/8000..a=rtpmap:101 telep
hone-event/8000..a=fmtp:101 0-16..a=silenceSupp:off - - - -..a=ptime:20..a=sendrecv..m=video 0 RTP/AVP 103 99..
#
SIP/2.0 200 OK..Via: SIP/2.0/UDP 192.168.2.228;branch=z9hG4bK9e22.bff83e1026a667df63b99224198ef593.0;received=192.168.2.228..Via: SIP/2.0/UDP 192.168.2.200:5085;receive
d=192.168.2.200;rport=5085;branch=z9hG4bK1247964647..Record-Route: <sip:192.168.2.228;lr=on;ftag=1034946464>..From: <sip:199@192.168.2.228>;tag=1034946464..To: <sip:102 @192.168.2.228>;tag=as497f35c0..Call-ID: 1571382735..CSeq: 21 INVITE..Server: Asterisk PBX 11.3.0..Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, I NFO, PUBLISH..Supported: replaces, timer..Contact: <sip:102@192.168.2.228:5080>..Content-Type: application/sdp..Content-Length: 312....v=0..o=root 350189084 350189084 I N IP4 192.168.2.228..s=Asterisk PBX 11.3.0..c=IN IP4 192.168.2.228..t=0 0..m=audio 17148 RTP/AVP 0 8 101..a=rtpmap:0 PCMU/8000..a=rtpmap:8 PCMA/8000..a=rtpmap:101 telep
hone-event/8000..a=fmtp:101 0-16..a=silenceSupp:off - - - -..a=ptime:20..a=sendrecv..m=video 0 RTP/AVP 103 99..
#
SIP/2.0 200 OK..Via: SIP/2.0/UDP 192.168.2.228;branch=z9hG4bK9e22.bff83e1026a667df63b99224198ef593.0;received=192.168.2.228..Via: SIP/2.0/UDP 192.168.2.200:5085;receive
d=192.168.2.200;rport=5085;branch=z9hG4bK1247964647..Record-Route: <sip:192.168.2.228;lr=on;ftag=1034946464>..From: <sip:199@192.168.2.228>;tag=1034946464..To: <sip:102 @192.168.2.228>;tag=as497f35c0..Call-ID: 1571382735..CSeq: 21 INVITE..Server: Asterisk PBX 11.3.0..Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, I NFO, PUBLISH..Supported: replaces, timer..Contact: <sip:102@192.168.2.228:5080>..Content-Type: application/sdp..Content-Length: 312....v=0..o=root 350189084 350189084 I N IP4 192.168.2.228..s=Asterisk PBX 11.3.0..c=IN IP4 192.168.2.228..t=0 0..m=audio 17148 RTP/AVP 0 8 101..a=rtpmap:0 PCMU/8000..a=rtpmap:8 PCMA/8000..a=rtpmap:101 telep
hone-event/8000..a=fmtp:101 0-16..a=silenceSupp:off - - - -..a=ptime:20..a=sendrecv..m=video 0 RTP/AVP 103 99..
#