[SR-Users] remove_hf function in INVITE message

Mojtaba mespio at gmail.com
Sun Aug 19 11:45:35 CEST 2018


Today i encounter with strange issue in SIP signalling in Kamailio,
In INVITE message, I just change Contact Header and relay message to
destination, But the message is like this:
192.168.122.245.4080 > 192.168.122.174.5060: [bad udp cksum 0x7b5e ->
0x3a4d!] SIP, length: 1104
    INVITE sip:8000 at r-kh.com;transport=UDP SIP/2.0
    Record-Route: <sip:192.168.122.245:4080;lr;ftag=8e47e95e;nat=yes>
    Via: SIP/2.0/UDP
192.168.122.245:4080;branch=z9hG4bK14d7.dc974309aba269b24213204d3ea085e2.0
    Via: SIP/2.0/UDP
192.168.122.1:36853;rport=36853;branch=z9hG4bK-d8754z-423b431a3ebc8a22-1---d8754z-
    Max-Forwards: 69
    sip:7000 at 192.168.122.1:36853;transport=UDP;alias=192.168.122.1~36853~1To:
<sip:8000 at r-kh.com;transport=UDP>
    From: <sip:7000 at r-kh.com;transport=UDP>;tag=8e47e95e
    Call-ID: YTZmYTJmYzg0ZDNiMjM2OGUxZGYwNzg4OWY1ZmIxYzc.
    CSeq: 1 INVITE
    Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS,
INFO, SUBSCRIBE
    Content-Type: application/sdp
    Supported: replaces, norefersub, extended-refer, timer, X-cisco-serviceuri
    User-Agent: Z 3.3.25608 r25552
    Allow-Events: presence, kpml
    Content-Length: 241
     <SDP Body>
The code in Kamailio is:

#!ifdef WITH_SBC_NASIM
        #if the Invite request is MO, forward it to Asterisk .
        if (is_method("INVITE") && $si!="192.168.122.245") {
                xlog("L_INFO", "The Invite message from $si:$sp,
Forwart to Asterisk.  <192.168.122.174:5060>.\n");
                remove_hf("Contact");
                append_hf("Contact:sip:$fU at sbc.r-kh.com\r\n");
                $du = "sip:192.168.122.174:5060";
        }
#!endif

Be notice that, i have the same procedure in REGISTER message, But it
is work correct,
        if(is_method("REGISTER")) {
                xlog("L_INFO", "forward register to Asterisk\n");
                remove_hf("Contact");
                append_hf("Contact:sip:$fU at sbc.r-kh.com\r\n");
                rewriteuri("sip:r-kh.com");
                $du = "sip:192.168.122.174:5060";
                route(RELAY);
        }

Let me know what is the problem?

-- 
--Mojtaba Esfandiari.S



More information about the sr-users mailing list