|
reSIProcate/stack
9694
|
#include <DeprecatedDialog.hxx>

Definition at line 19 of file DeprecatedDialog.hxx.
| DeprecatedDialog::DeprecatedDialog | ( | const NameAddr & | localContact | ) |
Definition at line 20 of file DeprecatedDialog.cxx.
: mContact(localContact), mCreated(false), mEarly(false), mRouteSet(), mRemoteTarget(), mRemoteSequence(0), mRemoteEmpty(true), mLocalSequence(0), mLocalEmpty(true), mCallId(), mLocalTag(), mRemoteTag(), mRemoteUri(), mLocalUri() { // .kw. members "secure" and "expireyTimeAbsoluteMs" are not initialized! }
| void DeprecatedDialog::clear | ( | void | ) |
Definition at line 613 of file DeprecatedDialog.cxx.
References resip::ParserContainerBase::clear(), resip::Data::Empty, mCallId, mCreated, mEarly, mLocalEmpty, mLocalSequence, mLocalTag, mLocalUri, mRemoteEmpty, mRemoteSequence, mRemoteTag, mRemoteTarget, mRemoteUri, mRouteSet, and resip::CallID::value().
{
mCreated = false;
mEarly = false;
mRouteSet.clear();
mRemoteTarget = NameAddr();
mRemoteSequence = 0;
mRemoteEmpty = true;
mLocalSequence = 0;
mLocalEmpty = true;
mCallId.value() = Data::Empty;
mLocalTag = Data::Empty;
mRemoteTag = Data::Empty;
mRemoteUri = NameAddr();
mLocalUri = NameAddr();
}

| void DeprecatedDialog::copyCSeq | ( | SipMessage & | request | ) | [private] |
Definition at line 673 of file DeprecatedDialog.cxx.
References resip::SipMessage::header(), mLocalEmpty, and mLocalSequence.
Referenced by makeAck(), makeRequestInternal(), and updateRequest().
{
if (mLocalEmpty)
{
mLocalSequence = 1;
mLocalEmpty = false;
}
request.header(h_CSeq).sequence() = mLocalSequence;
}

| void DeprecatedDialog::createDialogAsUAC | ( | const SipMessage & | response | ) |
Definition at line 108 of file DeprecatedDialog.cxx.
References DebugLog, resip::SipMessage::exists(), resip::SipMessage::header(), InfoLog, resip::SipMessage::isRequest(), resip::SipMessage::isResponse(), mCallId, mCreated, mDialogId, mEarly, resip::RequestLine::method(), mLocalEmpty, mLocalSequence, mLocalTag, mLocalUri, mRemoteEmpty, mRemoteSequence, mRemoteTag, mRemoteTarget, mRemoteUri, mRouteSet, resip::ParserCategory::param(), and targetRefreshResponse().
Referenced by Loadgen::InviteClient::go(), performTest(), Client::process(), resip::TuIM::processRegisterResponse(), resip::TuIM::processSubscribeResponse(), and Client::thread().
{
if (!mCreated)
{
if(msg.isResponse())
{
const SipMessage& response = msg;
int code = response.header(h_StatusLine).statusCode();
mEarly = (code > 100 && code < 200);
if (code >= 200 && code < 300)
{
if (!response.exists(h_Contacts) || response.header(h_Contacts).size() != 1)
{
InfoLog (<< "Response doesn't have a contact header or more than one contact, so can't create dialog");
DebugLog (<< response);
throw Exception("Invalid or missing contact header in message", __FILE__,__LINE__);
}
}
// reverse order from response
if (response.exists(h_RecordRoutes))
{
mRouteSet = response.header(h_RecordRoutes).reverse();
}
if (response.exists(h_Contacts) && !response.header(h_Contacts).empty())
{
mRemoteTarget = response.header(h_Contacts).front();
}
mRemoteSequence = 0;
mRemoteEmpty = true;
mLocalSequence = response.header(h_CSeq).sequence();
mLocalEmpty = false;
mCallId = response.header(h_CallId);
if ( response.header(h_From).exists(p_tag) ) // 2543 compat
{
mLocalTag = response.header(h_From).param(p_tag);
}
if ( response.header(h_To).exists(p_tag) ) // 2543 compat
{
mRemoteTag = response.header(h_To).param(p_tag);
}
mRemoteUri = response.header(h_To);
mLocalUri = response.header(h_From);
mDialogId = mCallId;
mDialogId.param(p_toTag) = mLocalTag;
mDialogId.param(p_fromTag) = mRemoteTag;
mCreated = true;
}
else if (msg.isRequest() && msg.header(h_CSeq).method() == NOTIFY)
{
const SipMessage& notify = msg;
if (notify.exists(h_RecordRoutes))
{
mRouteSet = notify.header(h_RecordRoutes);
}
if (!notify.exists(h_Contacts) && notify.header(h_Contacts).size() != 1)
{
InfoLog (<< "Notify doesn't have a contact header or more than one contact, so can't create dialog");
DebugLog (<< notify);
throw Exception("Invalid or missing contact header in notify", __FILE__,__LINE__);
}
mRemoteTarget = notify.header(h_Contacts).front();
mRemoteSequence = notify.header(h_CSeq).sequence();
mRemoteEmpty = false;
mLocalSequence = 0;
mLocalEmpty = true;
mCallId = notify.header(h_CallId);
if (notify.header(h_To).exists(p_tag))
{
mLocalTag = notify.header(h_To).param(p_tag);
}
if (notify.header(h_From).exists(p_tag)) // 2543 compat
{
mRemoteTag = notify.header(h_From).param(p_tag);
}
mRemoteUri = notify.header(h_From);
mLocalUri = notify.header(h_To);
mDialogId = mCallId;
mDialogId.param(p_toTag) = mLocalTag;
mDialogId.param(p_fromTag) = mRemoteTag;
mCreated = true;
mEarly = false;
}
}
else if (msg.isResponse())
{
mEarly = (msg.header(h_StatusLine).statusCode() < 200 &&
msg.header(h_StatusLine).statusCode() > 100);
// don't update target for register since contact is not a target
if ( msg.header(h_CSeq).method() != REGISTER )
{
targetRefreshResponse(msg);
}
}
}

| Data DeprecatedDialog::dialogId | ( | const SipMessage & | msg | ) | [static] |
Definition at line 713 of file DeprecatedDialog.cxx.
References resip::Data::from(), resip::SipMessage::header(), resip::SipMessage::isExternal(), resip::SipMessage::isRequest(), resip::SipMessage::isResponse(), and resip::ParserCategory::param().
{
CallID id(msg.header(h_CallId));
if ((msg.isRequest() && msg.isExternal()) ||
(msg.isResponse() && !msg.isExternal()))
{
if (msg.header(h_To).exists(p_tag))
{
id.param(p_toTag) = msg.header(h_To).param(p_tag);
}
if (msg.header(h_From).exists(p_tag))
{
id.param(p_fromTag) = msg.header(h_From).param(p_tag);
}
}
else
{
if (msg.header(h_From).exists(p_tag))
{
id.param(p_toTag) = msg.header(h_From).param(p_tag);
}
if (msg.header(h_To).exists(p_tag))
{
id.param(p_fromTag) = msg.header(h_To).param(p_tag);
}
}
return Data::from(id);
}

| const Data DeprecatedDialog::dialogId | ( | ) | const |
Definition at line 744 of file DeprecatedDialog.cxx.
References resip::Data::from(), and mDialogId.
{
return Data::from(mDialogId);
}

| const CallID& resip::DeprecatedDialog::getCallId | ( | ) | const [inline] |
Definition at line 67 of file DeprecatedDialog.hxx.
References mCallId.
Referenced by resip::TuIM::processResponse(), and resip::TuIM::processSubscribeRequest().
{ return mCallId; }
| int DeprecatedDialog::getExpirySeconds | ( | ) |
Definition at line 758 of file DeprecatedDialog.cxx.
References expireyTimeAbsoluteMs, and resip::Timer::getTimeMs().
Referenced by resip::TuIM::sendNotify().
{
// !cj! TODO - may be bugs here when result is negative
UInt64 delta = ( expireyTimeAbsoluteMs - Timer::getTimeMs() )/1000;
int ret = (int)delta;
return ret;
}

| const Data& resip::DeprecatedDialog::getRemoteTag | ( | ) | const [inline] |
| const NameAddr& resip::DeprecatedDialog::getRemoteTarget | ( | ) | const [inline] |
Definition at line 68 of file DeprecatedDialog.hxx.
References mRemoteTarget.
{ return mRemoteTarget; }
| void DeprecatedDialog::incrementCSeq | ( | SipMessage & | request | ) | [private] |
Definition at line 684 of file DeprecatedDialog.cxx.
References resip::SipMessage::header(), mLocalEmpty, and mLocalSequence.
Referenced by makeBye(), makeInvite(), makeNotify(), makeOptions(), makePublish(), makeRefer(), makeRegister(), makeRequest(), makeSubscribe(), makeUpdate(), and updateRequest().
{
if (mLocalEmpty)
{
mLocalSequence = 1;
mLocalEmpty = false;
}
//DebugLog ( << "mLocalSequence: " << mLocalSequence);
request.header(h_CSeq).sequence() = ++mLocalSequence;
}

| bool resip::DeprecatedDialog::isCreated | ( | ) | const [inline] |
Definition at line 62 of file DeprecatedDialog.hxx.
References mCreated.
Referenced by resip::TuIM::process().
{ return mCreated; }
| bool resip::DeprecatedDialog::isEarly | ( | ) | const [inline] |
| SipMessage * DeprecatedDialog::makeAck | ( | ) |
Definition at line 577 of file DeprecatedDialog.cxx.
References copyCSeq(), and makeRequestInternal().
Referenced by Loadgen::InviteClient::go(), performTest(), Client::process(), and Client::thread().
{
SipMessage* request = makeRequestInternal(ACK);
copyCSeq(*request);
return request;
}

| SipMessage * DeprecatedDialog::makeAck | ( | const SipMessage & | request | ) |
Definition at line 555 of file DeprecatedDialog.cxx.
References copyCSeq(), resip::SipMessage::exists(), resip::SipMessage::header(), and makeRequestInternal().
{
SipMessage* request = makeRequestInternal(ACK);
copyCSeq(*request);
// !dcm! should we copy the authorizations?
// !jf! will this do the right thing if these headers weren't in original
// we should be able to store this stuff in the DeprecatedDialog and not need to pass
// in the original
if (original.exists(h_ProxyAuthorizations))
{
request->header(h_ProxyAuthorizations) = original.header(h_ProxyAuthorizations);
}
if (original.exists(h_Authorizations))
{
request->header(h_Authorizations) = original.header(h_Authorizations);
}
request->header(h_CSeq).sequence() = original.header(h_CSeq).sequence();
return request;
}

| SipMessage * DeprecatedDialog::makeBye | ( | ) |
Definition at line 499 of file DeprecatedDialog.cxx.
References incrementCSeq(), and makeRequestInternal().
Referenced by Loadgen::InviteClient::go(), performTest(), Client::process(), and Client::thread().
{
SipMessage* request = makeRequestInternal(BYE);
incrementCSeq(*request);
return request;
}

| SipMessage * DeprecatedDialog::makeCancel | ( | const SipMessage & | request | ) |
Definition at line 585 of file DeprecatedDialog.cxx.
References resip::RequestLine::getMethod(), resip::SipMessage::header(), and resip::RequestLine::method().
{
assert (request.header(h_Vias).size() >= 1);
assert (request.header(h_RequestLine).getMethod() == INVITE);
SipMessage* cancel = new SipMessage;
cancel->header(h_RequestLine) = request.header(h_RequestLine);
cancel->header(h_RequestLine).method() = CANCEL;
cancel->header(h_CallId) = request.header(h_CallId);
cancel->header(h_To) = request.header(h_To);
cancel->header(h_From) = request.header(h_From);
cancel->header(h_CSeq) = request.header(h_CSeq);
cancel->header(h_CSeq).method() = CANCEL;
cancel->header(h_Vias).push_back(request.header(h_Vias).front());
return cancel;
}

| SipMessage * DeprecatedDialog::makeInitialInvite | ( | const NameAddr & | target, |
| const NameAddr & | from | ||
| ) |
Definition at line 444 of file DeprecatedDialog.cxx.
References resip::SipMessage::const_header(), makeInvite(), mCallId, mContact, mLocalEmpty, mLocalSequence, mLocalTag, mLocalUri, mRemoteUri, mRequestUri, and resip::RequestLine::uri().
{
SipMessage* msg = Helper::makeInvite( target, from, mContact );
assert( msg );
mRequestUri = msg->const_header(h_RequestLine).uri();
mLocalEmpty = false;
mLocalSequence = msg->const_header(h_CSeq).sequence();
mCallId = msg->const_header(h_CallId);
assert(msg->const_header(h_From).exists(p_tag));
mLocalTag = msg->const_header(h_From).param(p_tag);
mRemoteUri = msg->const_header(h_To);
mLocalUri = msg->const_header(h_From);
return msg;
}

| SipMessage * DeprecatedDialog::makeInitialMessage | ( | const NameAddr & | target, |
| const NameAddr & | from | ||
| ) |
Definition at line 425 of file DeprecatedDialog.cxx.
References resip::SipMessage::const_header(), resip::Helper::makeMessage(), mCallId, mContact, mLocalEmpty, mLocalSequence, mLocalTag, mLocalUri, mRemoteUri, mRequestUri, and resip::RequestLine::uri().
Referenced by resip::TuIM::sendPage().
{
SipMessage* msg = Helper::makeMessage( target, from, mContact );
assert( msg );
mRequestUri = msg->const_header(h_RequestLine).uri();
mLocalEmpty = false;
mLocalSequence = msg->const_header(h_CSeq).sequence();
mCallId = msg->const_header(h_CallId);
assert(msg->const_header(h_From).exists(p_tag));
mLocalTag = msg->const_header(h_From).param(p_tag);
mRemoteUri = msg->const_header(h_To);
mLocalUri = msg->const_header(h_From);
return msg;
}

| SipMessage * DeprecatedDialog::makeInitialPublish | ( | const NameAddr & | target, |
| const NameAddr & | from | ||
| ) |
Definition at line 406 of file DeprecatedDialog.cxx.
References resip::SipMessage::const_header(), makePublish(), mCallId, mContact, mLocalEmpty, mLocalSequence, mLocalTag, mLocalUri, mRemoteUri, mRequestUri, and resip::RequestLine::uri().
Referenced by resip::TuIM::sendPublish().
{
SipMessage* msg = Helper::makePublish( target, from, mContact );
assert( msg );
mRequestUri = msg->const_header(h_RequestLine).uri();
mLocalEmpty = false;
mLocalSequence = msg->const_header(h_CSeq).sequence();
mCallId = msg->const_header(h_CallId);
assert(msg->const_header(h_From).exists(p_tag));
mLocalTag = msg->const_header(h_From).param(p_tag);
mRemoteUri = msg->const_header(h_To);
mLocalUri = msg->const_header(h_From);
return msg;
}

| SipMessage * DeprecatedDialog::makeInitialRegister | ( | const NameAddr & | registrar, |
| const NameAddr & | from | ||
| ) |
Definition at line 365 of file DeprecatedDialog.cxx.
References resip::SipMessage::const_header(), makeRegister(), mCallId, mContact, mCreated, mLocalEmpty, mLocalSequence, mLocalTag, mLocalUri, mRemoteTarget, mRemoteUri, mRequestUri, and resip::RequestLine::uri().
Referenced by resip::TuIM::registerAor().
{
SipMessage* msg = Helper::makeRegister( registrar, aor, mContact );
assert( msg );
mRequestUri = msg->const_header(h_RequestLine).uri();
mLocalEmpty = false;
mLocalSequence = msg->const_header(h_CSeq).sequence();
mCallId = msg->const_header(h_CallId);
assert(msg->const_header(h_From).exists(p_tag));
mLocalTag = msg->const_header(h_From).param(p_tag);
mRemoteUri = msg->const_header(h_To);
mLocalUri = msg->const_header(h_From);
mCreated = true;
mRemoteTarget = mRemoteUri;
return msg;
}

| SipMessage * DeprecatedDialog::makeInitialSubscribe | ( | const NameAddr & | target, |
| const NameAddr & | from | ||
| ) |
Definition at line 387 of file DeprecatedDialog.cxx.
References resip::SipMessage::const_header(), makeSubscribe(), mCallId, mContact, mLocalEmpty, mLocalSequence, mLocalTag, mLocalUri, mRemoteUri, mRequestUri, and resip::RequestLine::uri().
Referenced by resip::TuIM::subscribeBuddy().
{
SipMessage* msg = Helper::makeSubscribe( target, from, mContact );
assert( msg );
mRequestUri = msg->const_header(h_RequestLine).uri();
mLocalEmpty = false;
mLocalSequence = msg->const_header(h_CSeq).sequence();
mCallId = msg->const_header(h_CallId);
assert(msg->const_header(h_From).exists(p_tag));
mLocalTag = msg->const_header(h_From).param(p_tag);
mRemoteUri = msg->const_header(h_To);
mLocalUri = msg->const_header(h_From);
return msg;
}

| SipMessage * DeprecatedDialog::makeInvite | ( | ) |
Definition at line 463 of file DeprecatedDialog.cxx.
References DebugLog, incrementCSeq(), and makeRequestInternal().
Referenced by makeInitialInvite().
{
SipMessage* request = makeRequestInternal(INVITE);
incrementCSeq(*request);
DebugLog(<< "DeprecatedDialog::makeInvite: " << *request);
return request;
}

| SipMessage * DeprecatedDialog::makeNotify | ( | ) |
Definition at line 519 of file DeprecatedDialog.cxx.
References incrementCSeq(), and makeRequestInternal().
Referenced by resip::TuIM::sendNotify().
{
SipMessage* request = makeRequestInternal(NOTIFY);
incrementCSeq(*request);
return request;
}

| SipMessage * DeprecatedDialog::makeOptions | ( | ) |
Definition at line 528 of file DeprecatedDialog.cxx.
References incrementCSeq(), and makeRequestInternal().
{
SipMessage* request = makeRequestInternal(OPTIONS);
incrementCSeq(*request);
return request;
}

| SipMessage * DeprecatedDialog::makePublish | ( | ) |
Definition at line 536 of file DeprecatedDialog.cxx.
References incrementCSeq(), and makeRequestInternal().
Referenced by makeInitialPublish().
{
SipMessage* request = makeRequestInternal(PUBLISH);
incrementCSeq(*request);
return request;
}

| SipMessage * DeprecatedDialog::makeRefer | ( | const NameAddr & | referTo | ) |
Definition at line 509 of file DeprecatedDialog.cxx.
References resip::SipMessage::header(), incrementCSeq(), makeRequestInternal(), and mLocalUri.
{
SipMessage* request = makeRequestInternal(REFER);
request->header(h_ReferTo) = referTo;
request->header(h_ReferredBy) = mLocalUri;
incrementCSeq(*request);
return request;
}

| SipMessage * DeprecatedDialog::makeRegister | ( | ) |
Definition at line 481 of file DeprecatedDialog.cxx.
References DebugLog, incrementCSeq(), and makeRequestInternal().
Referenced by makeInitialRegister(), resip::TuIM::process(), and resip::TuIM::processRegisterResponse().
{
SipMessage* request = makeRequestInternal(REGISTER);
incrementCSeq(*request);
DebugLog(<< "DeprecatedDialog::makeRegister: " << *request);
return request;
}

| CallId DeprecatedDialog::makeReplaces | ( | ) |
| SipMessage * DeprecatedDialog::makeRequest | ( | resip::MethodTypes | method | ) |
Definition at line 544 of file DeprecatedDialog.cxx.
References incrementCSeq(), and makeRequestInternal().
{
assert(method != ACK);
assert(method != CANCEL);
SipMessage* request = makeRequestInternal(method);
incrementCSeq(*request);
return request;
}

| SipMessage * DeprecatedDialog::makeRequestInternal | ( | MethodTypes | method | ) | [private] |
Definition at line 632 of file DeprecatedDialog.cxx.
References copyCSeq(), resip::Data::empty(), resip::SipMessage::header(), mCallId, mContact, mCreated, resip::RequestLine::method(), mLocalTag, mLocalUri, mRemoteTag, mRemoteTarget, mRemoteUri, mRequestUri, mRouteSet, resip::ParserCategory::param(), resip::Helper::processStrictRoute(), resip::RequestLine::uri(), and resip::NameAddr::uri().
Referenced by makeAck(), makeBye(), makeInvite(), makeNotify(), makeOptions(), makePublish(), makeRefer(), makeRegister(), makeRequest(), makeSubscribe(), and makeUpdate().
{
SipMessage* request = new SipMessage;
RequestLine rLine(method);
if (!mCreated)
{
rLine.uri() = mRequestUri;
}
else
{
rLine.uri() = mRemoteTarget.uri();
}
request->header(h_RequestLine) = rLine;
request->header(h_To) = mRemoteUri;
if ( !mRemoteTag.empty() )
{
request->header(h_To).param(p_tag) = mRemoteTag;
}
request->header(h_From) = mLocalUri;
if ( !mLocalTag.empty() )
{
request->header(h_From).param(p_tag) = mLocalTag;
}
request->header(h_CallId) = mCallId;
request->header(h_Routes) = mRouteSet;
request->header(h_Contacts).push_back(mContact);
request->header(h_CSeq).method() = method;
copyCSeq(*request);
request->header(h_MaxForwards).value() = 70;
Via via;
via.param(p_branch); // will create the branch
request->header(h_Vias).push_front(via);
Helper::processStrictRoute(*request);
return request;
}

| SipMessage * DeprecatedDialog::makeResponse | ( | const SipMessage & | request, |
| int | code = 200 |
||
| ) |
Definition at line 40 of file DeprecatedDialog.cxx.
References resip::Helper::computeTag(), DebugLog, resip::SipMessage::exists(), resip::RequestLine::getMethod(), resip::SipMessage::header(), InfoLog, resip::SipMessage::isRequest(), mCallId, mContact, mCreated, mDialogId, mEarly, mLocalEmpty, mLocalSequence, mLocalTag, mLocalUri, mRemoteEmpty, mRemoteSequence, mRemoteTag, mRemoteTarget, mRemoteUri, mRouteSet, resip::ParserCategory::param(), and resip::Helper::tagSize.
Referenced by makeResponse(), performTest(), and resip::TuIM::processSubscribeRequest().
{
assert( code >= 100 );
if ( (!mCreated) && (code < 300) && (code > 100) )
{
assert (code > 100);
assert (code < 300);
assert(request.isRequest());
assert(request.header(h_RequestLine).getMethod() == INVITE ||
request.header(h_RequestLine).getMethod() == SUBSCRIBE ||
request.header(h_RequestLine).getMethod() == PUBLISH);
assert (request.header(h_Contacts).size() == 1);
SipMessage* response = Helper::makeResponse(request, code, mContact);
if (request.exists(h_RecordRoutes))
{
mRouteSet = request.header(h_RecordRoutes);
}
if (!request.exists(h_Contacts) && request.header(h_Contacts).size() != 1)
{
InfoLog (<< "Request doesn't have a contact header or more than one contact, so can't create dialog");
DebugLog (<< request);
throw Exception("Invalid or missing contact header in request", __FILE__,__LINE__);
}
mRemoteTarget = request.header(h_Contacts).front();
mRemoteSequence = request.header(h_CSeq).sequence();
mRemoteEmpty = false;
mLocalSequence = 0;
mLocalEmpty = true;
mCallId = request.header(h_CallId);
response->header(h_To).param(p_tag) = Helper::computeTag(Helper::tagSize);
assert (response->header(h_To).exists(p_tag));
mLocalTag = response->header(h_To).param(p_tag); // from response
if (request.header(h_From).exists(p_tag)) // 2543 compat
{
mRemoteTag = request.header(h_From).param(p_tag);
}
mRemoteUri = request.header(h_From);
mLocalUri = request.header(h_To);
mDialogId = mCallId;
mDialogId.param(p_toTag) = mLocalTag;
mDialogId.param(p_fromTag) = mRemoteTag;
mEarly = (code < 200);
mCreated = true;
return response;
}
else
{
SipMessage* response = Helper::makeResponse(request, code, mContact);
if (mCreated)
{
response->header(h_To).param(p_tag) = mLocalTag;
}
//DebugLog(<< "Created response within dialog: " << *response);
return response;
}
}

| void DeprecatedDialog::makeResponse | ( | const SipMessage & | request, |
| SipMessage & | response, | ||
| int | code = 200 |
||
| ) |
Definition at line 304 of file DeprecatedDialog.cxx.
References resip::Helper::computeTag(), resip::SipMessage::const_header(), DebugLog, resip::SipMessage::exists(), resip::RequestLine::getMethod(), resip::SipMessage::header(), InfoLog, resip::SipMessage::isRequest(), makeResponse(), mCallId, mContact, mCreated, mDialogId, mEarly, mLocalEmpty, mLocalSequence, mLocalTag, mLocalUri, mRemoteEmpty, mRemoteSequence, mRemoteTag, mRemoteTarget, mRemoteUri, mRouteSet, resip::ParserCategory::param(), and resip::Helper::tagSize.
{
assert(request.isRequest());
if ( (!mCreated) && (code < 300) && (code > 100) )
{
assert(request.header(h_RequestLine).getMethod() == INVITE ||
request.header(h_RequestLine).getMethod() == SUBSCRIBE);
assert (request.header(h_Contacts).size() == 1);
Helper::makeResponse(response, request, code, mContact);
response.header(h_To).param(p_tag) = Helper::computeTag(Helper::tagSize);
if (request.exists(h_RecordRoutes))
{
mRouteSet = request.header(h_RecordRoutes);
}
if (!request.exists(h_Contacts) && request.header(h_Contacts).size() != 1)
{
InfoLog (<< "Request doesn't have a contact header or more than one contact, so can't create dialog");
DebugLog (<< request);
throw Exception("Invalid or missing contact header in request", __FILE__,__LINE__);
}
mRemoteTarget = request.header(h_Contacts).front();
mRemoteSequence = request.header(h_CSeq).sequence();
mRemoteEmpty = false;
mLocalSequence = 0;
mLocalEmpty = true;
mCallId = request.header(h_CallId);
assert (response.const_header(h_To).exists(p_tag));
mLocalTag = response.header(h_To).param(p_tag); // from response
if (request.header(h_From).exists(p_tag)) // 2543 compat
{
mRemoteTag = request.header(h_From).param(p_tag);
}
mRemoteUri = request.header(h_From);
mLocalUri = request.header(h_To);
mDialogId = mCallId;
mDialogId.param(p_toTag) = mLocalTag;
mDialogId.param(p_fromTag) = mRemoteTag;
mEarly = (code > 100 && code < 200);
mCreated = true;
}
else
{
Helper::makeResponse(response, request, code, mContact);
if (mCreated)
{
response.header(h_To).param(p_tag) = mLocalTag;
mEarly = false;
}
}
}

| SipMessage * DeprecatedDialog::makeSubscribe | ( | ) |
Definition at line 490 of file DeprecatedDialog.cxx.
References DebugLog, incrementCSeq(), and makeRequestInternal().
Referenced by makeInitialSubscribe(), and resip::TuIM::process().
{
SipMessage* request = makeRequestInternal(SUBSCRIBE);
incrementCSeq(*request);
DebugLog(<< "DeprecatedDialog::makeSubscribe: " << *request);
return request;
}

| SipMessage * DeprecatedDialog::makeUpdate | ( | ) |
Definition at line 472 of file DeprecatedDialog.cxx.
References DebugLog, incrementCSeq(), and makeRequestInternal().
{
SipMessage* request = makeRequestInternal(UPDATE);
incrementCSeq(*request);
DebugLog(<< "DeprecatedDialog::makeUpdate: " << *request);
return request;
}

| void DeprecatedDialog::setExpirySeconds | ( | int | secondsInFuture | ) |
Definition at line 751 of file DeprecatedDialog.cxx.
References expireyTimeAbsoluteMs, and resip::Timer::getTimeMs().
Referenced by resip::TuIM::processSubscribeRequest().
{
expireyTimeAbsoluteMs = Timer::getTimeMs() + 1000*secondsInFuture;
}

| int DeprecatedDialog::targetRefreshRequest | ( | const SipMessage & | request | ) |
Definition at line 226 of file DeprecatedDialog.cxx.
References DebugLog, resip::SipMessage::exists(), resip::RequestLine::getMethod(), resip::SipMessage::header(), InfoLog, mRemoteEmpty, mRemoteSequence, and mRemoteTarget.
{
assert (request.header(h_RequestLine).getMethod() != CANCEL);
if (request.header(h_RequestLine).getMethod() != ACK)
{
unsigned long cseq = request.header(h_CSeq).sequence();
if (mRemoteEmpty)
{
mRemoteSequence = cseq;
mRemoteEmpty = false;
}
else if (cseq < mRemoteSequence)
{
InfoLog (<< "Got a cseq out of sequence: " << cseq << " < " << mRemoteSequence);
throw Exception("out of order", __FILE__,__LINE__);
}
else
{
mRemoteSequence = cseq;
}
if (request.exists(h_Contacts) && request.header(h_Contacts).size() == 1)
{
mRemoteTarget = request.header(h_Contacts).front();
}
else
{
InfoLog (<< "Request doesn't have a contact header or more than one contact, so can't create dialog");
DebugLog (<< request);
throw Exception("Invalid or missing contact header in message", __FILE__,__LINE__);
}
}
return 0;
}

| void DeprecatedDialog::targetRefreshResponse | ( | const SipMessage & | response | ) |
Definition at line 217 of file DeprecatedDialog.cxx.
References resip::SipMessage::exists(), resip::SipMessage::header(), and mRemoteTarget.
Referenced by createDialogAsUAC().
{
if (response.exists(h_Contacts) && response.header(h_Contacts).size() == 1)
{
mRemoteTarget = response.header(h_Contacts).front();
}
}

| void DeprecatedDialog::updateRequest | ( | SipMessage & | msg | ) |
Definition at line 264 of file DeprecatedDialog.cxx.
References resip::LazyParser::clear(), resip::SipMessage::clearForceTarget(), copyCSeq(), DebugLog, resip::Data::empty(), resip::SipMessage::header(), incrementCSeq(), resip::SipMessage::isRequest(), mCallId, mContact, mCreated, mLocalTag, mLocalUri, mRemoteTag, mRemoteTarget, mRemoteUri, mRouteSet, resip::ParserCategory::param(), resip::Helper::processStrictRoute(), resip::RequestLine::uri(), and resip::NameAddr::uri().
{
assert (request.isRequest());
if (mCreated)
{
request.header(h_RequestLine).uri() = mRemoteTarget.uri();
request.header(h_To) = mRemoteUri;
if ( !mRemoteTag.empty() )
{
request.header(h_To).param(p_tag) = mRemoteTag;
}
request.header(h_From) = mLocalUri;
if ( !mLocalTag.empty() )
{
request.header(h_From).param(p_tag) = mLocalTag;
}
request.header(h_CallId) = mCallId;
request.header(h_Routes) = mRouteSet;
request.header(h_Contacts).clear();
request.header(h_Contacts).push_back(mContact);
copyCSeq(request);
incrementCSeq(request);
request.header(h_MaxForwards).value() = 70;
Via via;
via.param(p_branch); // will create the branch
request.header(h_Vias).clear();
request.header(h_Vias).push_back(via);
request.clearForceTarget();
Helper::processStrictRoute(request);
}
else
{
DebugLog (<< "Updating a request when not in a dialog yet");
}
}

| EncodeStream& operator<< | ( | EncodeStream & | , |
| const DeprecatedDialog & | |||
| ) | [friend] |
Definition at line 136 of file DeprecatedDialog.hxx.
Referenced by getExpirySeconds(), and setExpirySeconds().
CallID resip::DeprecatedDialog::mCallId [private] |
Definition at line 126 of file DeprecatedDialog.hxx.
Referenced by clear(), createDialogAsUAC(), getCallId(), makeInitialInvite(), makeInitialMessage(), makeInitialPublish(), makeInitialRegister(), makeInitialSubscribe(), makeRequestInternal(), makeResponse(), and updateRequest().
NameAddr resip::DeprecatedDialog::mContact [private] |
Definition at line 110 of file DeprecatedDialog.hxx.
Referenced by makeInitialInvite(), makeInitialMessage(), makeInitialPublish(), makeInitialRegister(), makeInitialSubscribe(), makeRequestInternal(), makeResponse(), and updateRequest().
bool resip::DeprecatedDialog::mCreated [private] |
Definition at line 113 of file DeprecatedDialog.hxx.
Referenced by clear(), createDialogAsUAC(), isCreated(), makeInitialRegister(), makeRequestInternal(), makeResponse(), and updateRequest().
CallID resip::DeprecatedDialog::mDialogId [private] |
Definition at line 129 of file DeprecatedDialog.hxx.
Referenced by createDialogAsUAC(), dialogId(), makeReplaces(), and makeResponse().
bool resip::DeprecatedDialog::mEarly [private] |
Definition at line 114 of file DeprecatedDialog.hxx.
Referenced by clear(), createDialogAsUAC(), isEarly(), and makeResponse().
bool resip::DeprecatedDialog::mLocalEmpty [private] |
Definition at line 124 of file DeprecatedDialog.hxx.
Referenced by clear(), copyCSeq(), createDialogAsUAC(), incrementCSeq(), makeInitialInvite(), makeInitialMessage(), makeInitialPublish(), makeInitialRegister(), makeInitialSubscribe(), and makeResponse().
unsigned long resip::DeprecatedDialog::mLocalSequence [private] |
Definition at line 123 of file DeprecatedDialog.hxx.
Referenced by clear(), copyCSeq(), createDialogAsUAC(), incrementCSeq(), makeInitialInvite(), makeInitialMessage(), makeInitialPublish(), makeInitialRegister(), makeInitialSubscribe(), and makeResponse().
Data resip::DeprecatedDialog::mLocalTag [private] |
Definition at line 127 of file DeprecatedDialog.hxx.
Referenced by clear(), createDialogAsUAC(), makeInitialInvite(), makeInitialMessage(), makeInitialPublish(), makeInitialRegister(), makeInitialSubscribe(), makeRequestInternal(), makeResponse(), and updateRequest().
NameAddr resip::DeprecatedDialog::mLocalUri [private] |
Definition at line 132 of file DeprecatedDialog.hxx.
Referenced by clear(), createDialogAsUAC(), makeInitialInvite(), makeInitialMessage(), makeInitialPublish(), makeInitialRegister(), makeInitialSubscribe(), makeRefer(), makeRequestInternal(), makeResponse(), and updateRequest().
bool resip::DeprecatedDialog::mRemoteEmpty [private] |
Definition at line 122 of file DeprecatedDialog.hxx.
Referenced by clear(), createDialogAsUAC(), makeResponse(), and targetRefreshRequest().
unsigned long resip::DeprecatedDialog::mRemoteSequence [private] |
Definition at line 121 of file DeprecatedDialog.hxx.
Referenced by clear(), createDialogAsUAC(), makeResponse(), and targetRefreshRequest().
Data resip::DeprecatedDialog::mRemoteTag [private] |
Definition at line 128 of file DeprecatedDialog.hxx.
Referenced by clear(), createDialogAsUAC(), getRemoteTag(), makeRequestInternal(), makeResponse(), and updateRequest().
Definition at line 119 of file DeprecatedDialog.hxx.
Referenced by clear(), createDialogAsUAC(), getRemoteTarget(), makeInitialRegister(), makeRequestInternal(), makeResponse(), targetRefreshRequest(), targetRefreshResponse(), and updateRequest().
NameAddr resip::DeprecatedDialog::mRemoteUri [private] |
Definition at line 131 of file DeprecatedDialog.hxx.
Referenced by clear(), createDialogAsUAC(), makeInitialInvite(), makeInitialMessage(), makeInitialPublish(), makeInitialRegister(), makeInitialSubscribe(), makeRequestInternal(), makeResponse(), and updateRequest().
Uri resip::DeprecatedDialog::mRequestUri [private] |
Definition at line 116 of file DeprecatedDialog.hxx.
Referenced by makeInitialInvite(), makeInitialMessage(), makeInitialPublish(), makeInitialRegister(), makeInitialSubscribe(), and makeRequestInternal().
NameAddrs resip::DeprecatedDialog::mRouteSet [private] |
Definition at line 118 of file DeprecatedDialog.hxx.
Referenced by clear(), createDialogAsUAC(), makeRequestInternal(), makeResponse(), and updateRequest().
bool resip::DeprecatedDialog::secure [private] |
Definition at line 134 of file DeprecatedDialog.hxx.
1.7.5.1