#include <sippdu.h>
Public Types | |
| ExternalURI | |
| URI used anywhere outside of protocol. | |
| RequestURI | |
| Request-URI (after the INVITE). | |
| ToURI | |
| To header field. | |
| FromURI | |
| From header field. | |
| ContactURI | |
| Registration or Redirection Contact header field. | |
| RouteURI | |
| Dialog Contact header field, or Record-Route header field. | |
| RegisterURI | |
| URI on REGISTER request line. | |
| enum | UsageContext { ExternalURI, RequestURI, ToURI, FromURI, ContactURI, RouteURI, RegisterURI } |
Public Member Functions | |
| SIPURL () | |
| SIPURL (const char *cstr, const char *defaultScheme=NULL) | |
| SIPURL (const PString &str, const char *defaultScheme=NULL) | |
| SIPURL (const PString &name, const OpalTransportAddress &address, WORD listenerPort=0) | |
| SIPURL (const OpalTransportAddress &_address, WORD listenerPort=0) | |
| virtual Comparison | Compare (const PObject &obj) const |
| PString | AsQuotedString () const |
| PString | GetDisplayName (PBoolean useDefault=true) const |
| void | SetDisplayName (const PString &str) |
| PString | GetFieldParameters () const |
| void | SetFieldParameters (const PString &str) |
| OpalTransportAddress | GetHostAddress () const |
| void | Sanitise (UsageContext context) |
| PBoolean | AdjustToDNS (PINDEX entry=0) |
| void | SetTag (const PString &tag=GenerateTag()) |
| Set a tag with a new unique ID. | |
Static Public Member Functions | |
| static PString | GenerateTag () |
| Generate a unique string suitable as a dialog tag. | |
Protected Member Functions | |
| void | ParseAsAddress (const PString &name, const OpalTransportAddress &_address, WORD listenerPort=0) |
| virtual PBoolean | InternalParse (const char *cstr, const char *defaultScheme) |
Protected Attributes | |
| PString | displayName |
| PString | fieldParameters |
| enum SIPURL::UsageContext |
| SIPURL::SIPURL | ( | ) |
| SIPURL::SIPURL | ( | const char * | cstr, | |
| const char * | defaultScheme = NULL | |||
| ) |
str goes straight to Parse()
| cstr | C string representation of the URL. |
| defaultScheme | Default scheme for URL |
| SIPURL::SIPURL | ( | const PString & | str, | |
| const char * | defaultScheme = NULL | |||
| ) |
str goes straight to Parse()
| str | String representation of the URL. |
| defaultScheme | Default scheme for URL |
| SIPURL::SIPURL | ( | const PString & | name, | |
| const OpalTransportAddress & | address, | |||
| WORD | listenerPort = 0 | |||
| ) |
If name does not start with 'sip' then construct URI in the form
sip:name@host:port;transport=transport
where host comes from address, port is listenerPort or port from address if that was 0 transport is udp unless address specified tcp Send name starting with 'sip' or constructed URI to Parse()
| SIPURL::SIPURL | ( | const OpalTransportAddress & | _address, | |
| WORD | listenerPort = 0 | |||
| ) |
| PBoolean SIPURL::AdjustToDNS | ( | PINDEX | entry = 0 |
) |
This will adjust the current URL according to RFC3263, using DNS SRV records.
| entry | Entry in the SRV record to adjust to |
| PString SIPURL::AsQuotedString | ( | ) | const |
Returns complete SIPURL as one string, including displayname (in quotes) and address in angle brackets.
| virtual Comparison SIPURL::Compare | ( | const PObject & | obj | ) | const [virtual] |
Compare the two SIPURLs and return their relative rank. Note that does an intelligent comparison according to the rules in RFC3261 Section 19.1.4.
LessThan, EqualTo or GreaterThan according to the relative rank of the objects. | obj | Object to compare against. |
| static PString SIPURL::GenerateTag | ( | ) | [static] |
Generate a unique string suitable as a dialog tag.
| PString SIPURL::GetDisplayName | ( | PBoolean | useDefault = true |
) | const |
Returns display name only
| PString SIPURL::GetFieldParameters | ( | ) | const [inline] |
Returns the field parameter (outside of <>)
| OpalTransportAddress SIPURL::GetHostAddress | ( | ) | const |
Get the host and port as a transport address.
| virtual PBoolean SIPURL::InternalParse | ( | const char * | cstr, | |
| const char * | defaultScheme | |||
| ) | [protected, virtual] |
Parses name-addr, like:
"displayname"<scheme:user:password@host:port;transport=type>;tag=value
into:
displayname (quotes around name are optional, all before '<' is used)
scheme
username
password
hostname
port
pathStr
path
paramVars
queryVars
fragment
Note that tag parameter outside of <> will be lost, but tag in URL without <> will be kept until Sanitise()
| void SIPURL::ParseAsAddress | ( | const PString & | name, | |
| const OpalTransportAddress & | _address, | |||
| WORD | listenerPort = 0 | |||
| ) | [protected] |
| void SIPURL::Sanitise | ( | UsageContext | context | ) |
Removes tag parm & query vars and recalculates urlString (scheme, user, password, host, port & URI parms (like transport)) which are not allowed in the context specified, e.g. Request-URI etc According to RFC3261, 19.1.1 Table 1
| context | Context for URI |
| void SIPURL::SetDisplayName | ( | const PString & | str | ) | [inline] |
| void SIPURL::SetFieldParameters | ( | const PString & | str | ) | [inline] |
Returns the field parameter (outside of <>)
| void SIPURL::SetTag | ( | const PString & | tag = GenerateTag() |
) |
Set a tag with a new unique ID.
PString SIPURL::displayName [protected] |
PString SIPURL::fieldParameters [protected] |
1.4.7