Fixed bug: check for repeated 'Accept' header to detect if SDP is accepted.
git-svn-id: http://yate.null.ro/svn/yate/trunk@6538 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
8ca99f45a5
commit
9c9129aa98
|
@ -2037,8 +2037,19 @@ static void copyPrivacy(SIPMessage& sip, const NamedList& msg)
|
|||
static bool sdpAccept(const SIPMessage* sip, bool def)
|
||||
{
|
||||
static const Regexp r("\\(^\\|,\\) *application/sdp *\\($\\|[,;]\\)",false,true);
|
||||
const MimeHeaderLine* hl = sip ? sip->getHeader("Accept") : 0;
|
||||
return hl ? r.matches(*hl) : def;
|
||||
|
||||
if (sip) {
|
||||
for (ObjList* o = sip->header.skipNull(); o; o = o->skipNext()) {
|
||||
const MimeHeaderLine* hl = static_cast<const MimeHeaderLine*>(o->get());
|
||||
if (hl->name() |= "Accept")
|
||||
continue;
|
||||
if (r.matches(*hl))
|
||||
return true;
|
||||
// Header found but not matching: reset def val
|
||||
def = false;
|
||||
}
|
||||
}
|
||||
return def;
|
||||
}
|
||||
|
||||
// Copy message body to yate message
|
||||
|
|
Loading…
Reference in New Issue