/[resiprocate]/main/resip/dum/Profile.hxx
ViewVC logotype

Annotation of /main/resip/dum/Profile.hxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3233 - (hide annotations) (download)
Fri Aug 6 18:52:18 2004 UTC (15 years, 4 months ago) by derek
Original Path: main/sip/resiprocate/dum/Profile.hxx
File size: 4313 byte(s)
added pager model MESSAGE
some fixes to OutOfDialogReq(still architecturally a bit odd)
added use rport option

1 fluffy 2502 #if !defined(RESIP_PROFILE_HXX)
2     #define RESIP_PROFILE_HXX
3 fluffy 2490
4 jason 2941 #include <iosfwd>
5 jason 2727 #include <set>
6 davidb 2595 #include "resiprocate/Headers.hxx"
7 jason 2727 #include "resiprocate/MethodTypes.hxx"
8 davidb 2595
9 fluffy 2502 namespace resip
10     {
11 fluffy 2490
12 jason 2514 class Data;
13    
14 jason 2727 // !jf! will want to provide a default subclass of Profile that provides some
15     // good defaults for the Profile
16 fluffy 2486 class Profile
17     {
18 fluffy 2876 public:
19    
20 derek 2910 struct DigestCredential
21     {
22     DigestCredential();
23 jason 3150 DigestCredential(const Data& aor, const Data& realm, const Data& username, const Data& password);
24     Data aor;
25 derek 2910 Data realm;
26     Data user;
27     Data password;
28    
29     bool operator<(const DigestCredential& rhs) const;
30     };
31    
32 jason 2727 Profile();
33    
34 jason 3150 void setDefaultFrom(const NameAddr& from);
35 jason 2727 void setDefaultRegistrationTime(int secs);
36    
37     void addSupportedScheme(const Data& scheme);
38     void addSupportedMethod(const MethodTypes& method);
39     void addSupportedOptionTags(const Token& tag);
40     void addSupportedMimeType(const Mime& mimeType);
41     void addSupportedEncoding(const Token& encoding);
42     void addSupportedLanguage(const Token& lang);
43    
44 jason 3150 NameAddr& getDefaultFrom();
45 jason 2727 int getDefaultRegistrationTime();
46 fluffy 2840 int getDefaultSubscriptionTime();
47 jason 2727
48 jason 2514 bool isSchemeSupported(const Data& scheme);
49     bool isMethodSupported(MethodTypes method);
50     bool isMimeTypeSupported(const Mime& mimeType);
51 jason 2526 bool isContentEncodingSupported(const Token& contentEncoding);
52     bool isLanguageSupported(const Tokens& lang);
53 jason 2514
54     // return the list of unsupported tokens from set of requires tokens
55 davidb 2595 Tokens isSupported(const Tokens& requires);
56 jason 2553 Tokens getSupportedOptionTags();
57 jason 2514 Tokens getAllowedMethods();
58     Mimes getSupportedMimeTypes();
59 jason 2526 Tokens getSupportedEncodings();
60     Tokens getSupportedLanguages();
61 jason 2514
62 jason 2621 void addGruu(const Data& aor, const NameAddr& contact);
63 jason 2611 bool hasGruu(const Data& aor);
64 jason 2621 bool hasGruu(const Data& aor, const Data& instance);
65 jason 2611 NameAddr& getGruu(const Data& aor);
66     NameAddr& getGruu(const Data& aor, const NameAddr& contact);
67    
68 jason 2871 void setOutboundProxy( const Uri& uri );
69     const NameAddr& getOutboundProxy() const;
70     bool hasOutboundProxy() const;
71    
72 jason 2558 void disableGruu();
73 fluffy 2501
74     /// The following functions deal with getting digest credentals
75     //@{
76    
77 jason 3150 void addDigestCredential( const Data& aor, const Data& realm, const Data& user, const Data& password);
78 fluffy 2490
79 fluffy 2501 /** This class is used as a callback to get digest crednetials. The
80     * derived class must define one of computeA1 or getPaswword. computeA1 is
81     * tried first and it it returns an empty string, then getPassword is
82     * tried. */
83 fluffy 2490 class DigestCredentialHandler
84     {
85     public:
86 fluffy 2501 virtual Data computeA1( const Data& realm, const Data& users );
87     virtual Data getPassword( const Data& realm, const Data& users );
88 fluffy 2490 };
89    
90     void setDigestHandler( DigestCredentialHandler* handler );
91 fluffy 2501 //@}
92 jason 2611
93 fluffy 2870 DigestCredentialHandler* getDigestHandler();
94 fluffy 2876 const DigestCredential& getDigestCredential( const Data& realm );
95 derek 2983 const DigestCredential& getDigestCredential( const SipMessage& challenge );
96    
97 derek 3155 //defaults to false, turn on for VONAGE
98     bool& looseToTagMatching();
99     const bool looseToTagMatching() const;
100    
101 derek 3233 //enable/disable rport for requests. rport is enabled by feault
102     bool& rportEnabled();
103     const bool rportEnabled() const;
104    
105 fluffy 2490 private:
106 jason 3150 NameAddr mDefaultFrom;
107 jason 2727 int mDefaultRegistrationExpires;
108 jason 2871
109     bool mHasOutboundProxy;
110     NameAddr mOutboundProxy;
111 jason 2727
112     std::set<Data> mSupportedSchemes;
113     std::set<MethodTypes> mSupportedMethodTypes;
114     Tokens mSupportedMethods;
115     Tokens mSupportedOptionTags;
116     Mimes mSupportedMimeTypes;
117     Tokens mSupportedEncodings;
118     Tokens mSupportedLanguages;
119 fluffy 2870
120     DigestCredentialHandler* mDigestCredentialHandler;
121 derek 3155
122     bool mLooseToTagMatching;
123 derek 3233 bool mRportEnabled;
124 fluffy 2870
125 derek 3233
126 fluffy 2870 typedef std::set<DigestCredential> DigestCredentials;
127     DigestCredentials mDigestCredentials;
128 fluffy 2486 };
129    
130 jason 3164 std::ostream&
131     operator<<(std::ostream&, const Profile::DigestCredential& cred);
132 fluffy 2502
133     }
134    
135     #endif

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27