Commit e55c717e authored by Sylvain Berfini's avatar Sylvain Berfini

Replaced calls to SetContactParameters to SetContactUriParameters (and added...

Replaced calls to SetContactParameters to SetContactUriParameters (and added C++/CX wrapper for this method)
parent 6c36ec5e
......@@ -12,7 +12,7 @@ namespace Linphone.Agents
public class Customs
{
public const bool IsTunnelEnabled = false;
public const bool AddPasswordInContactsParams = false;
public const bool AddPasswordInUriContactsParams = false;
public const bool UseCustomIncomingCallView = false;
public const string PictureUploadScriptURL = "https://linphone.org:444/upload.php";
public const string UserAgent = "LinphoneWP8";
......
......@@ -201,6 +201,15 @@ int Linphone::Core::LinphoneProxyConfig::LookupCCCFromE164(Platform::String^ e16
return ccc;
}
void Linphone::Core::LinphoneProxyConfig::SetContactUriParameters(Platform::String^ params)
{
gApiLock.Lock();
const char* cc = Utils::pstoccs(params);
linphone_proxy_config_set_contact_uri_parameters(this->proxy_config, cc);
delete(cc);
gApiLock.Unlock();
}
Linphone::Core::LinphoneProxyConfig::LinphoneProxyConfig()
{
gApiLock.Lock();
......
......@@ -177,6 +177,14 @@ namespace Linphone
/// <returns>The international prefix or -1 if not found</returns>
int LookupCCCFromE164(Platform::String^ e164);
/// <summary>
/// Set optional contact parameters that will be added to the contact information sent in the registration, inside the URI.
/// The main use case for this function is provide the proxy additional information regarding the user agent, like for example unique identifier or apple push id.
/// As an example, the contact address in the SIP register sent will look like <sip:joe@15.128.128.93:50421;apple-push-id=43143-DFE23F-2323-FA2232>.
/// </summary>
/// <param name="params">a string contaning the additional parameters in text form, like "myparam=something;myparam2=something_else"</param>
void SetContactUriParameters(Platform::String^ params);
private:
friend ref class Linphone::Core::LinphoneCore;
friend class Linphone::Core::Utils;
......
......@@ -324,15 +324,15 @@ namespace Linphone.Model
return;
}
if (Customs.AddPasswordInContactsParams)
if (Customs.AddPasswordInUriContactsParams)
{
SIPAccountSettingsManager sip = new SIPAccountSettingsManager();
sip.Load();
server.LinphoneCore.GetDefaultProxyConfig().SetContactParameters("pwd=" + sip.Password + ";app-id=" + host + ";pn-type=wp;pn-tok=" + token);
server.LinphoneCore.GetDefaultProxyConfig().SetContactUriParameters("pwd=" + sip.Password + ";app-id=" + host + ";pn-type=wp;pn-tok=" + token);
}
else
{
server.LinphoneCore.GetDefaultProxyConfig().SetContactParameters("app-id=" + host + ";pn-type=wp;pn-tok=" + token);
server.LinphoneCore.GetDefaultProxyConfig().SetContactUriParameters("app-id=" + host + ";pn-type=wp;pn-tok=" + token);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment