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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2891 - (hide annotations) (download)
Sun May 30 22:00:59 2004 UTC (15 years, 6 months ago) by jason
Original Path: main/sip/resiprocate/dum/Dialog.cxx
File size: 20423 byte(s)
handle cancel from DUM

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

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27