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