diff --git a/core/AmBasicSipDialog.cpp b/core/AmBasicSipDialog.cpp index 067a0177..b1a2ea48 100644 --- a/core/AmBasicSipDialog.cpp +++ b/core/AmBasicSipDialog.cpp @@ -342,9 +342,6 @@ void AmBasicSipDialog::onRxRequest(const AmSipRequest& req) string ua = getHeader(req.hdrs, SIP_HDR_USER_AGENT); setRemoteUA(ua); - - string allow = getHeader(req.hdrs, SIP_HDR_ALLOW); - setRemoteAllowHf(allow); } /* Dlg not yet initialized? */ @@ -361,11 +358,6 @@ void AmBasicSipDialog::onRxRequest(const AmSipRequest& req) setRouteSet( req.route ); set1stBranch( req.via_branch ); setOutboundInterface( req.local_if ); - - if (allow_hf.empty()) { /* if Allow hf is still empty */ - string allow = getHeader(req.hdrs, SIP_HDR_ALLOW); - setRemoteAllowHf(allow); - } } if (onRxReqStatus(req) && hdl) @@ -620,14 +612,10 @@ int AmBasicSipDialog::reply(const AmSipRequest& req, reply.cseq = req.cseq; reply.cseq_method = req.method; - /* add/update Allow header in 200OK, if wasn't empty in previously received request */ - if (reply.code == 200 && !allow_hf.empty()) { - /* make sure to remove if already added into hdrs */ - string allow = getHeader(reply.hdrs, SIP_HDR_ALLOW); - if (!allow.empty()) removeHeader(reply.hdrs, SIP_HDR_ALLOW); - - allow = allow_hf; /* must be added, when receiving request in AmBasicSipDialog::onRxRequest() */ - reply.hdrs += SIP_HDR_COLSP(SIP_HDR_ALLOW) + allow + CRLF; + /* Add Allow header in 200OK with default Allow, if it is empty */ + if (reply.code == 200 && getHeader(reply.hdrs, SIP_HDR_ALLOW).empty()) { + /* Add default Allow list, supporting all major methods */ + reply.hdrs += SIP_HDR_ALLOW_FULL CRLF; } if (body != NULL) diff --git a/core/AmBasicSipDialog.h b/core/AmBasicSipDialog.h index f4f4e2b1..03d84f23 100644 --- a/core/AmBasicSipDialog.h +++ b/core/AmBasicSipDialog.h @@ -112,8 +112,6 @@ protected: string route; - string allow_hf; - string next_hop; bool next_hop_1st_req; bool patch_ruri_next_hop; @@ -294,10 +292,6 @@ public: virtual void setRemoteUA(const string& new_remote_ua) { remote_ua = new_remote_ua; } - const string& getRemoteAllowHf() const { return allow_hf; } - virtual void setRemoteAllowHf(const string& new_allow_hf) - { allow_hf = new_allow_hf; } - const string& getRouteSet() const { return route; } virtual void setRouteSet(const string& new_rs) { route = new_rs; } diff --git a/core/sip/defs.h b/core/sip/defs.h index 07a6fee1..085aae6c 100644 --- a/core/sip/defs.h +++ b/core/sip/defs.h @@ -49,6 +49,7 @@ #define SIP_HDR_PROXY_AUTHENTICATE "Proxy-Authenticate" #define SIP_HDR_WWW_AUTHENTICATE "WWW-Authenticate" #define SIP_HDR_ALLOW "Allow" +#define SIP_HDR_ALLOW_FULL "Allow: INVITE,ACK,OPTIONS,CANCEL,BYE,UPDATE,PRACK,INFO,SUBSCRIBE,NOTIFY,REFER,MESSAGE,PUBLISH" #define SIP_HDR_RETRY_AFTER "Retry-After" #define SIP_HDR_ACCEPT "Accept" #define SIP_HDR_EVENT "Event"