mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-22 13:48:09 +00:00
more jni functions implemented
This commit is contained in:
parent
08ab87eaf8
commit
8f449aabbe
5 changed files with 34 additions and 6 deletions
|
|
@ -34,4 +34,9 @@ public interface LinphoneAddress {
|
|||
* @return null if not set
|
||||
*/
|
||||
public String getDomain();
|
||||
|
||||
/**
|
||||
* @return an URI version of the address that can be used to place a call using {@link LinphoneCore#invite(String)}
|
||||
*/
|
||||
public String toUri();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public class LinphoneAddressImpl implements LinphoneAddress {
|
|||
private native String getDisplayName(long ptr);
|
||||
private native String getUserName(long ptr);
|
||||
private native String getDomain(long ptr);
|
||||
|
||||
private native String toUri(long ptr);
|
||||
|
||||
protected LinphoneAddressImpl(String username,String domain,String displayName) {
|
||||
nativePtr = newLinphoneAddressImpl("sip:"+username+"@"+domain, displayName);
|
||||
|
|
@ -51,11 +51,10 @@ public class LinphoneAddressImpl implements LinphoneAddress {
|
|||
}
|
||||
|
||||
public String toString() {
|
||||
String tmp="";
|
||||
if (getDisplayName()!=null) {
|
||||
tmp="<"+getDisplayName()+">";
|
||||
}
|
||||
return tmp+"sip:"+getUserName()+"@"+getDomain();
|
||||
return toUri();
|
||||
}
|
||||
public String toUri() {
|
||||
return toUri(nativePtr);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,6 +39,9 @@ public class LinphoneCoreFactory {
|
|||
return new LinphoneCoreImpl(listener,userConfig,factoryConfig,userdata);
|
||||
}
|
||||
|
||||
public LinphoneAddress createLinphoneAddress(String username,String domain,String displayName) {
|
||||
return new LinphoneAddressImpl(username,domain,displayName);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,4 +51,15 @@ public interface LinphoneProxyConfig {
|
|||
* @return
|
||||
*/
|
||||
public String normalizePhoneNumber(String number);
|
||||
/**
|
||||
* usefull function to automatically add internationnal prefix to e164 phone numbers
|
||||
* @param prefix
|
||||
*/
|
||||
public void setDialPrefix(String prefix);
|
||||
|
||||
/**
|
||||
* rget domain host name or ip
|
||||
* @return may be null
|
||||
*/
|
||||
public String getDomain();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,8 +55,12 @@ class LinphoneProxyConfigImpl implements LinphoneProxyConfig {
|
|||
|
||||
private native void enableRegister(long ptr,boolean value);
|
||||
|
||||
private native void setDialPrefix(long ptr, String prefix);
|
||||
|
||||
private native String normalizePhoneNumber(long ptr,String number);
|
||||
|
||||
private native String getDomain(long ptr);
|
||||
|
||||
public void enableRegister(boolean value) {
|
||||
enableRegister(nativePtr,value);
|
||||
}
|
||||
|
|
@ -81,4 +85,10 @@ class LinphoneProxyConfigImpl implements LinphoneProxyConfig {
|
|||
public String normalizePhoneNumber(String number) {
|
||||
return normalizePhoneNumber(nativePtr,number);
|
||||
}
|
||||
public void setDialPrefix(String prefix) {
|
||||
setDialPrefix(nativePtr, prefix);
|
||||
}
|
||||
public String getDomain() {
|
||||
return getDomain(nativePtr);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue