Skip to content

Commit

Permalink
Proper WS support in tracing and capturing (Homer)
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdan-iancu committed Mar 12, 2015
1 parent 73f5a23 commit f612548
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion modules/sipcapture/sipcapture.c
Expand Up @@ -709,8 +709,11 @@ int hep_msg_received(int sockfd, struct receive_info *ri, str *msg, void* param)
/* PROTO */
if(heph->hp_p == IPPROTO_UDP) ri->proto=PROTO_UDP;
else if(heph->hp_p == IPPROTO_TCP) ri->proto=PROTO_TCP;
else if(heph->hp_p == IPPROTO_IDP) ri->proto=PROTO_TLS; /* fake protocol */
else if(heph->hp_p == IPPROTO_IDP) ri->proto=PROTO_TLS;
/* fake protocol */
else if(heph->hp_p == IPPROTO_SCTP) ri->proto=PROTO_SCTP;
else if(heph->hp_p == IPPROTO_ESP) ri->proto=PROTO_WS;
/* fake protocol */
else {
LM_ERR("unknow protocol [%d]\n",heph->hp_p);
ri->proto = PROTO_NONE;
Expand Down
6 changes: 4 additions & 2 deletions modules/siptrace/siptrace.c
Expand Up @@ -1961,10 +1961,12 @@ static int pipport2su (str *sproto, str *ip, unsigned short port,
/*parse protocol */
if(strncmp(sproto->s, "udp",3) == 0) *proto = IPPROTO_UDP;
else if(strncmp(sproto->s, "tcp",3) == 0) *proto = IPPROTO_TCP;
else if(strncmp(sproto->s, "tls",3) == 0) *proto = IPPROTO_IDP; /* fake proto type */
else if(strncmp(sproto->s, "tls",3) == 0) *proto = IPPROTO_IDP;
/* fake proto type */
else if(strncmp(sproto->s, "sctp",4) == 0) *proto = IPPROTO_SCTP;
else if(strncmp(sproto->s, "any",3) == 0) *proto = IPPROTO_UDP;
else if(strncmp(sproto->s, "ws",2) == 0) *proto = IPPROTO_IDP; /* fake proto type */
else if(strncmp(sproto->s, "ws",2) == 0) *proto = IPPROTO_ESP;
/* fake proto type */
else {
LM_ERR("bad protocol %.*s\n", sproto->len, sproto->s);
return -1;
Expand Down

1 comment on commit f612548

@satishdotpatel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even after above patch, i am still seeing following error in my logs, Everything works but why it is adding following logs in logs file. I have homer running on kamailio. do you think that would be the issue?

ERROR:siptrace:pipport2su: bad protocol
ERROR:siptrace:pipport2su: bad protocol
ERROR:siptrace:pipport2su: bad protocol

Please sign in to comment.