Handle IdentityAddress with sips scheme.

This commit is contained in:
Ghislain MARY 2017-11-20 16:47:36 +01:00
parent e1122d15f5
commit 76c4e7ed25
4 changed files with 14 additions and 2 deletions

View file

@ -48,7 +48,7 @@ Address::Address (const Address &src) : ClonableObject(*new AddressPrivate) {
Address::Address (const IdentityAddress &src) : ClonableObject(*new AddressPrivate) {
L_D();
string uri = "sip:" + src.getUsername() + "@";
string uri = src.getScheme() + ":" + src.getUsername() + "@";
if (src.getDomain().find(':') != string::npos)
uri += "[" + src.getDomain() + "]";
else

View file

@ -29,6 +29,7 @@ LINPHONE_BEGIN_NAMESPACE
class IdentityAddressPrivate : public ClonableObjectPrivate {
private:
std::string scheme;
std::string username;
std::string domain;
std::string gruu;

View file

@ -34,7 +34,8 @@ LINPHONE_BEGIN_NAMESPACE
IdentityAddress::IdentityAddress (const string &address) : ClonableObject(*new IdentityAddressPrivate) {
L_D();
Address tmpAddress(address);
if (tmpAddress.isValid() && (tmpAddress.getScheme() == "sip")) {
if (tmpAddress.isValid() && ((tmpAddress.getScheme() == "sip") || (tmpAddress.getScheme() == "sips"))) {
d->scheme = tmpAddress.getScheme();
d->username = tmpAddress.getUsername();
d->domain = tmpAddress.getDomain();
if (tmpAddress.hasUriParam("gr")) {
@ -45,6 +46,7 @@ IdentityAddress::IdentityAddress (const string &address) : ClonableObject(*new I
IdentityAddress::IdentityAddress (const IdentityAddress &src) : ClonableObject(*new IdentityAddressPrivate) {
L_D();
d->scheme = src.getScheme();
d->username = src.getUsername();
d->domain = src.getDomain();
d->gruu = src.getGruu();
@ -52,6 +54,7 @@ IdentityAddress::IdentityAddress (const IdentityAddress &src) : ClonableObject(*
IdentityAddress::IdentityAddress (const Address &src) : ClonableObject(*new IdentityAddressPrivate) {
L_D();
d->scheme = src.getScheme();
d->username = src.getUsername();
d->domain = src.getDomain();
if (src.hasUriParam("gr")) {
@ -62,6 +65,7 @@ IdentityAddress::IdentityAddress (const Address &src) : ClonableObject(*new Iden
IdentityAddress &IdentityAddress::operator= (const IdentityAddress &src) {
L_D();
if (this != &src) {
d->scheme = src.getScheme();
d->username = src.getUsername();
d->domain = src.getDomain();
d->gruu = src.getGruu();
@ -86,6 +90,11 @@ bool IdentityAddress::isValid () const {
return tmpAddress.isValid();
}
const string &IdentityAddress::getScheme () const {
L_D();
return d->scheme;
}
const string &IdentityAddress::getUsername () const {
L_D();
return d->username;

View file

@ -45,6 +45,8 @@ public:
bool isValid () const;
const std::string &getScheme () const;
const std::string &getUsername () const;
bool setUsername (const std::string &username);