I tried without the loose route in the main block but I can't make any calls.
I also attached the ngrep output.
Via: SIP/2.0/TCP 10.65.47.53:51977;branch=z9hG4bK.ZFrwHAOUd;rport
CSeq: 20 INVITE
Call-ID: -pF7mvvFRp
Max-Forwards: 70
Supported: outbound
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO, UPDATE
Content-Type: application/sdp
Content-Length: 454
Contact: <sip:1000@105.35.19.185:51977;transport=tcp>;+sip.instance="<urn:uuid:07d94e90-bda1-4dc6-951c-84a1464c2ec8>"
User-Agent: LinphoneIPhone/2.2.3 (belle-sip/1.3.3)
v=0
o=1000 622 2563 IN IP4 10.65.47.53
s=Talk
c=IN IP4 10.65.47.53
b=AS:380
t=0 0
a=rtcp-xr:rcvr-rtt=all:10000 stat-summary=loss,dup,jitt,TTL voip-metrics
m=audio 7076 RTP/AVP 124 120 111 110 0 8 101
a=rtpmap:124 opus/48000/2
a=fmtp:124 useinbandfec=1; stereo=0; sprop-stereo=0
a=rtpmap:120 SILK/16000
a=rtpmap:111 speex/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-15
xЛuTЁLKK+E;#п@@gЄВ>~i#ЙФЫ RqЈ
рЏW
~№-йhSIP/2.0 100 trying -- your call is important to us
Via: SIP/2.0/TCP 10.65.47.53:51977;branch=z9hG4bK.ZFrwHAOUd;rport=51977;received=105.35.19.185
CSeq: 20 INVITE
Call-ID: -pF7mvvFRp
Server: kamailio (4.0.4 (x86_64/linux))
Content-Length: 0
xЛuT^Mњњ+Eъщ@@
й-
й0мяФш&ЄЃяеЬ@
Record-Route: <sip:178.62.126.15;transport=tcp;lr=on;ftag=A0DduhJxi>
Via: SIP/2.0/TCP 10.131.217.45;branch=z9hG4bK4f91.7ba7e9a7.0;i=7
Via: SIP/2.0/TCP 10.65.47.53:51977;received=105.35.19.185;branch=z9hG4bK.ZFrwHAOUd;rport=51977
CSeq: 20 INVITE
Call-ID: -pF7mvvFRp
Max-Forwards: 16
Supported: outbound
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO, UPDATE
Content-Type: application/sdp
Content-Length: 454
Contact: <sip:1000@105.35.19.185:51977;transport=tcp>;+sip.instance="<urn:uuid:07d94e90-bda1-4dc6-951c-84a1464c2ec8>"
User-Agent: LinphoneIPhone/2.2.3 (belle-sip/1.3.3)
v=0
o=1000 622 2563 IN IP4 10.65.47.53
s=Talk
c=IN IP4 10.65.47.53
b=AS:380
t=0 0
a=rtcp-xr:rcvr-rtt=all:10000 stat-summary=loss,dup,jitt,TTL voip-metrics
m=audio 7076 RTP/AVP 124 120 111 110 0 8 101
a=rtpmap:124 opus/48000/2
a=fmtp:124 useinbandfec=1; stereo=0; sprop-stereo=0
a=rtpmap:120 SILK/16000
a=rtpmap:111 speex/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-15
xЛuTGTдд1s!EФ
8@@d
й0
й-ФмяЃяеш&Јг№Џ
Щ~№SIP/2.0 100 trying -- your call is important to us
Via: SIP/2.0/TCP 10.131.217.45;branch=z9hG4bK4f91.7ba7e9a7.0;i=7;rport=56559
Via: SIP/2.0/TCP 10.65.47.53:51977;received=105.35.19.185;branch=z9hG4bK.ZFrwHAOUd;rport=51977
CSeq: 20 INVITE
Call-ID: -pF7mvvFRp
Server: kamailio (4.0.4 (x86_64/linux))
Content-Length: 0
xЛuTйUьь1s!Eмт@@рХ
й0
й-jФЛcpT!Дѕж
Щr.INVITE sip:2000@105.40.65.70:44789;transport=tcp SIP/2.0
Record-Route: <sip:10.131.217.48;transport=tcp;lr=on;nat=yes>
Record-Route: <sip:178.62.126.15;transport=tcp;lr=on;ftag=A0DduhJxi>
Via: SIP/2.0/TCP 10.131.217.48;branch=z9hG4bK4f91.097a02e.0;i=8
Route: <sip:10.131.217.45;transport=tcp;lr;received='sip:105.40.65.70:44789;transport=tcp'>
Via: SIP/2.0/TCP 10.131.217.45;rport=56559;branch=z9hG4bK4f91.7ba7e9a7.0;i=7
Via: SIP/2.0/TCP 10.65.47.53:51977;received=105.35.19.185;branch=z9hG4bK.ZFrwHAOUd;rport=51977
CSeq: 20 INVITE
Call-ID: -pF7mvvFRp
Max-Forwards: 15
Supported: outbound
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO, UPDATE
Content-Type: application/sdp
Content-Length: 477
Contact: <sip:1000@105.35.19.185:51977;alias=10.131.217.45~56559~2;transport=tcp>;+sip.instance="<urn:uuid:07d94e90-bda1-4dc6-951c-84a1464c2ec8>"
User-Agent: LinphoneIPhone/2.2.3 (belle-sip/1.3.3)
On Wednesday, November 26, 2014, Muhammad Shahzad <
shaheryarkh@gmail.com> wrote:
something like this,
---
if (loose_route()) {
if(!isdsturiset()) {
handle_ruri_alias();
};
if (is_method("BYE")) {
...
Thank you.