Skip to content

Commit

Permalink
[siptrace]fix proto issues
Browse files Browse the repository at this point in the history
leave IPPROTO_* format in hep header(which is returned by
pipport2su() function) and after setting it use OpenSIPS
format for sending(PROTO_UDP)
  • Loading branch information
ionutrazvanionita committed Jan 15, 2016
1 parent ad32566 commit 5a28baf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions modules/siptrace/siptrace.c
Expand Up @@ -1824,8 +1824,7 @@ static int trace_send_hep_duplicate(str *body, str *fromproto, str *fromip,


/* create a temporary proxy*/
proto = PROTO_UDP;
p=mk_proxy(&dup_uri->host, (dup_uri->port_no)?dup_uri->port_no:SIP_PORT,proto, 0);
p=mk_proxy(&dup_uri->host, (dup_uri->port_no)?dup_uri->port_no:SIP_PORT, PROTO_UDP, 0);
if (p==0){
LM_ERR("bad host name in uri\n");
return -1;
Expand All @@ -1842,7 +1841,12 @@ static int trace_send_hep_duplicate(str *body, str *fromproto, str *fromip,
/* Version && proto && length */
hdr.hp_l = sizeof(struct hep_hdr);
hdr.hp_v = hep_version;

/* set proto to PROTO_UDP after we set the proto in HEP header;
* in hep header we need standard library format IPPROTO_* which is set by
* pipport2su() function */
hdr.hp_p = proto;
proto = PROTO_UDP;

/* AND the last */
if (from_su.s.sa_family==AF_INET){
Expand Down

0 comments on commit 5a28baf

Please sign in to comment.