< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index Next in Thread >

Re: [repro-users] "-1" after port in CANCEL message

Just found out the problem part of the code which is causing this problem.  The following code in ViaHeader.java creates the unwanted "-1" in the CANCEL message, but I don't know how to fix it: 

/** Gets port of ViaHeader */
public int getPort() {
SipParser par = new SipParser(getSentBy());
if (par.hasMore())
return par.skipChar().getInt();
return -1;


On 30 September 2015 at 00:56, Nabeel <nabeelshikder@xxxxxxxxx> wrote:
I tested this in the latest version of Lumicall.  The problem seems to be caused by a strange ":-1" attached to end of the via address in the CANCEL message. 

Server log:

ERROR:core:parse_via:  <SIP/2.0/TLS []:-1;rport;branch=z9hG4bK25799^M
Max-Forwards: 70^M
To: <sip:test@xxxxxxxxxx;transport=tls>^M
From: <sip:test2@domain.com>;tag=z9hG4bK01018015^M
Call-ID: 903926898065@^M
Contact: <sip:test2@;transport=tls>^M
Expires: 3600^M
User-Agent: Lumicall/1.11.16/MP-S168^M
Content-Length: 0^M
Sep 30 00:43:51 server1 /usr/local/sbin/opensips[3285]: ERROR:core:parse_via: parsed so far:<SIP/2.0/TLS [10>
Sep 30 00:43:51 server1 /usr/local/sbin/opensips[3285]: ERROR:core:get_hdr_field: bad via
Sep 30 00:43:51 server1 /usr/local/sbin/opensips[3285]: INFO:core:parse_headers: bad header field
Sep 30 00:43:51 server1 /usr/local/sbin/opensips[3285]: ERROR:core:parse_msg: message=<CANCEL sip:test@xxxxxxxxxx;transport=tls SIP/2.0^M

ADB logcat: 

09-30 00:50:33.472  21767-21767/org.lumicall.android I/IntegratedSipProvider﹕ Sending message:
    CANCEL sip:test@xxxxxxxxxx;transport=tls SIP/2.0
    Via: SIP/2.0/TLS []:-1;rport;branch=z9hG4bK36227
    Max-Forwards: 70
    To: <sip:test@xxxxxxxxxx;transport=tls>
    From: <sip:test2@xxxxxxxxxx>;tag=z9hG4bK82667884
    Call-ID: 112920549595@
    CSeq: 2 CANCEL
    Contact: <sip:test2@;transport=tls>
    Expires: 3600
    User-Agent: Lumicall/1.11.16/MP-S168
    Content-Length: 0