reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
Helper.hxx
Go to the documentation of this file.
1#if !defined(RESIP_HELPER_HXX)
2#define RESIP_HELPER_HXX
3
4#include <time.h>
5#include <vector>
6
9#include "resip/stack/Uri.hxx"
12#include "rutil/Data.hxx"
17
18namespace resip
19{
20
21class SipMessage;
22class NameAddr;
23class SecurityAttributes;
24class Security;
25
26
37class Helper
38{
39 public:
40
42 const static int tagSize;
43
52 template<typename T>
53 static T aBitSmallerThan(T secs)
54 {
55 return resipMax(T(0), resipMin(T(secs-5), T(9*secs/10)));
56 }
57
72 static void integer2hex(char* _d, unsigned int _s, bool _l = true);
73
83 static unsigned int hex2integer(const char* _s);
84
99 static int jitterValue(int input, int lowerPercentage, int upperPercentage, int minimum=0);
100
101
107
130 static SipMessage* makeRequest(const NameAddr& target, const NameAddr& from, const NameAddr& contact, MethodTypes method);
131
149 static SipMessage* makeRequest(const NameAddr& target, const NameAddr& from, MethodTypes method);
150
152 static SipMessage* makeRegister(const NameAddr& to, const NameAddr& from);
153
155 static SipMessage* makeRegister(const NameAddr& to, const NameAddr& from, const NameAddr& contact);
156
158 static SipMessage* makeRegister(const NameAddr& to, const Data& transport);
159
161 static SipMessage* makeRegister(const NameAddr& to, const Data& transport, const NameAddr& contact);
162
171 static SipMessage* makeInvite(const NameAddr& target, const NameAddr& from);
172
184 static SipMessage* makeInvite(const NameAddr& target, const NameAddr& from, const NameAddr& contact);
185
194 static SipMessage* makeCancel(const SipMessage& request);
195
211 static SipMessage* makeFailureAck(const SipMessage& request, const SipMessage& response);
212
214 static SipMessage* makePublish(const NameAddr& target, const NameAddr& from);
215
217 static SipMessage* makePublish(const NameAddr& target, const NameAddr& from, const NameAddr& contact);
218
220 static SipMessage* makeMessage(const NameAddr& target, const NameAddr& from);
221
223 static SipMessage* makeMessage(const NameAddr& target, const NameAddr& from, const NameAddr& contact);
224
226 static SipMessage* makeSubscribe(const NameAddr& target, const NameAddr& from);
227
229 static SipMessage* makeSubscribe(const NameAddr& target, const NameAddr& from, const NameAddr& contact);
230
251 static void makeResponse(SipMessage& response,
252 const SipMessage& request,
253 int responseCode,
254 const Data& reason = Data::Empty,
255 const Data& hostname = Data::Empty,
256 const Data& warning=Data::Empty);
257
280 static void makeResponse(SipMessage& response,
281 const SipMessage& request,
282 int responseCode,
283 const NameAddr& myContact,
284 const Data& reason = Data::Empty,
285 const Data& hostname = Data::Empty,
286 const Data& warning=Data::Empty);
287
310 static SipMessage* makeResponse(const SipMessage& request,
311 int responseCode,
312 const Data& reason = Data::Empty,
313 const Data& hostname = Data::Empty,
314 const Data& warning=Data::Empty);
315
340 static SipMessage* makeResponse(const SipMessage& request,
341 int responseCode,
342 const NameAddr& myContact,
343 const Data& reason = Data::Empty,
344 const Data& hostname = Data::Empty,
345 const Data& warning=Data::Empty);
346
347 static void makeRawResponse(Data& rawBuffer,
348 const SipMessage& request,
349 int responseCode,
350 const Data& additionalHeaders=Data::Empty,
351 const Data& body=Data::Empty);
352
372 static SipMessage* make405(const SipMessage& request,
373 const int* allowedMethods = 0,
374 int nMethods = -1);
375
384 static void getResponseCodeReason(int responseCode, Data& reason);
385
392 static Data computeUniqueBranch();
393
394 static Data computeCallId();
395 static Data computeTag(int numBytes);
396
397
403
405 static void setNonceHelper(NonceHelper* nonceHelper);
406 static NonceHelper* getNonceHelper();
407 static Data makeNonce(const SipMessage& request, const Data& timestamp);
408
409 // returns true if the digest scheme is supported, and sets digestType
410 static bool isDigestAlgorithmSupported(const Auth& auth, DigestType& digestType);
411 static bool isDigestAlgorithmSupported(const Data& algorithmName, DigestType& digestType);
412
413 // Create a custom A1 string (applicable for password storage, that supports multiple digest algorithms)
414 // Format: [<algorithm_name>]<hex_encoded_A1_hash>[<algorithm2_name>]<hex_encoded_A1_hash2>....
415 // Example: [MD5]5f4dcc3b5aa765d61d8327deb882cf99[SHA-256]6bb4837eb74329105ee4568dda7dc67ed2ca2ad9e59fcbfbcde5e7f8c1b6d9d1
416 // For backward compatibility, if no algorithm name is found, MD5 is assumed.
417 static Data createResipA1HashString(const Data& username,
418 const Data& realm,
419 const Data& password);
420 // Extract the algorithm specific A1 hash from a custom resip A1 hash string. Returns empty string if hash
421 // algorithm not found in string.
422 static Data extractA1FromResipA1HashString(const Data& resipA1HashString, DigestType digestType);
423 static bool isDigestTypeSupportedInResipA1HashString(const Data& resipA1HashString, DigestType digestType);
424
426 static AuthResult authenticateRequest(const SipMessage& request,
427 const Data& realm,
428 const Data& password,
429 int expiresDelta = 0);
430
431 static AuthResult authenticateRequestWithA1(const SipMessage& request,
432 const Data& realm,
433 const Data& resipPasswordHashA1,
434 int expiresDelta = 0);
435
436 static AuthResult authenticateRequest(const SipMessage& request,
437 const Data& realm,
438 const Data& passwordOrResipPasswordHashA1,
439 int expiresDelta,
440 bool isPasswordHashResipA1);
441
442 // Only looks a Proxy-Authorization or Authorization header based on proxyAuthorization flag
443 // Returns username in std::pair second if authentication is successful
444 static std::pair<AuthResult, Data> advancedAuthenticateRequest(const SipMessage& request,
445 const Data& realm,
446 const Data& resipPasswordHashA1,
447 int expiresDelta = 0,
448 bool proxyAuthorization = true);
449
450 // create a 407 response with Proxy-Authenticate header filled in
451 static SipMessage* makeProxyChallenge(const SipMessage& request,
452 const Data& realm,
453 bool useAuth = true,
454 bool stale = false,
455 const std::vector<DigestType>& digestTypes = std::vector<DigestType>());
456
457 // create a 401 response with WWW-Authenticate header filled in
458 static SipMessage* makeWWWChallenge(const SipMessage& request,
459 const Data& realm,
460 bool useAuth = true,
461 bool stale = false,
462 const std::vector<DigestType>& digestTypes = std::vector<DigestType>());
463
464 // create a 401 or 407 response with Proxy-Authenticate or Authenticate header
465 // filled in
466 static SipMessage* makeChallenge(const SipMessage& request,
467 const Data& realm,
468 bool useAuth = true,
469 bool stale = false,
470 bool proxy = false,
471 const std::vector<DigestType>& digestTypes = std::vector<DigestType>());
472
473 // add an additional Proxy-Authenticate or WWW-Authenticate header to an existing response
474 static void addChallenge(SipMessage& response,
475 const SipMessage& request,
476 const Data& realm,
477 bool useAuth = true,
478 bool stale = false,
479 bool proxy = false,
480 DigestType digestType = MD5);
481
482 static Data qopOption(const Auth& challenge);
483 static void updateNonceCount(unsigned int& nonceCount, Data& nonceCountString);
484
485 //Used by clients to determine if they can respond to a given challenge
486 static bool algorithmAndQopSupported(const Auth& challenge);
487 static bool algorithmAndQopSupported(const Auth& challenge, DigestType& digestType);
488
489 // adds authorization headers in reponse to the 401 or 407
490 static SipMessage& addAuthorization(SipMessage& request,
491 const SipMessage& challenge,
492 const Data& username,
493 const Data& password,
494 const Data& cnonce,
495 unsigned int& nonceCount);
496
497 static Auth makeChallengeResponseAuth(const SipMessage& request,
498 const Data& username,
499 const Data& password,
500 const Auth& challenge,
501 const Data& cnonce,
502 unsigned int& nonceCount,
503 Data& nonceCountString);
504
505 static void makeChallengeResponseAuth(const SipMessage& request,
506 const Data& username,
507 const Data& password,
508 const Auth& challenge,
509 const Data& cnonce,
510 const Data& authQop,
511 const Data& nonceCountString,
512 Auth& auth);
513
514 static Auth makeChallengeResponseAuthWithA1(const SipMessage& request,
515 const Data& username,
516 const Data& resipPasswordHashA1,
517 const Auth& challenge,
518 const Data& cnonce,
519 unsigned int& nonceCount,
520 Data& nonceCountString);
521
522 static void makeChallengeResponseAuthWithA1(const SipMessage& request,
523 const Data& username,
524 const Data& resipPasswordHashA1,
525 const Auth& challenge,
526 const Data& cnonce,
527 const Data& authQop,
528 const Data& nonceCountString,
529 Auth& auth);
530
531 // Backwards compatiblity (legacy API)
533 const Data& method, const Data& digestUri, const Data& nonce,
534 const Data& qop = Data::Empty, const Data& cnonce = Data::Empty,
535 const Data& cnonceCount = Data::Empty, const Contents *entityBody = 0)
536 {
537 return makeResponseDigestWithA1(a1, method, digestUri, nonce, qop, cnonce, cnonceCount, entityBody, MD5);
538 }
539
540 static Data makeResponseDigestWithA1(const Data& a1,
541 const Data& method, const Data& digestUri, const Data& nonce,
542 const Data& qop = Data::Empty, const Data& cnonce = Data::Empty,
543 const Data& cnonceCount = Data::Empty, const Contents* entityBody = 0,
544 DigestType digestType = MD5);
545
546 // Backwards compatiblity (legacy API)
547 static Data makeResponseMD5(const Data& username, const Data& password, const Data& realm,
548 const Data& method, const Data& digestUri, const Data& nonce,
549 const Data& qop = Data::Empty, const Data& cnonce = Data::Empty,
550 const Data& cnonceCount = Data::Empty, const Contents *entityBody = 0)
551 {
552 return makeResponseDigest(username, password, realm, method, digestUri, nonce, qop, cnonce, cnonceCount, entityBody, MD5);
553 }
554
555 static Data makeResponseDigest(const Data& username, const Data& password, const Data& realm,
556 const Data& method, const Data& digestUri, const Data& nonce,
557 const Data& qop = Data::Empty, const Data& cnonce = Data::Empty,
558 const Data& cnonceCount = Data::Empty, const Contents *entityBody = 0,
559 DigestType digestType = MD5);
560
561
567
568 static Uri makeUri(const Data& aor, const Data& scheme=Symbols::DefaultSipScheme);
569
570 static void processStrictRoute(SipMessage& request);
571
572 // return the port that the response should be sent to using rules from
573 // RFC 3261 - 18.2.2
574 static int getPortForReply(SipMessage& request);
575
576 static void massageRoute(const SipMessage& request, NameAddr& route);
577
578 static Uri fromAor(const Data& aor, const Data& scheme=Symbols::DefaultSipScheme);
579
580 // Do basic checks to validate a received message off the wire
581 // If the basic check fails, and reason is non-null, reason will be set
582 // to the reason the check failed. This function does not take ownership
583 // of reason.
584 static bool validateMessage(const SipMessage& message,resip::Data* reason=0);
585
586 // GRUU support -- reversibly and opaquely combine instance id and aor
587 static Data gruuUserPart(const Data& instanceId,
588 const Data& aor,
589 const Data& key);
590
591 // GRUU support -- extract instance id and aor from user portion
592 static std::pair<Data,Data> fromGruuUserPart(const Data& gruuUserPart,
593 const Data& key);
594
596 {
597 ContentsSecAttrs() = default;
598 ContentsSecAttrs(std::unique_ptr<Contents> contents,
599 std::unique_ptr<SecurityAttributes> attributes);
602 ~ContentsSecAttrs() = default;
603
606
607 mutable std::unique_ptr<Contents> mContents;
608 mutable std::unique_ptr<SecurityAttributes> mAttributes;
609 };
610
611 static ContentsSecAttrs extractFromPkcs7(const SipMessage& message, Security& security);
612
613
616
618 const std::set<int>* additionalTransactionTerminatingResponses = NULL);
619
620 static SdpContents* getSdpRecurse(Contents* tree);
621
622 // Just simply walk the contents tree and return acopy of the first SdpContents in
623 // the tree.
624 static std::unique_ptr<SdpContents> getSdp(Contents* tree);
625
638 static bool isClientBehindNAT(const SipMessage& request, bool privateToPublicOnly=true);
639
648 static Tuple getClientPublicAddress(const SipMessage& request);
649
650 private:
651 class NonceHelperPtr
652 {
653 public:
654 NonceHelperPtr() : mNonceHelper(0) {}
655 ~NonceHelperPtr() { delete mNonceHelper; }
656 NonceHelper *mNonceHelper;
657 };
658 static NonceHelperPtr mNonceHelperPtr;
659};
660
661}
662
663#endif
664
665/* ====================================================================
666 * The Vovida Software License, Version 1.0
667 *
668 * Copyright (c) 2026 SIP Spectrum, Inc. https://www.sipspectrum.com
669 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
670 *
671 * Redistribution and use in source and binary forms, with or without
672 * modification, are permitted provided that the following conditions
673 * are met:
674 *
675 * 1. Redistributions of source code must retain the above copyright
676 * notice, this list of conditions and the following disclaimer.
677 *
678 * 2. Redistributions in binary form must reproduce the above copyright
679 * notice, this list of conditions and the following disclaimer in
680 * the documentation and/or other materials provided with the
681 * distribution.
682 *
683 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
684 * and "Vovida Open Communication Application Library (VOCAL)" must
685 * not be used to endorse or promote products derived from this
686 * software without prior written permission. For written
687 * permission, please contact vocal@vovida.org.
688 *
689 * 4. Products derived from this software may not be called "VOCAL", nor
690 * may "VOCAL" appear in their name, without prior written
691 * permission of Vovida Networks, Inc.
692 *
693 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
694 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
695 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
696 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
697 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
698 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
699 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
700 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
701 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
702 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
703 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
704 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
705 * DAMAGE.
706 *
707 * ====================================================================
708 *
709 * This software consists of voluntary contributions made by Vovida
710 * Networks, Inc. and many individuals on behalf of Vovida Networks,
711 * Inc. For more information on Vovida Networks, Inc., please see
712 * <http://www.vovida.org/>.
713 *
714 */
Represents the "credentials" and "challenge" elements in the SIP grammar.
Definition Auth.hxx:18
Base class for all SIP body types.
Definition Contents.hxx:51
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
An aggregation of useful static functions.
Definition Helper.hxx:38
static Auth makeChallengeResponseAuthWithA1(const SipMessage &request, const Data &username, const Data &resipPasswordHashA1, const Auth &challenge, const Data &cnonce, unsigned int &nonceCount, Data &nonceCountString)
Definition Helper.cxx:1506
static SipMessage * makeChallenge(const SipMessage &request, const Data &realm, bool useAuth=true, bool stale=false, bool proxy=false, const std::vector< DigestType > &digestTypes=std::vector< DigestType >())
Definition Helper.cxx:1224
static Uri makeUri(const Data &aor, const Data &scheme=Symbols::DefaultSipScheme)
///////////////////////////////////////////////////////////////////////////////////////////
Definition Helper.cxx:1687
static SdpContents * getSdpRecurse(Contents *tree)
Definition Helper.cxx:2238
static AuthResult authenticateRequestWithA1(const SipMessage &request, const Data &realm, const Data &resipPasswordHashA1, int expiresDelta=0)
Definition Helper.cxx:884
static Uri fromAor(const Data &aor, const Data &scheme=Symbols::DefaultSipScheme)
Definition Helper.cxx:1785
static Data makeResponseDigestWithA1(const Data &a1, const Data &method, const Data &digestUri, const Data &nonce, const Data &qop=Data::Empty, const Data &cnonce=Data::Empty, const Data &cnonceCount=Data::Empty, const Contents *entityBody=0, DigestType digestType=MD5)
Definition Helper.cxx:1593
static void updateNonceCount(unsigned int &nonceCount, Data &nonceCountString)
Definition Helper.cxx:1325
static Data extractA1FromResipA1HashString(const Data &resipA1HashString, DigestType digestType)
Definition Helper.cxx:822
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 Data gruuUserPart(const Data &instanceId, const Data &aor, const Data &key)
Definition Helper.cxx:1866
static bool validateMessage(const SipMessage &message, resip::Data *reason=0)
Definition Helper.cxx:1791
static bool isClientBehindNAT(const SipMessage &request, bool privateToPublicOnly=true)
Looks at SIP headers and message source for a mismatch to make an assumption that the sender is behin...
Definition Helper.cxx:2357
static bool algorithmAndQopSupported(const Auth &challenge)
Definition Helper.cxx:1347
static void getResponseCodeReason(int responseCode, Data &reason)
Returns the default reason string for a particular response code.
Definition Helper.cxx:610
static NonceHelper * getNonceHelper()
Definition Helper.cxx:725
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 T aBitSmallerThan(T secs)
Used by Registration, Publication and Subscription refreshes, to calculate the time at which a refres...
Definition Helper.hxx:53
static Data makeResponseMD5(const Data &username, const Data &password, const Data &realm, const Data &method, const Data &digestUri, const Data &nonce, const Data &qop=Data::Empty, const Data &cnonce=Data::Empty, const Data &cnonceCount=Data::Empty, const Contents *entityBody=0)
Definition Helper.hxx:547
static void processStrictRoute(SipMessage &request)
Definition Helper.cxx:1701
static std::pair< Data, Data > fromGruuUserPart(const Data &gruuUserPart, const Data &key)
Definition Helper.cxx:1955
static SipMessage & addAuthorization(SipMessage &request, const SipMessage &challenge, const Data &username, const Data &password, const Data &cnonce, unsigned int &nonceCount)
Definition Helper.cxx:1368
static Data createResipA1HashString(const Data &username, const Data &realm, const Data &password)
Definition Helper.cxx:783
static void setNonceHelper(NonceHelper *nonceHelper)
///////////////////////////////////////////////////////////////////////////////////////////
Definition Helper.cxx:719
static void massageRoute(const SipMessage &request, NameAddr &route)
Definition Helper.cxx:1719
static SipMessage * makeProxyChallenge(const SipMessage &request, const Data &realm, bool useAuth=true, bool stale=false, const std::vector< DigestType > &digestTypes=std::vector< DigestType >())
Definition Helper.cxx:1212
static SipMessage * makeMessage(const NameAddr &target, const NameAddr &from)
Create a Message request with an empty Contact. See makeRequest.
Definition Helper.cxx:352
static unsigned int hex2integer(const char *_s)
Converts a character string containing a hexidecimal value into an unsigned int.
Definition Helper.cxx:92
static Data computeTag(int numBytes)
Definition Helper.cxx:713
static std::unique_ptr< SdpContents > getSdp(Contents *tree)
Definition Helper.cxx:2339
static Data qopOption(const Auth &challenge)
Definition Helper.cxx:1284
static SipMessage * makeCancel(const SipMessage &request)
Make a new Cancel request for the specified request.
Definition Helper.cxx:261
static void addChallenge(SipMessage &response, const SipMessage &request, const Data &realm, bool useAuth=true, bool stale=false, bool proxy=false, DigestType digestType=MD5)
Definition Helper.cxx:1250
static int getPortForReply(SipMessage &request)
Definition Helper.cxx:1741
static bool isDigestTypeSupportedInResipA1HashString(const Data &resipA1HashString, DigestType digestType)
Definition Helper.cxx:856
static SipMessage * make405(const SipMessage &request, const int *allowedMethods=0, int nMethods=-1)
Make a 405 response to a provided request.
Definition Helper.cxx:573
static ContentsSecAttrs extractFromPkcs7(const SipMessage &message, Security &security)
Definition Helper.cxx:2124
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
@ TransactionTermination
Definition Helper.hxx:614
@ ApplicationDependant
Definition Helper.hxx:615
static Tuple getClientPublicAddress(const SipMessage &request)
Look at Via headers, and find the first public IP address closest to the sending client.
Definition Helper.cxx:2400
static int jitterValue(int input, int lowerPercentage, int upperPercentage, int minimum=0)
Used to jitter the expires in a SUBSCRIBE or REGISTER expires header.
Definition Helper.cxx:123
static void makeRawResponse(Data &rawBuffer, const SipMessage &request, int responseCode, const Data &additionalHeaders=Data::Empty, const Data &body=Data::Empty)
Definition Helper.cxx:549
static void integer2hex(char *_d, unsigned int _s, bool _l=true)
Converts an interger in a character string containing the hexidecimal representation of the integer.
Definition Helper.cxx:52
static SipMessage * makeWWWChallenge(const SipMessage &request, const Data &realm, bool useAuth=true, bool stale=false, const std::vector< DigestType > &digestTypes=std::vector< DigestType >())
Definition Helper.cxx:1218
static SipMessage * makeRequest(const NameAddr &target, const NameAddr &from, const NameAddr &contact, MethodTypes method)
///////////////////////////////////////////////////////////////////////////////////////////
Definition Helper.cxx:142
static AuthResult authenticateRequest(const SipMessage &request, const Data &realm, const Data &password, int expiresDelta=0)
Definition Helper.cxx:875
static std::pair< AuthResult, Data > advancedAuthenticateRequest(const SipMessage &request, const Data &realm, const Data &resipPasswordHashA1, int expiresDelta=0, bool proxyAuthorization=true)
Definition Helper.cxx:1071
static Data makeResponseDigest(const Data &username, const Data &password, const Data &realm, const Data &method, const Data &digestUri, const Data &nonce, const Data &qop=Data::Empty, const Data &cnonce=Data::Empty, const Data &cnonceCount=Data::Empty, const Contents *entityBody=0, DigestType digestType=MD5)
Definition Helper.cxx:1670
static FailureMessageEffect determineFailureMessageEffect(const SipMessage &response, const std::set< int > *additionalTransactionTerminatingResponses=NULL)
Definition Helper.cxx:2151
static bool isDigestAlgorithmSupported(const Auth &auth, DigestType &digestType)
Definition Helper.cxx:742
static Data computeUniqueBranch()
Creates and returns a unique branch parameter.
Definition Helper.cxx:679
static SipMessage * makeFailureAck(const SipMessage &request, const SipMessage &response)
This interface should be used by the stack (TransactionState) to create an AckMsg to a failure respon...
Definition Helper.cxx:296
static Auth makeChallengeResponseAuth(const SipMessage &request, const Data &username, const Data &password, const Auth &challenge, const Data &cnonce, unsigned int &nonceCount, Data &nonceCountString)
Definition Helper.cxx:1415
static Data makeNonce(const SipMessage &request, const Data &timestamp)
Definition Helper.cxx:736
static SipMessage * makeSubscribe(const NameAddr &target, const NameAddr &from)
Create a Subscribe request with an empty Contact. See makeRequest.
Definition Helper.cxx:382
static Data makeResponseMD5WithA1(const Data &a1, const Data &method, const Data &digestUri, const Data &nonce, const Data &qop=Data::Empty, const Data &cnonce=Data::Empty, const Data &cnonceCount=Data::Empty, const Contents *entityBody=0)
Definition Helper.hxx:532
static Data computeCallId()
Definition Helper.cxx:690
Represents the "name-addr" and the "addr-spec" elements in the RFC 3261 grammar.
Definition NameAddr.hxx:19
Provides an interface to process and generate SDP bodies (MIME content-type application/sdp).
Represents a SIP message.
static const char * DefaultSipScheme
Definition Symbols.hxx:12
Represents a network address.
Definition Tuple.hxx:59
Represents the "SIP-URI" and "SIPS-URI" elements in the RFC 3261 grammar.
Definition Uri.hxx:22
dcm! – add UnusedChecking(_enum) below;
const _Tp & resipMin(const _Tp &__a, const _Tp &__b)
Definition compat.hxx:182
const _Tp & resipMax(const _Tp &__a, const _Tp &__b)
Definition compat.hxx:194
std::unique_ptr< Contents > mContents
Definition Helper.hxx:607
ContentsSecAttrs & operator=(ContentsSecAttrs &&)=default
ContentsSecAttrs(const ContentsSecAttrs &)=delete
ContentsSecAttrs & operator=(const ContentsSecAttrs &)=delete
std::unique_ptr< SecurityAttributes > mAttributes
Definition Helper.hxx:608
ContentsSecAttrs(ContentsSecAttrs &&)=default