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

Contents of /main/sip/resiprocate/dum/Dialog.cxx

Parent Directory Parent Directory | Revision Log Revision Log


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

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27