/[resiprocate]/main/resip/dum/Dialog.cxx
ViewVC logotype

Contents of /main/resip/dum/Dialog.cxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3156 - (show annotations) (download)
Tue Jul 27 21:17:55 2004 UTC (15 years, 4 months ago) by jason
Original Path: main/sip/resiprocate/dum/Dialog.cxx
File size: 24757 byte(s)
change many InfoLog to DebugLog

1 #include "resiprocate/Contents.hxx"
2 #include "resiprocate/Helper.hxx"
3 #include "resiprocate/SipMessage.hxx"
4 #include "resiprocate/dum/AppDialog.hxx"
5 #include "resiprocate/dum/BaseCreator.hxx"
6 #include "resiprocate/dum/ClientAuthManager.hxx"
7 #include "resiprocate/dum/ClientInviteSession.hxx"
8 #include "resiprocate/dum/ClientSubscription.hxx"
9 #include "resiprocate/dum/Dialog.hxx"
10 #include "resiprocate/dum/DialogUsageManager.hxx"
11 #include "resiprocate/dum/InviteSessionCreator.hxx"
12 #include "resiprocate/dum/InviteSessionHandler.hxx"
13 #include "resiprocate/dum/ServerInviteSession.hxx"
14 #include "resiprocate/dum/ServerSubscription.hxx"
15 #include "resiprocate/dum/SubscriptionHandler.hxx"
16 #include "resiprocate/dum/UsageUseException.hxx"
17 #include "resiprocate/os/Logger.hxx"
18
19 #if defined(WIN32) && defined(_DEBUG) && defined(LEAK_CHECK)// Used for tracking down memory leaks in Visual Studio
20 #define _CRTDBG_MAP_ALLOC
21 #include <stdlib.h>
22 #include <crtdbg.h>
23 #define new new( _NORMAL_BLOCK, __FILE__, __LINE__)
24 #endif // defined(WIN32) && defined(_DEBUG)
25
26 #define RESIPROCATE_SUBSYSTEM Subsystem::DUM
27
28 using namespace resip;
29 using namespace std;
30
31 Dialog::Dialog(DialogUsageManager& dum, const SipMessage& msg, DialogSet& ds)
32 : mDum(dum),
33 mDialogSet(ds),
34 mId("INVALID", "INVALID", "INVALID"),
35 mClientSubscriptions(),
36 mServerSubscriptions(),
37 mInviteSession(0),
38 mType(Fake),
39 mRouteSet(),
40 mLocalContact(),
41 mLocalCSeq(0),
42 mRemoteCSeq(0),
43 mRemoteTarget(),
44 mLocalNameAddr(),
45 mRemoteNameAddr(),
46 mCallId(msg.header(h_CallID)),
47 mDestroying(false)
48 {
49 assert(msg.isExternal());
50
51
52 if (msg.isRequest()) // UAS
53 {
54 const SipMessage& request = msg;
55
56 switch (request.header(h_CSeq).method())
57 {
58 case INVITE:
59 mType = Invitation;
60 break;
61
62 case SUBSCRIBE:
63 case REFER:
64 case NOTIFY:
65 //!dcm! -- event header check
66 mType = Subscription;
67 break;
68
69 default:
70 mType = Fake;
71 }
72 if (request.exists(h_RecordRoutes))
73 {
74 mRouteSet = request.header(h_RecordRoutes); // !jf! is this right order
75 }
76
77 switch (request.header(h_CSeq).method())
78 {
79 case INVITE:
80 case SUBSCRIBE:
81 case REFER:
82 DebugLog ( << "UAS dialog ID creation, DS: " << ds.getId());
83 mId = DialogId(ds.getId(), request.header(h_From).param(p_tag));
84 mRemoteNameAddr = request.header(h_From);
85 mLocalNameAddr = request.header(h_To);
86 mLocalNameAddr.param(p_tag) = mId.getLocalTag();
87 if (request.exists(h_Contacts) && request.header(h_Contacts).size() == 1)
88 {
89 const NameAddr& contact = request.header(h_Contacts).front();
90 if (isEqualNoCase(contact.uri().scheme(), Symbols::Sips) ||
91 isEqualNoCase(contact.uri().scheme(), Symbols::Sip))
92 {
93 mLocalContact = NameAddr(request.header(h_RequestLine).uri()); // update later when send a request
94 mRemoteTarget = contact;
95 }
96 else
97 {
98 InfoLog(<< "Got an INVITE or SUBSCRIBE with invalid scheme");
99 DebugLog(<< request);
100 throw Exception("Invalid scheme in request", __FILE__, __LINE__);
101 }
102 }
103 else
104 {
105 InfoLog (<< "Got an INVITE or SUBSCRIBE that doesn't have exactly one contact");
106 DebugLog (<< request);
107 throw Exception("Too many (or no contact) contacts in request", __FILE__, __LINE__);
108 }
109 break;
110 default:
111 break;
112 }
113
114 mRemoteCSeq = request.header(h_CSeq).sequence();
115 mLocalCSeq = 1;
116
117 DebugLog ( << "************** Created Dialog as UAS **************" );
118 DebugLog ( << "mRemoteNameAddr: " << mRemoteNameAddr );
119 DebugLog ( << "mLocalNameAddr: " << mLocalNameAddr );
120 DebugLog ( << "mLocalContact: " << mLocalContact );
121 DebugLog ( << "mRemoteTarget: " << mRemoteTarget );
122 }
123 else if (msg.isResponse())
124 {
125 mId = DialogId(msg);
126 const SipMessage& response = msg;
127 mRemoteNameAddr = response.header(h_To);
128 mLocalNameAddr = response.header(h_From);
129
130 switch (msg.header(h_CSeq).method())
131 {
132 case INVITE:
133 mType = Invitation;
134 break;
135
136 case SUBSCRIBE:
137 case REFER:
138 mType = Subscription;
139 break;
140
141 default:
142 mType = Fake;
143 }
144
145 if (response.exists(h_RecordRoutes))
146 {
147 mRouteSet = response.header(h_RecordRoutes).reverse();
148 }
149
150 switch (response.header(h_CSeq).method())
151 {
152 case INVITE:
153 case SUBSCRIBE:
154 case REFER:
155 if (response.header(h_StatusLine).statusCode() > 100 &&
156 response.header(h_StatusLine).statusCode() < 300)
157 {
158
159 if (response.exists(h_Contacts) && response.header(h_Contacts).size() == 1)
160 {
161 const NameAddr& contact = response.header(h_Contacts).front();
162 if (isEqualNoCase(contact.uri().scheme(), Symbols::Sips) ||
163 isEqualNoCase(contact.uri().scheme(), Symbols::Sip))
164 {
165 BaseCreator* creator = mDum.findCreator(mId);
166 assert(creator);// !jf! throw or something here
167
168 mLocalContact = creator->getLastRequest().header(h_Contacts).front();
169 mRemoteTarget = contact;
170 }
171 else
172 {
173 InfoLog (<< "Got an INVITE or SUBSCRIBE with invalid scheme");
174 DebugLog (<< response);
175 throw Exception("Bad scheme in contact in response", __FILE__, __LINE__);
176 }
177 }
178 else
179 {
180 InfoLog (<< "Got an INVITE or SUBSCRIBE that doesn't have exactly one contact");
181 DebugLog (<< response);
182 throw Exception("Too many contacts (or no contact) in response", __FILE__, __LINE__);
183 }
184 break;
185 default:
186 break;
187 }
188 }
189
190 mLocalCSeq = response.header(h_CSeq).sequence();
191 mRemoteCSeq = 0;
192 DebugLog ( << "************** Created Dialog as UAC **************" );
193 DebugLog ( << "mRemoteNameAddr: " << mRemoteNameAddr );
194 DebugLog ( << "mLocalNameAddr: " << mLocalNameAddr );
195 DebugLog ( << "mLocalContact: " << mLocalContact );
196 DebugLog ( << "mRemoteTarget: " << mRemoteTarget );
197
198
199 }
200 mDialogSet.addDialog(this);
201 DebugLog ( <<"Dialog::Dialog " << mId);
202 }
203
204 Dialog::~Dialog()
205 {
206 DebugLog ( <<"Dialog::~Dialog() ");
207
208 mDestroying = true;
209
210 while (!mClientSubscriptions.empty())
211 {
212 delete *mClientSubscriptions.begin();
213 }
214
215 while (!mServerSubscriptions.empty())
216 {
217 delete *mServerSubscriptions.begin();
218 }
219
220 delete mInviteSession;
221
222 mDialogSet.mDialogs.erase(this->getId());
223 delete mAppDialog;
224 mDialogSet.possiblyDie();
225 }
226
227 DialogId
228 Dialog::getId() const
229 {
230 return mId;
231 }
232
233 void
234 Dialog::cancel()
235 {
236 if (mInviteSession)
237 {
238 mInviteSession->send(mInviteSession->end());
239 }
240 else
241 {
242 if (mDialogSet.getCreator())
243 {
244 SipMessage& request = mDialogSet.getCreator()->getLastRequest();
245 if (request.header(h_RequestLine).method() == INVITE)
246 {
247 makeCancel(request);
248 mDum.send(request);
249 delete this;
250 }
251 else
252 {
253 throw new UsageUseException("Can only CANCEL an INVITE", __FILE__, __LINE__);
254 }
255 }
256 else
257 {
258 throw new UsageUseException("Attempting to cancel UAS dialogSet", __FILE__, __LINE__);
259 }
260 }
261 }
262
263 void
264 Dialog::dispatch(const SipMessage& msg)
265 {
266 DebugLog ( << "Dialog::dispatch: " << msg.brief());
267 if (msg.isRequest())
268 {
269 const SipMessage& request = msg;
270 switch (request.header(h_CSeq).method())
271 {
272 case INVITE: // new INVITE
273 if (mInviteSession == 0)
274 {
275 DebugLog ( << "Dialog::dispatch -- Created new server invite session" << msg.brief());
276 mInviteSession = makeServerInviteSession(request);
277 }
278 mInviteSession->dispatch(request);
279 break;
280 case BYE:
281 if (mInviteSession == 0)
282 {
283 InfoLog ( << "Spurious BYE" );
284 return;
285 }
286 else
287 {
288 mInviteSession->dispatch(request);
289 }
290 break;
291 case ACK:
292 case CANCEL:
293 if (mInviteSession == 0)
294 {
295 InfoLog (<< "Drop stray ACK or CANCEL in dialog on the floor");
296 DebugLog (<< request);
297 }
298 else
299 {
300 mInviteSession->dispatch(request);
301 }
302 break;
303 case SUBSCRIBE:
304 {
305 ServerSubscription* server = findMatchingServerSub(request);
306 if (server)
307 {
308 server->dispatch(request);
309 }
310 else
311 {
312 if (request.header(h_Event).value() == "refer")
313 {
314 InfoLog (<< "Received a subscribe to a non-existent refer subscription: " << request.brief());
315 SipMessage failure;
316 makeResponse(failure, request, 403);
317 mDum.sendResponse(failure);
318 return;
319 }
320 else
321 {
322 server = makeServerSubscription(request);
323 mServerSubscriptions.push_back(server);
324 server->dispatch(request);
325 }
326 }
327 mDum.mInviteSessionHandler->onRefer(mInviteSession->getSessionHandle(), server->getHandle(), msg);
328 }
329 break;
330 case REFER:
331 {
332 if (mInviteSession == 0)
333 {
334 InfoLog (<< "Received an in dialog refer in a non-invite dialog: " << request.brief());
335 SipMessage failure;
336 makeResponse(failure, request, 405);
337 mDum.sendResponse(failure);
338 return;
339 }
340 else if (!request.exists(h_ReferTo))
341 {
342 InfoLog (<< "Received refer w/out a Refer-To: " << request.brief());
343 SipMessage failure;
344 makeResponse(failure, request, 400);
345 mDum.sendResponse(failure);
346 return;
347 }
348 else
349 {
350 ServerSubscription* server = findMatchingServerSub(request);
351 if (server)
352 {
353 server->dispatch(request);
354 }
355 else
356 {
357 server = makeServerSubscription(request);
358 mServerSubscriptions.push_back(server);
359 server->dispatch(request);
360 }
361 mDum.mInviteSessionHandler->onRefer(mInviteSession->getSessionHandle(), server->getHandle(), msg);
362 }
363 }
364 break;
365 case NOTIFY:
366 {
367 ClientSubscription* client = findMatchingClientSub(request);
368 if (client)
369 {
370 client->dispatch(request);
371 }
372 else
373 {
374 BaseCreator* creator = mDum.findCreator(mId);
375 if (creator)
376 {
377 ClientSubscription* sub = makeClientSubscription(request);
378 mClientSubscriptions.push_back(sub);
379 sub->dispatch(request);
380 }
381 else
382 {
383 SipMessage failure;
384 makeResponse(failure, request, 481);
385 mDum.sendResponse(failure);
386 return;
387 }
388 }
389 }
390 break;
391 default:
392 assert(0);
393 return;
394 }
395 }
396 else if (msg.isResponse())
397 {
398 if (!mDialogSet.getCreator() ||
399 !(msg.header(h_CSeq).method() == mDialogSet.getCreator()->getLastRequest().header(h_RequestLine).method()))
400 {
401 SipMessage* lastRequest = 0;
402 switch (msg.header(h_CSeq).method())
403 {
404 case INVITE:
405 case CANCEL:
406 case REFER:
407 case BYE:
408 if (mInviteSession == 0)
409 {
410 //spurious
411 return;
412 }
413 else
414 {
415 lastRequest = &mInviteSession->mLastRequest;
416 }
417 break;
418 default:
419 break;
420 }
421 if ( lastRequest && mDum.mClientAuthManager->handle( *lastRequest, msg ) )
422 {
423 InfoLog( << "about to re-send request with digest credentials" );
424 InfoLog( << *lastRequest );
425
426 mDum.send(*lastRequest);
427 return;
428 }
429 }
430
431 const SipMessage& response = msg;
432 int code = response.header(h_StatusLine).statusCode();
433 if (code >=200 && code < 300)
434 {
435 if (response.exists(h_RecordRoutes))
436 {
437 mRouteSet = response.header(h_RecordRoutes).reverse();
438 }
439 }
440
441 // !jf! should this only be for 2xx responses? !jf! Propose no as an
442 // answer !dcm! what is he on?
443 switch (response.header(h_CSeq).method())
444 {
445 case INVITE:
446 if (mInviteSession == 0)
447 {
448 // #if!jf! don't think creator needs a dispatch
449 //BaseCreator* creator = mDum.findCreator(mId);
450 //assert (creator); // stray responses have been rejected already
451 //creator->dispatch(response);
452 // #endif!jf!
453 DebugLog ( << "Dialog::dispatch -- Created new client invite session" << msg.brief());
454
455 mInviteSession = makeClientInviteSession(response);
456 mInviteSession->dispatch(response);
457 }
458 else
459 {
460 mInviteSession->dispatch(response);
461 }
462 break;
463 case BYE:
464 case ACK:
465 case CANCEL:
466 if (mInviteSession != 0)
467 {
468 mInviteSession->dispatch(response);
469 }
470 // else drop on the floor
471 break;
472 case REFER:
473 {
474 int code = response.header(h_StatusLine).statusCode();
475 if (code < 300)
476 {
477 // throw it away
478 return;
479 }
480 else
481 {
482 if (mInviteSession && mDum.mInviteSessionHandler)
483 {
484 mDum.mInviteSessionHandler->onReferRejected(mInviteSession->getSessionHandle(), response);
485 }
486 }
487 }
488 break;
489 case SUBSCRIBE:
490 {
491 int code = response.header(h_StatusLine).statusCode();
492 if (code < 300)
493 {
494 // throw it away
495 return;
496 }
497 else
498 {
499 ClientSubscription* client = findMatchingClientSub(response);
500 if (client)
501 {
502 client->dispatch(response);
503 }
504 else
505 {
506 //!dcm! -- can't subscribe in an existing Dialog, this is all
507 //a bit of a hack.
508 BaseCreator* creator = mDialogSet.getCreator();
509 assert(creator);
510 assert(creator->getLastRequest().exists(h_Event));
511 ClientSubscriptionHandler* handler =
512 mDum.getClientSubscriptionHandler(creator->getLastRequest().header(h_Event).value());
513 assert(handler);
514 handler->onTerminated(ClientSubscriptionHandle::NotValid(), response);
515 possiblyDie();
516 }
517 }
518 }
519 break;
520 case NOTIFY:
521 {
522 //only dispatch if there is a matching server subscription. DUM does
523 //not handle responses to out-of-dialog NOTIFY messages
524 ServerSubscription* server = findMatchingServerSub(response);
525 if (server)
526 {
527 server->dispatch(response);
528 }
529 }
530 break;
531 default:
532 assert(0);
533 return;
534 }
535 }
536 }
537
538 ServerSubscription*
539 Dialog::findMatchingServerSub(const SipMessage& msg)
540 {
541 for (std::list<ServerSubscription*>::iterator i=mServerSubscriptions.begin();
542 i != mServerSubscriptions.end(); ++i)
543 {
544 if ((*i)->matches(msg))
545 {
546 return *i;
547 }
548 }
549 return 0;
550 }
551
552 ClientSubscription*
553 Dialog::findMatchingClientSub(const SipMessage& msg)
554 {
555 for (std::list<ClientSubscription*>::iterator i=mClientSubscriptions.begin();
556 i != mClientSubscriptions.end(); ++i)
557 {
558 if ((*i)->matches(msg))
559 {
560 return *i;
561 }
562 }
563 return 0;
564 }
565
566 InviteSessionHandle
567 Dialog::getInviteSession()
568 {
569 if (mInviteSession)
570 {
571 return mInviteSession->getSessionHandle();
572 }
573 else
574 {
575 return InviteSessionHandle::NotValid();
576 }
577 }
578
579 std::vector<ClientSubscriptionHandle>
580 Dialog::findClientSubscriptions(const Data& event)
581 {
582 std::vector<ClientSubscriptionHandle> handles;
583
584 for (std::list<ClientSubscription*>::const_iterator i = mClientSubscriptions.begin();
585 i != mClientSubscriptions.end(); ++i)
586 {
587 if ( (*i)->getEventType() == event)
588 {
589 handles.push_back((*i)->getHandle());
590 }
591 }
592 return handles;
593 }
594
595 std::vector<ServerSubscriptionHandle>
596 Dialog::findServerSubscriptions(const Data& event)
597 {
598 std::vector<ServerSubscriptionHandle> handles;
599
600 for (std::list<ServerSubscription*>::const_iterator i = mServerSubscriptions.begin();
601 i != mServerSubscriptions.end(); ++i)
602 {
603 if ( (*i)->getEventType() == event)
604 {
605 handles.push_back((*i)->getHandle());
606 }
607 }
608 return handles;
609 }
610
611
612 std::vector<ClientSubscriptionHandle>
613 Dialog::getClientSubscriptions()
614 {
615 std::vector<ClientSubscriptionHandle> handles;
616
617 for (std::list<ClientSubscription*>::const_iterator i = mClientSubscriptions.begin();
618 i != mClientSubscriptions.end(); ++i)
619 {
620 handles.push_back((*i)->getHandle());
621 }
622
623 return handles;
624 }
625
626 std::vector<ServerSubscriptionHandle>
627 Dialog::getServerSubscriptions()
628 {
629 std::vector<ServerSubscriptionHandle> handles;
630
631 for (std::list<ServerSubscription*>::const_iterator i = mServerSubscriptions.begin();
632 i != mServerSubscriptions.end(); ++i)
633 {
634 handles.push_back((*i)->getHandle());
635 }
636
637 return handles;
638 }
639
640
641 #if 0
642 void
643 Dialog::processNotify(const SipMessage& notify)
644 {
645 if (notify.isRequest())
646 {
647 if (findSubscriptions().empty())
648 {
649 SubscriptionCreator* creator = dynamic_cast<SubscriptionCreator*>(DialogSetId(notify).getCreator());
650 if (creator)
651 {
652 creator->makeNewSubscription(notify);
653 }
654 }
655 else
656 {
657 for (std::list<BaseUsage*>::iterator i=mUsages.begin(); i!=mUsages.end(); i++)
658 {
659 ClientSubscription* sub = dynamic_cast<ClientSubscription*>(*i);
660 if (sub && sub->matches(notify))
661 {
662 sub->process(notify);
663 break;
664 }
665 }
666 }
667 }
668 }
669 #endif
670
671
672 void
673 Dialog::makeRequest(SipMessage& request, MethodTypes method)
674 {
675 RequestLine rLine(method);
676
677 rLine.uri() = mRemoteTarget.uri();
678
679 request.header(h_RequestLine) = rLine;
680 request.header(h_To) = mRemoteNameAddr;
681 // request.header(h_To).param(p_tag) = mId.getRemoteTag();
682 request.header(h_From) = mLocalNameAddr;
683 // request.header(h_From).param(p_tag) = mId.getLocalTag();
684
685 request.header(h_CallId) = mCallId;
686
687 request.remove(h_RecordRoutes); //!dcm! -- all of this is rather messy
688
689 request.remove(h_Contacts);
690 request.header(h_Contacts).push_front(mLocalContact);
691 request.header(h_CSeq).method() = method;
692 request.header(h_MaxForwards).value() = 70;
693
694 //must keep old via for cancel
695 if (method != CANCEL)
696 {
697 request.header(h_Routes) = mRouteSet;
698 request.remove(h_Vias);
699 Via via;
700 via.param(p_branch); // will create the branch
701 request.header(h_Vias).push_front(via);
702 }
703 else
704 {
705 assert(request.exists(h_Vias));
706 }
707 //don't increment CSeq for ACK or CANCEL
708 if (method != ACK && method != CANCEL)
709 {
710 request.header(h_CSeq).sequence() = ++mLocalCSeq;
711 }
712 DebugLog ( << "Dialog::makeRequest: " << request );
713 }
714
715 void
716 Dialog::makeCancel(SipMessage& request)
717 {
718 //minimal for cancel
719 request.header(h_RequestLine).method() = CANCEL;
720 request.header(h_CSeq).method() = CANCEL;
721 request.remove(h_Requires);
722 request.remove(h_ProxyRequires);
723 assert(request.exists(h_Vias));
724
725 //not sure of these
726 request.header(h_To).remove(p_tag);
727 request.remove(h_RecordRoutes);
728 request.remove(h_Contacts);
729 request.header(h_Contacts).push_front(mLocalContact);
730 request.header(h_MaxForwards).value() = 70;
731 }
732
733 void
734 Dialog::makeResponse(SipMessage& response, const SipMessage& request, int code)
735 {
736 assert( code >= 100 );
737 response.remove(h_Contacts);
738 if (code < 300 && code > 100)
739 {
740 assert(request.isRequest());
741 assert(request.header(h_RequestLine).getMethod() == INVITE ||
742 request.header(h_RequestLine).getMethod() == SUBSCRIBE ||
743 request.header(h_RequestLine).getMethod() == BYE ||
744 request.header(h_RequestLine).getMethod() == CANCEL ||
745 request.header(h_RequestLine).getMethod() == REFER ||
746 request.header(h_RequestLine).getMethod() == MESSAGE ||
747 request.header(h_RequestLine).getMethod() == NOTIFY ||
748 request.header(h_RequestLine).getMethod() == OPTIONS
749 );
750
751 assert (request.header(h_RequestLine).getMethod() == CANCEL || // Contact header is not required for Requests that do not form a dialog
752 request.header(h_RequestLine).getMethod() == BYE ||
753 request.header(h_Contacts).size() == 1);
754 Helper::makeResponse(response, request, code, mLocalContact);
755 response.header(h_To).param(p_tag) = mId.getLocalTag();
756 }
757 else
758 {
759 Helper::makeResponse(response, request, code, mLocalContact);
760 response.header(h_To).param(p_tag) = mId.getLocalTag();
761
762 }
763 DebugLog ( << "Dialog::makeResponse: " << response);
764 }
765
766
767 ClientInviteSession*
768 Dialog::makeClientInviteSession(const SipMessage& response)
769 {
770 InviteSessionCreator* creator = dynamic_cast<InviteSessionCreator*>(mDialogSet.getCreator());
771 assert(creator); // !jf! this maybe can assert by evil UAS
772 //return mDum.createAppClientInviteSession(*this, *creator);
773 return new ClientInviteSession(mDum, *this, creator->getLastRequest(),
774 creator->getInitialOffer(), creator->getServerSubscription());
775 }
776
777
778
779 ClientSubscription*
780 Dialog::makeClientSubscription(const SipMessage& request)
781 {
782 return new ClientSubscription(mDum, *this, request);
783 }
784
785
786 ServerInviteSession*
787 Dialog::makeServerInviteSession(const SipMessage& request)
788 {
789 return new ServerInviteSession(mDum, *this, request);
790 }
791
792 ServerSubscription*
793 Dialog::makeServerSubscription(const SipMessage& request)
794 {
795 return new ServerSubscription(mDum, *this, request);
796 }
797
798 Dialog::Exception::Exception(const Data& msg, const Data& file, int line)
799 : BaseException(msg, file, line)
800 {
801 }
802
803 void
804 Dialog::update(const SipMessage& msg)
805 {
806 }
807
808 #if 0
809 void
810 Dialog::setLocalContact(const NameAddr& localContact)
811 {
812 mLocalContact = localContact;
813 }
814
815 void
816 Dialog::setRemoteTarget(const NameAddr& remoteTarget)
817 {
818 mRemoteTarget = remoteTarget;
819 }
820 #endif
821
822 void Dialog::possiblyDie()
823 {
824 if (!mDestroying)
825 {
826 if (mClientSubscriptions.empty() &&
827 mServerSubscriptions.empty() &&
828 !mInviteSession)
829 {
830 delete this;
831 }
832 }
833 }
834
835 ostream&
836 resip::operator<<(ostream& strm, const Dialog& dialog)
837 {
838
839 return strm;
840 }
841

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27