diff --git a/ChangeLog b/ChangeLog index f85e618..9f7a698 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 0.8.3dev ======== + 17-Jan-2018: - Deal with OPTION requests that have Max-Forwards=0 + (RFC3261, "11.2 Processing of OPTIONS Request" and + "16.3 Request Validation, step 3") 30-Sep-2017: - plugin_fix_fbox_anoncall: better handling of multiple registered numbers on same device 27-Sep-2017: - resized URLMAP_SIZE=512, RTPPROXY_SIZE=1024 diff --git a/src/sip_utils.c b/src/sip_utils.c index fe660a9..0351b9f 100644 --- a/src/sip_utils.c +++ b/src/sip_utils.c @@ -430,7 +430,7 @@ int is_sipuri_local (sip_ticket_t *ticket) { /* need name resolution */ sts=get_ip_by_host(sip->req_uri->host, &addr_uri); if (sts == STS_FAILURE) { - DEBUGC(DBCLASS_PROXY, "sip_gen_response: cannot resolve request uri [%s]", + DEBUGC(DBCLASS_PROXY, "is_sipuri_local: cannot resolve request uri [%s]", sip->req_uri->host); return STS_FALSE; } diff --git a/src/siproxd.c b/src/siproxd.c index 6dcd80c..c903e12 100644 --- a/src/siproxd.c +++ b/src/siproxd.c @@ -490,9 +490,19 @@ int main (int argc, char *argv[]) DEBUGC(DBCLASS_PROXY,"checking Max-Forwards (=%i)",forwards_count); if (forwards_count <= 0) { - DEBUGC(DBCLASS_SIP, "Forward count reached 0 -> 483 response"); - sip_gen_response(&ticket, 483 /*Too many hops*/); - goto end_loop; /* skip and free resources */ + if (MSG_IS_REQUEST(ticket.sipmsg) && MSG_IS_OPTIONS(ticket.sipmsg)) { + // special treatment for an OPTIONS message with Max-Forwards=0 + // -> RFC3261, 11.2 Processing of OPTIONS Request + // and 16.3 Request Validation, step 3 + // as this may be a request directed to us as proxy, reply to it. + DEBUGC(DBCLASS_SIP, "OPTION request with Max-Forwards=0 -> 200 response"); + sip_gen_response(&ticket, 200); + goto end_loop; /* skip and free resources */ + } else { + DEBUGC(DBCLASS_SIP, "Forward count reached 0 -> 483 response"); + sip_gen_response(&ticket, 483 /*Too many hops*/); + goto end_loop; /* skip and free resources */ + } } }