Check that we allow the request method. The request-method is compared with the list of supported methods in allow. If match is found, 0 is is returned. Otherwise, if the request-method is well-known, 405 is returned. If the request-method is unknown, 501 is returned. If irq is non-NULL, the 405 or 501 response message is sent to the client, too.
Definition at line 149 of file nta_check.c. References name, sip_request_s::rq_method, sip_request_s::rq_method_name, SIP_405_METHOD_NOT_ALLOWED, SIP_501_NOT_IMPLEMENTED, sip_method_unknown, sip_s::sip_request, SIPTAG_ALLOW, ta_end, ta_start, and ta_tags. { /* Check extensions */ sip_method_t method = sip->sip_request->rq_method; char const *name = sip->sip_request->rq_method_name; if (sip_is_allowed(allow, method, name)) return 0; if (irq) { ta_list ta; ta_start(ta, tag, value); if (method != sip_method_unknown) /* Well-known method */ nta_incoming_treply(irq, SIP_405_METHOD_NOT_ALLOWED, SIPTAG_ALLOW(allow), ta_tags(ta)); else /* Completeley unknown method */ nta_incoming_treply(irq, SIP_501_NOT_IMPLEMENTED, SIPTAG_ALLOW(allow), ta_tags(ta)); ta_end(ta); } return method != sip_method_unknown ? 405 : 501; }
|