/[resiprocate]/branches/b-identity-0505/DeprecatedDialog.cxx
ViewVC logotype

Contents of /branches/b-identity-0505/DeprecatedDialog.cxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4598 - (show annotations) (download)
Wed May 11 22:53:07 2005 UTC (14 years, 6 months ago) by derek
File size: 23157 byte(s)
set svn:eol-style to LF
1 #if defined(HAVE_CONFIG_H)
2 #include "resiprocate/config.hxx"
3 #endif
4
5 #include <iostream>
6 #include "resiprocate/DeprecatedDialog.hxx"
7 #include "resiprocate/SipMessage.hxx"
8 #include "resiprocate/Uri.hxx"
9 #include "resiprocate/NameAddr.hxx"
10 #include "resiprocate/Helper.hxx"
11 #include "resiprocate/os/Logger.hxx"
12 #include "resiprocate/os/Inserter.hxx"
13 #include "resiprocate/os/WinLeakCheck.hxx"
14
15 using namespace resip;
16
17 #define RESIPROCATE_SUBSYSTEM Subsystem::SIP
18
19
20 DeprecatedDialog::DeprecatedDialog(const NameAddr& localContact)
21 : mContact(localContact),
22 mCreated(false),
23 mEarly(false),
24 mRouteSet(),
25 mRemoteTarget(),
26 mRemoteSequence(0),
27 mRemoteEmpty(true),
28 mLocalSequence(0),
29 mLocalEmpty(true),
30 mCallId(),
31 mLocalTag(),
32 mRemoteTag(),
33 mRemoteUri(),
34 mLocalUri()
35 {
36 }
37
38 SipMessage*
39 DeprecatedDialog::makeResponse(const SipMessage& request, int code)
40 {
41 assert( code >= 100 );
42
43 if ( (!mCreated) && (code < 300) && (code > 100) )
44 {
45 assert (code > 100);
46 assert (code < 300);
47 assert(request.isRequest());
48 assert(request.header(h_RequestLine).getMethod() == INVITE ||
49 request.header(h_RequestLine).getMethod() == SUBSCRIBE);
50
51 assert (request.header(h_Contacts).size() == 1);
52
53 SipMessage* response = Helper::makeResponse(request, code, mContact);
54 if (request.exists(h_RecordRoutes))
55 {
56 mRouteSet = request.header(h_RecordRoutes);
57 }
58
59 if (!request.exists(h_Contacts) && request.header(h_Contacts).size() != 1)
60 {
61 InfoLog (<< "Request doesn't have a contact header or more than one contact, so can't create dialog");
62 DebugLog (<< request);
63 throw Exception("Invalid or missing contact header in request", __FILE__,__LINE__);
64 }
65
66 mRemoteTarget = request.header(h_Contacts).front();
67 mRemoteSequence = request.header(h_CSeq).sequence();
68 mRemoteEmpty = false;
69 mLocalSequence = 0;
70 mLocalEmpty = true;
71 mCallId = request.header(h_CallId);
72 response->header(h_To).param(p_tag) = Helper::computeTag(Helper::tagSize);
73 assert (response->header(h_To).exists(p_tag));
74 mLocalTag = response->header(h_To).param(p_tag); // from response
75 if (request.header(h_From).exists(p_tag)) // 2543 compat
76 {
77 mRemoteTag = request.header(h_From).param(p_tag);
78 }
79
80 mRemoteUri = request.header(h_From);
81 mLocalUri = request.header(h_To);
82
83 mDialogId = mCallId;
84 mDialogId.param(p_toTag) = mLocalTag;
85 mDialogId.param(p_fromTag) = mRemoteTag;
86
87 mEarly = (code < 200);
88 mCreated = true;
89
90 return response;
91 }
92 else
93 {
94 SipMessage* response = Helper::makeResponse(request, code, mContact);
95 if (mCreated)
96 {
97 response->header(h_To).param(p_tag) = mLocalTag;
98 }
99 //DebugLog(<< "Created response within dialog: " << *response);
100 return response;
101 }
102 }
103
104
105 void
106 DeprecatedDialog::createDialogAsUAC(const SipMessage& msg)
107 {
108 if (!mCreated)
109 {
110 if(msg.isResponse())
111 {
112 const SipMessage& response = msg;
113
114 int code = response.header(h_StatusLine).statusCode();
115 mEarly = (code > 100 && code < 200);
116
117 if (code >= 200 && code < 300)
118 {
119 if (!response.exists(h_Contacts) || response.header(h_Contacts).size() != 1)
120 {
121 InfoLog (<< "Response doesn't have a contact header or more than one contact, so can't create dialog");
122 DebugLog (<< response);
123 throw Exception("Invalid or missing contact header in message", __FILE__,__LINE__);
124 }
125 }
126
127 // reverse order from response
128 if (response.exists(h_RecordRoutes))
129 {
130 mRouteSet = response.header(h_RecordRoutes).reverse();
131 }
132
133 if (response.exists(h_Contacts) && !response.header(h_Contacts).empty())
134 {
135 mRemoteTarget = response.header(h_Contacts).front();
136 }
137
138 mRemoteSequence = 0;
139 mRemoteEmpty = true;
140 mLocalSequence = response.header(h_CSeq).sequence();
141 mLocalEmpty = false;
142 mCallId = response.header(h_CallId);
143 if ( response.header(h_From).exists(p_tag) ) // 2543 compat
144 {
145 mLocalTag = response.header(h_From).param(p_tag);
146 }
147 if ( response.header(h_To).exists(p_tag) ) // 2543 compat
148 {
149 mRemoteTag = response.header(h_To).param(p_tag);
150 }
151 mRemoteUri = response.header(h_To);
152 mLocalUri = response.header(h_From);
153
154 mDialogId = mCallId;
155 mDialogId.param(p_toTag) = mLocalTag;
156 mDialogId.param(p_fromTag) = mRemoteTag;
157
158 mCreated = true;
159 }
160 else if (msg.isRequest() && msg.header(h_CSeq).method() == NOTIFY)
161 {
162 const SipMessage& notify = msg;
163 if (notify.exists(h_RecordRoutes))
164 {
165 mRouteSet = notify.header(h_RecordRoutes);
166 }
167
168 if (!notify.exists(h_Contacts) && notify.header(h_Contacts).size() != 1)
169 {
170 InfoLog (<< "Notify doesn't have a contact header or more than one contact, so can't create dialog");
171 DebugLog (<< notify);
172 throw Exception("Invalid or missing contact header in notify", __FILE__,__LINE__);
173 }
174
175 mRemoteTarget = notify.header(h_Contacts).front();
176 mRemoteSequence = notify.header(h_CSeq).sequence();
177 mRemoteEmpty = false;
178 mLocalSequence = 0;
179 mLocalEmpty = true;
180 mCallId = notify.header(h_CallId);
181 if (notify.header(h_To).exists(p_tag))
182 {
183 mLocalTag = notify.header(h_To).param(p_tag);
184 }
185 if (notify.header(h_From).exists(p_tag)) // 2543 compat
186 {
187 mRemoteTag = notify.header(h_From).param(p_tag);
188 }
189
190 mRemoteUri = notify.header(h_From);
191 mLocalUri = notify.header(h_To);
192
193 mDialogId = mCallId;
194 mDialogId.param(p_toTag) = mLocalTag;
195 mDialogId.param(p_fromTag) = mRemoteTag;
196
197 mCreated = true;
198 mEarly = false;
199 }
200 }
201 else if (msg.isResponse())
202 {
203 mEarly = (msg.header(h_StatusLine).statusCode() < 200 &&
204 msg.header(h_StatusLine).statusCode() > 100);
205
206 // don't update target for register since contact is not a target
207 if ( msg.header(h_CSeq).method() != REGISTER )
208 {
209 targetRefreshResponse(msg);
210 }
211 }
212 }
213
214 void
215 DeprecatedDialog::targetRefreshResponse(const SipMessage& response)
216 {
217 if (response.exists(h_Contacts) && response.header(h_Contacts).size() == 1)
218 {
219 mRemoteTarget = response.header(h_Contacts).front();
220 }
221 }
222
223 int
224 DeprecatedDialog::targetRefreshRequest(const SipMessage& request)
225 {
226 assert (request.header(h_RequestLine).getMethod() != CANCEL);
227 if (request.header(h_RequestLine).getMethod() != ACK)
228 {
229 unsigned long cseq = request.header(h_CSeq).sequence();
230
231 if (mRemoteEmpty)
232 {
233 mRemoteSequence = cseq;
234 mRemoteEmpty = false;
235 }
236 else if (cseq < mRemoteSequence)
237 {
238 InfoLog (<< "Got a cseq out of sequence: " << cseq << " < " << mRemoteSequence);
239 throw Exception("out of order", __FILE__,__LINE__);
240 }
241 else
242 {
243 mRemoteSequence = cseq;
244 }
245
246 if (request.exists(h_Contacts) && request.header(h_Contacts).size() == 1)
247 {
248 mRemoteTarget = request.header(h_Contacts).front();
249 }
250 else
251 {
252 InfoLog (<< "Request doesn't have a contact header or more than one contact, so can't create dialog");
253 DebugLog (<< request);
254 throw Exception("Invalid or missing contact header in message", __FILE__,__LINE__);
255 }
256 }
257
258 return 0;
259 }
260
261 void
262 DeprecatedDialog::updateRequest(SipMessage& request)
263 {
264 assert (request.isRequest());
265 if (mCreated)
266 {
267 request.header(h_RequestLine).uri() = mRemoteTarget.uri();
268 request.header(h_To) = mRemoteUri;
269 if ( !mRemoteTag.empty() )
270 {
271 request.header(h_To).param(p_tag) = mRemoteTag;
272 }
273 request.header(h_From) = mLocalUri;
274 if ( !mLocalTag.empty() )
275 {
276 request.header(h_From).param(p_tag) = mLocalTag;
277 }
278 request.header(h_CallId) = mCallId;
279 request.header(h_Routes) = mRouteSet;
280 request.header(h_Contacts).clear();
281 request.header(h_Contacts).push_back(mContact);
282 copyCSeq(request);
283 incrementCSeq(request);
284
285 request.header(h_MaxForwards).value() = 70;
286
287 Via via;
288 via.param(p_branch); // will create the branch
289 request.header(h_Vias).clear();
290 request.header(h_Vias).push_back(via);
291
292 request.clearForceTarget();
293 Helper::processStrictRoute(request);
294 }
295 else
296 {
297 DebugLog (<< "Updating a request when not in a dialog yet");
298 }
299 }
300
301 void
302 DeprecatedDialog::makeResponse(const SipMessage& request, SipMessage& response, int code)
303 {
304 assert(request.isRequest());
305 if ( (!mCreated) && (code < 300) && (code > 100) )
306 {
307 assert(request.header(h_RequestLine).getMethod() == INVITE ||
308 request.header(h_RequestLine).getMethod() == SUBSCRIBE);
309 assert (request.header(h_Contacts).size() == 1);
310
311 Helper::makeResponse(response, request, code, mContact);
312 response.header(h_To).param(p_tag) = Helper::computeTag(Helper::tagSize);
313
314 if (request.exists(h_RecordRoutes))
315 {
316 mRouteSet = request.header(h_RecordRoutes);
317 }
318
319 if (!request.exists(h_Contacts) && request.header(h_Contacts).size() != 1)
320 {
321 InfoLog (<< "Request doesn't have a contact header or more than one contact, so can't create dialog");
322 DebugLog (<< request);
323 throw Exception("Invalid or missing contact header in request", __FILE__,__LINE__);
324 }
325
326 mRemoteTarget = request.header(h_Contacts).front();
327 mRemoteSequence = request.header(h_CSeq).sequence();
328 mRemoteEmpty = false;
329 mLocalSequence = 0;
330 mLocalEmpty = true;
331 mCallId = request.header(h_CallId);
332 assert (response.header(h_To).exists(p_tag));
333 mLocalTag = response.header(h_To).param(p_tag); // from response
334 if (request.header(h_From).exists(p_tag)) // 2543 compat
335 {
336 mRemoteTag = request.header(h_From).param(p_tag);
337 }
338
339 mRemoteUri = request.header(h_From);
340 mLocalUri = request.header(h_To);
341
342 mDialogId = mCallId;
343 mDialogId.param(p_toTag) = mLocalTag;
344 mDialogId.param(p_fromTag) = mRemoteTag;
345
346 mEarly = (code > 100 && code < 200);
347
348 mCreated = true;
349 }
350 else
351 {
352 Helper::makeResponse(response, request, code, mContact);
353 if (mCreated)
354 {
355 response.header(h_To).param(p_tag) = mLocalTag;
356 mEarly = false;
357 }
358 }
359 }
360
361
362 SipMessage*
363 DeprecatedDialog::makeInitialRegister(const NameAddr& registrar, const NameAddr& aor)
364 {
365 SipMessage* msg = Helper::makeRegister( registrar, aor, mContact );
366 assert( msg );
367
368 mRequestUri = msg->header(h_RequestLine).uri();
369 mLocalEmpty = false;
370 mLocalSequence = msg->header(h_CSeq).sequence();
371 mCallId = msg->header(h_CallId);
372 assert(msg->header(h_From).exists(p_tag));
373 mLocalTag = msg->header(h_From).param(p_tag);
374 mRemoteUri = msg->header(h_To);
375 mLocalUri = msg->header(h_From);
376 mCreated = true;
377
378 mRemoteTarget = mRemoteUri;
379
380 return msg;
381 }
382
383
384 SipMessage*
385 DeprecatedDialog::makeInitialSubscribe(const NameAddr& target, const NameAddr& from)
386 {
387 SipMessage* msg = Helper::makeSubscribe( target, from, mContact );
388 assert( msg );
389
390 mRequestUri = msg->header(h_RequestLine).uri();
391 mLocalEmpty = false;
392 mLocalSequence = msg->header(h_CSeq).sequence();
393 mCallId = msg->header(h_CallId);
394 assert(msg->header(h_From).exists(p_tag));
395 mLocalTag = msg->header(h_From).param(p_tag);
396 mRemoteUri = msg->header(h_To);
397 mLocalUri = msg->header(h_From);
398
399 return msg;
400 }
401
402
403 SipMessage*
404 DeprecatedDialog::makeInitialPublish(const NameAddr& target, const NameAddr& from)
405 {
406 SipMessage* msg = Helper::makePublish( target, from, mContact );
407 assert( msg );
408
409 mRequestUri = msg->header(h_RequestLine).uri();
410 mLocalEmpty = false;
411 mLocalSequence = msg->header(h_CSeq).sequence();
412 mCallId = msg->header(h_CallId);
413 assert(msg->header(h_From).exists(p_tag));
414 mLocalTag = msg->header(h_From).param(p_tag);
415 mRemoteUri = msg->header(h_To);
416 mLocalUri = msg->header(h_From);
417
418 return msg;
419 }
420
421
422 SipMessage*
423 DeprecatedDialog::makeInitialMessage(const NameAddr& target, const NameAddr& from)
424 {
425 SipMessage* msg = Helper::makeMessage( target, from, mContact );
426 assert( msg );
427
428 mRequestUri = msg->header(h_RequestLine).uri();
429 mLocalEmpty = false;
430 mLocalSequence = msg->header(h_CSeq).sequence();
431 mCallId = msg->header(h_CallId);
432 assert(msg->header(h_From).exists(p_tag));
433 mLocalTag = msg->header(h_From).param(p_tag);
434 mRemoteUri = msg->header(h_To);
435 mLocalUri = msg->header(h_From);
436
437 return msg;
438 }
439
440
441 SipMessage*
442 DeprecatedDialog::makeInitialInvite(const NameAddr& target, const NameAddr& from)
443 {
444 SipMessage* msg = Helper::makeInvite( target, from, mContact );
445 assert( msg );
446
447 mRequestUri = msg->header(h_RequestLine).uri();
448 mLocalEmpty = false;
449 mLocalSequence = msg->header(h_CSeq).sequence();
450 mCallId = msg->header(h_CallId);
451 assert(msg->header(h_From).exists(p_tag));
452 mLocalTag = msg->header(h_From).param(p_tag);
453 mRemoteUri = msg->header(h_To);
454 mLocalUri = msg->header(h_From);
455
456 return msg;
457 }
458
459
460 SipMessage*
461 DeprecatedDialog::makeInvite()
462 {
463 SipMessage* request = makeRequestInternal(INVITE);
464 incrementCSeq(*request);
465 DebugLog(<< "DeprecatedDialog::makeInvite: " << *request);
466 return request;
467 }
468
469
470 SipMessage*
471 DeprecatedDialog::makeRegister()
472 {
473 SipMessage* request = makeRequestInternal(REGISTER);
474 incrementCSeq(*request);
475 DebugLog(<< "DeprecatedDialog::makeRegister: " << *request);
476 return request;
477 }
478
479
480 SipMessage*
481 DeprecatedDialog::makeSubscribe()
482 {
483 SipMessage* request = makeRequestInternal(SUBSCRIBE);
484 incrementCSeq(*request);
485 DebugLog(<< "DeprecatedDialog::makeSubscribe: " << *request);
486 return request;
487 }
488
489 SipMessage*
490 DeprecatedDialog::makeBye()
491 {
492 SipMessage* request = makeRequestInternal(BYE);
493 incrementCSeq(*request);
494
495 return request;
496 }
497
498
499 SipMessage*
500 DeprecatedDialog::makeRefer(const NameAddr& referTo)
501 {
502 SipMessage* request = makeRequestInternal(REFER);
503 request->header(h_ReferTo) = referTo;
504 request->header(h_ReferredBy) = mLocalUri;
505 incrementCSeq(*request);
506 return request;
507 }
508
509 SipMessage*
510 DeprecatedDialog::makeNotify()
511 {
512 SipMessage* request = makeRequestInternal(NOTIFY);
513 incrementCSeq(*request);
514 return request;
515 }
516
517
518 SipMessage*
519 DeprecatedDialog::makeOptions()
520 {
521 SipMessage* request = makeRequestInternal(OPTIONS);
522 incrementCSeq(*request);
523 return request;
524 }
525
526 SipMessage*
527 DeprecatedDialog::makePublish()
528 {
529 SipMessage* request = makeRequestInternal(PUBLISH);
530 incrementCSeq(*request);
531 return request;
532 }
533
534 SipMessage*
535 DeprecatedDialog::makeRequest(resip::MethodTypes method)
536 {
537 assert(method != ACK);
538 assert(method != CANCEL);
539
540 SipMessage* request = makeRequestInternal(method);
541 incrementCSeq(*request);
542 return request;
543 }
544
545 SipMessage*
546 DeprecatedDialog::makeAck(const SipMessage& original)
547 {
548 SipMessage* request = makeRequestInternal(ACK);
549 copyCSeq(*request);
550
551 // !dcm! should we copy the authorizations?
552 // !jf! will this do the right thing if these headers weren't in original
553 // we should be able to store this stuff in the DeprecatedDialog and not need to pass
554 // in the original
555 if (original.exists(h_ProxyAuthorizations))
556 {
557 request->header(h_ProxyAuthorizations) = original.header(h_ProxyAuthorizations);
558 }
559 if (original.exists(h_Authorizations))
560 {
561 request->header(h_Authorizations) = original.header(h_Authorizations);
562 }
563 request->header(h_CSeq).sequence() = original.header(h_CSeq).sequence();
564 return request;
565 }
566
567 SipMessage*
568 DeprecatedDialog::makeAck()
569 {
570 SipMessage* request = makeRequestInternal(ACK);
571 copyCSeq(*request);
572 return request;
573 }
574
575 SipMessage*
576 DeprecatedDialog::makeCancel(const SipMessage& request)
577 {
578 assert (request.header(h_Vias).size() >= 1);
579 assert (request.header(h_RequestLine).getMethod() == INVITE);
580
581 SipMessage* cancel = new SipMessage;
582
583 cancel->header(h_RequestLine) = request.header(h_RequestLine);
584 cancel->header(h_RequestLine).method() = CANCEL;
585
586 cancel->header(h_CallId) = request.header(h_CallId);
587 cancel->header(h_To) = request.header(h_To);
588 cancel->header(h_From) = request.header(h_From);
589 cancel->header(h_CSeq) = request.header(h_CSeq);
590 cancel->header(h_CSeq).method() = CANCEL;
591 cancel->header(h_Vias).push_back(request.header(h_Vias).front());
592
593 return cancel;
594 }
595
596
597 CallId
598 DeprecatedDialog::makeReplaces()
599 {
600 return mDialogId;
601 }
602
603 void
604 DeprecatedDialog::clear()
605 {
606 mCreated = false;
607 mEarly = false;
608
609 mRouteSet.clear();
610 mRemoteTarget = NameAddr();
611 mRemoteSequence = 0;
612 mRemoteEmpty = true;
613 mLocalSequence = 0;
614 mLocalEmpty = true;
615 mCallId.value() = Data::Empty;
616 mLocalTag = Data::Empty;
617 mRemoteTag = Data::Empty;
618 mRemoteUri = NameAddr();
619 mLocalUri = NameAddr();
620 }
621
622 SipMessage*
623 DeprecatedDialog::makeRequestInternal(MethodTypes method)
624 {
625 SipMessage* request = new SipMessage;
626 RequestLine rLine(method);
627
628 if (!mCreated)
629 {
630 rLine.uri() = mRequestUri;
631 }
632 else
633 {
634 rLine.uri() = mRemoteTarget.uri();
635 }
636
637 request->header(h_RequestLine) = rLine;
638 request->header(h_To) = mRemoteUri;
639 if ( !mRemoteTag.empty() )
640 {
641 request->header(h_To).param(p_tag) = mRemoteTag;
642 }
643 request->header(h_From) = mLocalUri;
644 if ( !mLocalTag.empty() )
645 {
646 request->header(h_From).param(p_tag) = mLocalTag;
647 }
648 request->header(h_CallId) = mCallId;
649 request->header(h_Routes) = mRouteSet;
650 request->header(h_Contacts).push_back(mContact);
651 request->header(h_CSeq).method() = method;
652 copyCSeq(*request);
653 request->header(h_MaxForwards).value() = 70;
654
655 Via via;
656 via.param(p_branch); // will create the branch
657 request->header(h_Vias).push_front(via);
658
659 //DebugLog(<<"contact after copy: " << request->header(h_Contacts).front());
660 Helper::processStrictRoute(*request);
661 return request;
662 }
663
664 void
665 DeprecatedDialog::copyCSeq(SipMessage& request)
666 {
667 if (mLocalEmpty)
668 {
669 mLocalSequence = 1;
670 mLocalEmpty = false;
671 }
672 request.header(h_CSeq).sequence() = mLocalSequence;
673 }
674
675 void
676 DeprecatedDialog::incrementCSeq(SipMessage& request)
677 {
678 if (mLocalEmpty)
679 {
680 mLocalSequence = 1;
681 mLocalEmpty = false;
682 }
683 //DebugLog ( << "mLocalSequence: " << mLocalSequence);
684 request.header(h_CSeq).sequence() = ++mLocalSequence;
685 }
686
687 std::ostream&
688 resip::operator<<(std::ostream& strm, const DeprecatedDialog& d)
689 {
690 strm << "DeprecatedDialog: [" << d.dialogId()
691 << " created=" << d.mCreated
692 << ",remoteTarget=" << d.mRemoteTarget
693 // << "routeset=" << Inserter(d.mRouteSet) << std::endl
694 << ",remoteSeq=" << d.mRemoteSequence
695 << ",remote=" << d.mRemoteUri
696 << ",remoteTag=" << d.mRemoteTag
697 << ",localSeq=" << d.mLocalSequence
698 << ",local=" << d.mLocalUri
699 << ",localTag=" << d.mLocalTag
700 << "]";
701 return strm;
702 }
703
704 Data
705 DeprecatedDialog::dialogId(const SipMessage& msg)
706 {
707 CallID id(msg.header(h_CallId));
708 if (msg.isRequest() && msg.isExternal() ||
709 msg.isResponse() && !msg.isExternal())
710 {
711 if (msg.header(h_To).exists(p_tag))
712 {
713 id.param(p_toTag) = msg.header(h_To).param(p_tag);
714 }
715 if (msg.header(h_From).exists(p_tag))
716 {
717 id.param(p_fromTag) = msg.header(h_From).param(p_tag);
718 }
719 }
720 else
721 {
722 if (msg.header(h_From).exists(p_tag))
723 {
724 id.param(p_toTag) = msg.header(h_From).param(p_tag);
725 }
726 if (msg.header(h_To).exists(p_tag))
727 {
728 id.param(p_fromTag) = msg.header(h_To).param(p_tag);
729 }
730 }
731 return Data::from(id);
732 }
733
734
735 const Data
736 DeprecatedDialog::dialogId() const
737 {
738 return Data::from(mDialogId);
739 }
740
741
742 void
743 DeprecatedDialog::setExpirySeconds( int secondsInFuture )
744 {
745 expireyTimeAbsoluteMs = Timer::getTimeMs() + 1000*secondsInFuture;
746 }
747
748
749 int
750 DeprecatedDialog::getExpirySeconds()
751 {
752 // !cj! TODO - may be bugs here when result is negative
753 UInt64 delta = ( expireyTimeAbsoluteMs - Timer::getTimeMs() )/1000;
754
755 int ret = (int)delta;
756 return ret;
757 }
758
759
760
761 /* ====================================================================
762 * The Vovida Software License, Version 1.0
763 *
764 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
765 *
766 * Redistribution and use in source and binary forms, with or without
767 * modification, are permitted provided that the following conditions
768 * are met:
769 *
770 * 1. Redistributions of source code must retain the above copyright
771 * notice, this list of conditions and the following disclaimer.
772 *
773 * 2. Redistributions in binary form must reproduce the above copyright
774 * notice, this list of conditions and the following disclaimer in
775 * the documentation and/or other materials provided with the
776 * distribution.
777 *
778 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
779 * and "Vovida Open Communication Application Library (VOCAL)" must
780 * not be used to endorse or promote products derived from this
781 * software without prior written permission. For written
782 * permission, please contact vocal@vovida.org.
783 *
784 * 4. Products derived from this software may not be called "VOCAL", nor
785 * may "VOCAL" appear in their name, without prior written
786 * permission of Vovida Networks, Inc.
787 *
788 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
789 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
790 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
791 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
792 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
793 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
794 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
795 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
796 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
797 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
798 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
799 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
800 * DAMAGE.
801 *
802 * ====================================================================
803 *
804 * This software consists of voluntary contributions made by Vovida
805 * Networks, Inc. and many individuals on behalf of Vovida Networks,
806 * Inc. For more information on Vovida Networks, Inc., please see
807 * <http://www.vovida.org/>.
808 *
809 */

Properties

Name Value
svn:eol-style LF

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27