diff options
author | oej <oej@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-01 11:51:38 +0000 |
---|---|---|
committer | oej <oej@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-01 11:51:38 +0000 |
commit | 21b30c8e33691d2408df0402c9b4db871e2ee3a4 (patch) | |
tree | 801122711f46c92418102f2a80d45b7b0309b0d9 /channels | |
parent | a3b669fd304914ce398c20fb0a2a965325d8816b (diff) |
Report 200 OK to all in-dialog OPTIONs requests (to confirm that the dialog
exist). Don't bother checking the request URI.
(closes issue #11264)
Reported by: ibc
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@126789 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_sip.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 96a61f7a2..c48f177b5 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -13584,11 +13584,18 @@ static int handle_request_options(struct sip_pvt *p, struct sip_request *req) { int res; - res = get_destination(p, req); - build_contact(p); /* XXX Should we authenticate OPTIONS? XXX */ + if (p->lastinvite) { + /* if this is a request in an active dialog, just confirm that the dialog exists. */ + transmit_response_with_allow(p, "200 OK", req, 0); + return 0; + } + + res = get_destination(p, req); + build_contact(p); + if (ast_strlen_zero(p->context)) ast_string_field_set(p, context, default_context); @@ -13601,8 +13608,7 @@ static int handle_request_options(struct sip_pvt *p, struct sip_request *req) /* Destroy if this OPTIONS was the opening request, but not if it's in the middle of a normal call flow. */ - if (!p->lastinvite) - sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT); + sip_scheddestroy(p, DEFAULT_TRANS_TIMEOUT); return res; } |