summaryrefslogtreecommitdiff
path: root/res/res_pjsip/pjsip_options.c
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2014-10-06 01:01:43 +0000
committerMatthew Jordan <mjordan@digium.com>2014-10-06 01:01:43 +0000
commitcce3d99ec86b52134ab544a1fe47657867e42ca5 (patch)
tree3b881efe0c49719a2e2c7dafe1d8f30fb5ecaeee /res/res_pjsip/pjsip_options.c
parentc01391686997f8d7c40bfddfe95efdb4cec130b5 (diff)
res_pjsip/pjsip_options: Do not 404 an OPTIONS request not sent to an endpoint
An OPTIONS request that is sent to Asterisk but not to a specific endpoint is currently sent a 404 in response. This is because, not surprisingly, an empty extension is never going to be found in the dialplan. This patch makes it so that we only attempt to look up the endpoint in the dialplan if it is specified in the OPTIONS request URI. #SIPit31 ASTERISK-24370 #close Reported by: Matt Jordan ........ Merged revisions 424624 from http://svn.asterisk.org/svn/asterisk/branches/12 ........ Merged revisions 424625 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@424626 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip/pjsip_options.c')
-rw-r--r--res/res_pjsip/pjsip_options.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/res/res_pjsip/pjsip_options.c b/res/res_pjsip/pjsip_options.c
index 453b21e86..150f43fea 100644
--- a/res/res_pjsip/pjsip_options.c
+++ b/res/res_pjsip/pjsip_options.c
@@ -641,7 +641,7 @@ static pj_bool_t options_on_rx_request(pjsip_rx_data *rdata)
if (ast_shutting_down()) {
send_options_response(rdata, 503);
- } else if (!ast_exists_extension(NULL, endpoint->context, exten, 1, NULL)) {
+ } else if (!ast_strlen_zero(exten) && !ast_exists_extension(NULL, endpoint->context, exten, 1, NULL)) {
send_options_response(rdata, 404);
} else {
send_options_response(rdata, 200);