Skip to content

Commit

Permalink
[sipmsgops] avoid domain validation on none SIP URIs
Browse files Browse the repository at this point in the history
Like TEL URIs do not have domain part at all
  • Loading branch information
bogdan-iancu committed Jan 23, 2025
1 parent 021172b commit c436ec8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions modules/sipmsgops/sipmsgops.c
Original file line number Diff line number Diff line change
Expand Up @@ -1715,8 +1715,9 @@ static int w_sip_validate(struct sip_msg *msg, void *_flags, pv_spec_t* err_txt)
goto failed;
}

/* check for valid domain format */
if(check_hostname(&p_uri->host) < 0) {
/* check for valid domain format, if SIP/SIPS types */
if ( (p_uri->type==SIP_URI_T || p_uri->type==SIPS_URI_T) &&
check_hostname(&p_uri->host) < 0 ) {
strcpy(reason, "invalid domain for 'To' header");
ret = SV_TO_DOMAIN_ERROR;
goto failed;
Expand All @@ -1738,8 +1739,9 @@ static int w_sip_validate(struct sip_msg *msg, void *_flags, pv_spec_t* err_txt)
goto failed;
}

/* check for valid domain format */
if(check_hostname(&p_uri->host) < 0) {
/* check for valid domain format, if SIP/SIPS types */
if ( (p_uri->type==SIP_URI_T || p_uri->type==SIPS_URI_T) &&
check_hostname(&p_uri->host) < 0 ) {
strcpy(reason, "invalid domain for 'From' header");
ret = SV_FROM_DOMAIN_ERROR;
goto failed;
Expand Down

0 comments on commit c436ec8

Please sign in to comment.