Krishna,
take the last siptrace.c from ser's git and add after line 1703 this code:
if(len > 0) tmp_piport[len - 1] = '\0';
so, code must looks so:
/* our tmp string */
1703
<http://git.sip-router.org/cgi-bin/gitweb.cgi?p=sip-router;a=blob;f=modules_k/siptrace/siptrace.c;h=b54d893dcda013006ee8069c6e3f313c427fa76e;hb=HEAD#l1703>
strncpy(tmp_piport, pipport, len);
1704
<http://git.sip-router.org/cgi-bin/gitweb.cgi?p=sip-router;a=blob;f=modules_k/siptrace/siptrace.c;h=b54d893dcda013006ee8069c6e3f313c427fa76e;hb=HEAD#l1704>
if(len > 0) tmp_piport[len-1] = '\0';
1705
<http://git.sip-router.org/cgi-bin/gitweb.cgi?p=sip-router;a=blob;f=modules_k/siptrace/siptrace.c;h=b54d893dcda013006ee8069c6e3f313c427fa76e;hb=HEAD#l1705>
len = 0;
and let me know if it works for you.
Wbr,
Alexandr
3/29/2012 10:35 PM, Krishna Kurapati wrote:
Daniel,
I finally had some time to put a log after it failed to convert from
to socket.
ERROR: siptrace [siptrace.c:1704]: there is not a valid number port
5060??k5
Mar 29 13:30:32 siptest /usr/sbin/kamailio[19848]: ERROR: siptrace
[siptrace.c:1514]: ERROR: bad FROM tcp:10.1.0.6:5060
<http://10.1.0.6:5060> or TO tcp:75.62.17.45:63343
<http://75.62.17.45:63343>
The passing parameter to the function look fine. Well formed and null
terminated. Inside it is failing.
Any ideas....
Attaching the code segments around the lines
Code around line 1514:
/* Convert proto:ip:port to sockaddress union SRC IP */
if (pipport2su(from->s, &from_su, &proto)==-1 ||
(pipport2su(to->s, &to_su, &proto)==-1))
{
LOG(L_ERR, "ERROR: bad FROM %s or TO %s\n", from->s,
to->s);
goto error;
}
Code around line 1704:
else {
/*the address contains a port number*/
*p = '\0';
p++;
port_str.s = p;
port_str.len = strlen(p);
LM_DBG("the port string is %s\n", p);
if(str2int(&port_str, &port_no) != 0 ) {
LM_ERR("there is not a valid number port
%s\n", p);
goto error;
}
*p = '\0';
}
On Wed, Mar 28, 2012 at 2:16 PM, Daniel-Constantin Mierla
<miconda(a)gmail.com <mailto:miconda@gmail.com>> wrote:
have you changed the log line to print the port? can you print the
entire string, with proto and ip to see if there are
spaces/invalid characters (print it between special chars, like [])?
The line is inside the mirroring traffic via hep protocol, is what
you want to get, right?
Cheers,
Daniel
On 3/28/12 12:53 PM, Krishna Kurapati wrote:
I tried to pull null terminator to see if
that fixes the issue.
That is why there is shift in the lines. It is same as line 1701.
Krish Kura
On Wed, Mar 28, 2012 at 3:57 AM, Daniel-Constantin Mierla
<miconda(a)gmail.com <mailto:miconda@gmail.com>> wrote:
Hello,
are you working with a custom siptrace module? the line in
siptrace.c does not match. If you changed the sources, paste
here the lines in siptrace.c around 1705, 10 before and 10 after.
Cheers,
Daniel
On 3/26/12 3:23 PM, Krishna Kurapati wrote:
Hi,
I keep getting this error in the sip_trace module:
Mar 26 06:19:26 siptest /usr/sbin/kamailio[4279]: ERROR:
siptrace [siptrace.c:1705]: there is not a valid number port
5060?/??
Krish Kura
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users(a)lists.sip-router.org <mailto:sr-users@lists.sip-router.org>
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla
Kamailio Advanced Training, April 23-26, 2012, Berlin, Germany
http://www.asipto.com/index.php/kamailio-advanced-training/
--
Daniel-Constantin Mierla
Kamailio Advanced Training, April 23-26, 2012, Berlin, Germany
http://www.asipto.com/index.php/kamailio-advanced-training/
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users