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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27