mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-26 23:58:17 +00:00
Merge branch 'master' of git.linphone.org:linphone
Conflicts: mediastreamer2
This commit is contained in:
commit
d69cf918b6
17 changed files with 144 additions and 57 deletions
3
README
3
README
|
|
@ -10,6 +10,7 @@ This is Linphone, a free (GPL) video softphone based on the SIP protocol.
|
|||
- you need at least:
|
||||
- belle-sip>=1.0.0
|
||||
- speex>=1.2.0 (including libspeexdsp part)
|
||||
- libxml2
|
||||
|
||||
+ if you want the gtk/glade interface:
|
||||
- libgtk >=2.16.0
|
||||
|
|
@ -32,7 +33,7 @@ This is Linphone, a free (GPL) video softphone based on the SIP protocol.
|
|||
|
||||
Here is the command line to get these dependencies installed for Ubuntu && Debian
|
||||
|
||||
$ sudo apt-get install libtool intltool libgtk2.0-dev libosip2-dev libexosip2-dev libspeexdsp-dev libavcodec-dev libswscale-dev libx11-dev libvx-dev libgl1-mesa-dev libglew1.6-dev libv4l-dev
|
||||
$ sudo apt-get install libtool intltool libgtk2.0-dev libosip2-dev libexosip2-dev libspeexdsp-dev libavcodec-dev libswscale-dev libx11-dev libxv-dev libgl1-mesa-dev libglew1.6-dev libv4l-dev libxml2-dev
|
||||
|
||||
+ for optional library
|
||||
$ sudo apt-get install libreadline-dev libgsm1-dev libtheora-dev libsoup2.4-dev libsqlite3-dev libupnp4-dev
|
||||
|
|
|
|||
17
README.macos
17
README.macos
|
|
@ -7,9 +7,11 @@ You need:
|
|||
- Macports: http://www.macports.org/
|
||||
Download and install macports using its user friendly installer.
|
||||
|
||||
- In order to enable generation of bundle for multiple macos version it is recommended to edit /opt/local/etc/macports/macports.conf to add the
|
||||
following line:
|
||||
macosx_deployment_target 10.6
|
||||
- In order to enable generation of bundle for multiple macos version and 32 bit processors, it is recommended to:
|
||||
1) edit /opt/local/etc/macports/macports.conf to add the following line:
|
||||
macosx_deployment_target 10.6
|
||||
2) edit /opt/local/etc/macports/variants.conf to add the following line:
|
||||
+universal
|
||||
|
||||
- Install build time dependencies
|
||||
$ sudo port install automake autoconf libtool intltool
|
||||
|
|
@ -34,7 +36,16 @@ You need:
|
|||
|
||||
The softwares below need to be compiled manually. To ensure compatibility with multiple mac os version it is recommended to do:
|
||||
$ export MACOSX_DEPLOYMENT_TARGET=10.6
|
||||
$ export CFLAGS="-arch i386 -arch x86_64 -mmacosx-version-min=10.5"
|
||||
$ export OBJCFLAGS="-arch i386 -arch x86_64 -mmacosx-version-min=10.5"
|
||||
$ export CXXFLAGS="-arch i386 -arch x86_64 -mmacosx-version-min=10.5"
|
||||
$ export LDFLAGS="-arch i386 -arch x86_64 -mmacosx-version-min=10.5"
|
||||
|
||||
- Install polarssl (encryption library used by belle-sip)
|
||||
$ git clone git://git.linphone.org/polarssl.git -b linphone
|
||||
$ cd polarssl
|
||||
$ ./autogen.sh && ./configure --prefix=/opt/local && make
|
||||
$ sudo make install
|
||||
|
||||
- Install belle-sip (sip stack)
|
||||
$ git clone git://git.linphone.org/belle-sip.git
|
||||
|
|
|
|||
|
|
@ -839,13 +839,15 @@ void sal_enable_test_features(Sal*ctx, bool_t enabled){
|
|||
ctx->enable_test_features=enabled;
|
||||
}
|
||||
|
||||
unsigned long sal_resolve_a(Sal* sal, const char *name, int port, int family, SalResolverCallback cb, void *data){
|
||||
return belle_sip_stack_resolve_a(sal->stack,name,port,family,(belle_sip_resolver_callback_t)cb,data);
|
||||
SalResolverContext * sal_resolve_a(Sal* sal, const char *name, int port, int family, SalResolverCallback cb, void *data){
|
||||
return (SalResolverContext*)belle_sip_stack_resolve_a(sal->stack,name,port,family,(belle_sip_resolver_callback_t)cb,data);
|
||||
}
|
||||
|
||||
void sal_resolve_cancel(Sal *sal, unsigned long id){
|
||||
belle_sip_stack_resolve_cancel(sal->stack,id);
|
||||
/*
|
||||
void sal_resolve_cancel(Sal *sal, SalResolverContext* ctx){
|
||||
belle_sip_stack_resolve_cancel(sal->stack,ctx);
|
||||
}
|
||||
*/
|
||||
|
||||
void sal_enable_unconditional_answer(Sal *sal,int value) {
|
||||
belle_sip_provider_enable_unconditional_answer(sal->prov,value);
|
||||
|
|
|
|||
|
|
@ -693,7 +693,7 @@ SalMediaDescription * sal_call_get_final_media_description(SalOp *h){
|
|||
}
|
||||
|
||||
int sal_call_send_dtmf(SalOp *h, char dtmf){
|
||||
if (h->dialog){
|
||||
if (h->dialog && (belle_sip_dialog_get_state(h->dialog) == BELLE_SIP_DIALOG_CONFIRMED || belle_sip_dialog_get_state(h->dialog) == BELLE_SIP_DIALOG_EARLY)){
|
||||
belle_sip_request_t *req=belle_sip_dialog_create_queued_request(h->dialog,"INFO");
|
||||
if (req){
|
||||
int bodylen;
|
||||
|
|
|
|||
|
|
@ -762,6 +762,7 @@ void linphone_call_set_state(LinphoneCall *call, LinphoneCallState cstate, const
|
|||
static void linphone_call_destroy(LinphoneCall *obj)
|
||||
{
|
||||
ms_message("Call [%p] freed.",obj);
|
||||
linphone_call_stop_media_streams(obj);
|
||||
#ifdef BUILD_UPNP
|
||||
linphone_call_delete_upnp_session(obj);
|
||||
#endif //BUILD_UPNP
|
||||
|
|
|
|||
|
|
@ -2852,6 +2852,7 @@ void linphone_core_notify_incoming_call(LinphoneCore *lc, LinphoneCall *call){
|
|||
if (md){
|
||||
if (sal_media_description_empty(md) || linphone_core_incompatible_security(lc,md)){
|
||||
sal_call_decline(call->op,SalReasonMedia,NULL);
|
||||
linphone_call_stop_media_streams(call);
|
||||
linphone_core_del_call(lc,call);
|
||||
linphone_call_unref(call);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -3102,7 +3102,7 @@ extern "C" jstring Java_org_linphone_core_LinphoneCoreImpl_getUpnpExternalIpaddr
|
|||
* Signature: (JJLjava/lang/String;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Object;
|
||||
*/
|
||||
JNIEXPORT jobject JNICALL Java_org_linphone_core_LinphoneCoreImpl_subscribe(JNIEnv *env, jobject jcore, jlong coreptr, jlong addrptr,
|
||||
jstring jevname, jint expires, jstring jtype, jstring jsubtype, jstring jdata){
|
||||
jstring jevname, jint expires, jstring jtype, jstring jsubtype, jbyteArray jdata, jstring jencoding){
|
||||
LinphoneCore *lc=(LinphoneCore*)coreptr;
|
||||
LinphoneAddress *addr=(LinphoneAddress*)addrptr;
|
||||
LinphoneContent content={0};
|
||||
|
|
@ -3114,14 +3114,16 @@ JNIEXPORT jobject JNICALL Java_org_linphone_core_LinphoneCoreImpl_subscribe(JNIE
|
|||
if (jtype){
|
||||
content.type=(char*)env->GetStringUTFChars(jtype,NULL);
|
||||
content.subtype=(char*)env->GetStringUTFChars(jsubtype,NULL);
|
||||
content.data=(void*)env->GetStringUTFChars(jdata,NULL);
|
||||
content.size=strlen((char*)content.data);
|
||||
content.encoding=jencoding ? (char*)env->GetStringUTFChars(jsubtype,NULL) : NULL;
|
||||
content.data=(void*)env->GetByteArrayElements(jdata,NULL);
|
||||
content.size=env->GetArrayLength(jdata);
|
||||
}
|
||||
ev=linphone_core_subscribe(lc,addr,evname,expires,content.type ? &content : NULL);
|
||||
if (jtype){
|
||||
env->ReleaseStringUTFChars(jtype,content.type);
|
||||
env->ReleaseStringUTFChars(jsubtype,content.subtype);
|
||||
env->ReleaseStringUTFChars(jdata,(char*)content.data);
|
||||
if (jencoding) env->ReleaseStringUTFChars(jencoding,content.encoding);
|
||||
env->ReleaseByteArrayElements(jdata,(jbyte*)content.data,JNI_ABORT);
|
||||
}
|
||||
env->ReleaseStringUTFChars(jevname,evname);
|
||||
if (ev){
|
||||
|
|
@ -3136,7 +3138,7 @@ JNIEXPORT jobject JNICALL Java_org_linphone_core_LinphoneCoreImpl_subscribe(JNIE
|
|||
* Signature: (JJLjava/lang/String;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Object;
|
||||
*/
|
||||
JNIEXPORT jobject JNICALL Java_org_linphone_core_LinphoneCoreImpl_publish(JNIEnv *env, jobject jobj, jlong coreptr, jlong addrptr, jstring jevname, jint expires,
|
||||
jstring jtype, jstring jsubtype, jstring jdata){
|
||||
jstring jtype, jstring jsubtype, jbyteArray jdata, jstring jencoding){
|
||||
LinphoneCore *lc=(LinphoneCore*)coreptr;
|
||||
LinphoneAddress *addr=(LinphoneAddress*)addrptr;
|
||||
LinphoneContent content={0};
|
||||
|
|
@ -3148,14 +3150,16 @@ JNIEXPORT jobject JNICALL Java_org_linphone_core_LinphoneCoreImpl_publish(JNIEnv
|
|||
if (jtype){
|
||||
content.type=(char*)env->GetStringUTFChars(jtype,NULL);
|
||||
content.subtype=(char*)env->GetStringUTFChars(jsubtype,NULL);
|
||||
content.data=(void*)env->GetStringUTFChars(jdata,NULL);
|
||||
content.size=strlen((char*)content.data);
|
||||
content.encoding=jencoding ? (char*)env->GetStringUTFChars(jsubtype,NULL) : NULL;
|
||||
content.data=(void*)env->GetByteArrayElements(jdata,NULL);
|
||||
content.size=env->GetArrayLength(jdata);
|
||||
}
|
||||
ev=linphone_core_publish(lc,addr,evname,expires,content.type ? &content : NULL);
|
||||
if (jtype){
|
||||
env->ReleaseStringUTFChars(jtype,content.type);
|
||||
env->ReleaseStringUTFChars(jsubtype,content.subtype);
|
||||
env->ReleaseStringUTFChars(jdata,(char*)content.data);
|
||||
if (jencoding) env->ReleaseStringUTFChars(jencoding,content.encoding);
|
||||
env->ReleaseByteArrayElements(jdata,(jbyte*)content.data,JNI_ABORT);
|
||||
}
|
||||
env->ReleaseStringUTFChars(jevname,evname);
|
||||
if (ev){
|
||||
|
|
@ -3295,15 +3299,22 @@ extern "C" jintArray Java_org_linphone_core_LpConfigImpl_getIntRange(JNIEnv *env
|
|||
static jobject create_java_linphone_content(JNIEnv *env, const LinphoneContent *content){
|
||||
jclass contentClass;
|
||||
jmethodID ctor;
|
||||
jstring jtype, jsubtype, jdata;
|
||||
jstring jtype, jsubtype, jencoding;
|
||||
jbyteArray jdata=NULL;
|
||||
|
||||
contentClass = (jclass)env->NewGlobalRef(env->FindClass("org/linphone/core/LinphoneContentImpl"));
|
||||
ctor = env->GetMethodID(contentClass,"<init>", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
|
||||
ctor = env->GetMethodID(contentClass,"<init>", "(Ljava/lang/String;Ljava/lang/String;[BLjava/lang/String;)V");
|
||||
|
||||
jtype=env->NewStringUTF(content->type);
|
||||
jsubtype=env->NewStringUTF(content->subtype);
|
||||
jdata=content->data ? env->NewStringUTF((const char*)content->data) : NULL;
|
||||
jobject jobj=env->NewObject(contentClass,ctor,jtype, jsubtype, jdata);
|
||||
jencoding=content->encoding ? env->NewStringUTF(content->encoding) : NULL;
|
||||
|
||||
if (content->data){
|
||||
jdata=env->NewByteArray(content->size);
|
||||
env->SetByteArrayRegion(jdata,0,content->size,(jbyte*)content->data);
|
||||
}
|
||||
|
||||
jobject jobj=env->NewObject(contentClass,ctor,jtype, jsubtype, jdata,jencoding);
|
||||
env->DeleteGlobalRef(contentClass);
|
||||
return jobj;
|
||||
}
|
||||
|
|
@ -3327,7 +3338,7 @@ JNIEXPORT jobject JNICALL Java_org_linphone_core_LinphoneInfoMessageImpl_getCont
|
|||
* Signature: (JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_org_linphone_core_LinphoneInfoMessageImpl_setContent(JNIEnv *env, jobject jobj, jlong infoptr, jstring jtype, jstring jsubtype, jstring jdata){
|
||||
LinphoneContent content;
|
||||
LinphoneContent content={0};
|
||||
|
||||
content.type=(char*)env->GetStringUTFChars(jtype,NULL);
|
||||
content.subtype=(char*)env->GetStringUTFChars(jsubtype,NULL);
|
||||
|
|
@ -3428,7 +3439,7 @@ JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneEventImpl_denySubscription
|
|||
* Method: notify
|
||||
* Signature: (JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneEventImpl_notify(JNIEnv *env, jobject jobj, jlong evptr, jstring jtype, jstring jsubtype, jstring jdata){
|
||||
JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneEventImpl_notify(JNIEnv *env, jobject jobj, jlong evptr, jstring jtype, jstring jsubtype, jbyteArray jdata, jstring jencoding){
|
||||
LinphoneContent content={0};
|
||||
LinphoneEvent *ev=(LinphoneEvent*)evptr;
|
||||
jint err;
|
||||
|
|
@ -3436,8 +3447,9 @@ JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneEventImpl_notify(JNIEnv *e
|
|||
if (jtype){
|
||||
content.type=(char*)env->GetStringUTFChars(jtype,NULL);
|
||||
content.subtype=(char*)env->GetStringUTFChars(jsubtype,NULL);
|
||||
content.data=(void*)env->GetStringUTFChars(jdata,NULL);
|
||||
content.size=strlen((char*)content.data);
|
||||
content.encoding=jencoding ? (char*)env->GetStringUTFChars(jsubtype,NULL) : NULL;
|
||||
content.data=(void*)env->GetByteArrayElements(jdata,NULL);
|
||||
content.size=env->GetArrayLength(jdata);
|
||||
}
|
||||
|
||||
err=linphone_event_notify(ev,content.type ? &content : NULL);
|
||||
|
|
@ -3445,7 +3457,8 @@ JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneEventImpl_notify(JNIEnv *e
|
|||
if (jtype){
|
||||
env->ReleaseStringUTFChars(jtype,content.type);
|
||||
env->ReleaseStringUTFChars(jsubtype,content.subtype);
|
||||
env->ReleaseStringUTFChars(jdata,(char*)content.data);
|
||||
if (jencoding) env->ReleaseStringUTFChars(jencoding,content.encoding);
|
||||
env->ReleaseByteArrayElements(jdata,(jbyte*)content.data,JNI_ABORT);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
|
@ -3455,7 +3468,7 @@ JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneEventImpl_notify(JNIEnv *e
|
|||
* Method: updateSubscribe
|
||||
* Signature: (JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneEventImpl_updateSubscribe(JNIEnv *env, jobject jobj, jlong evptr, jstring jtype, jstring jsubtype, jstring jdata){
|
||||
JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneEventImpl_updateSubscribe(JNIEnv *env, jobject jobj, jlong evptr, jstring jtype, jstring jsubtype, jbyteArray jdata, jstring jencoding){
|
||||
LinphoneContent content={0};
|
||||
LinphoneEvent *ev=(LinphoneEvent*)evptr;
|
||||
jint err;
|
||||
|
|
@ -3463,8 +3476,9 @@ JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneEventImpl_updateSubscribe(
|
|||
if (jtype){
|
||||
content.type=(char*)env->GetStringUTFChars(jtype,NULL);
|
||||
content.subtype=(char*)env->GetStringUTFChars(jsubtype,NULL);
|
||||
content.data=(void*)env->GetStringUTFChars(jdata,NULL);
|
||||
content.size=strlen((char*)content.data);
|
||||
content.encoding=jencoding ? (char*)env->GetStringUTFChars(jsubtype,NULL) : NULL;
|
||||
content.data=(void*)env->GetByteArrayElements(jdata,NULL);
|
||||
content.size=env->GetArrayLength(jdata);
|
||||
}
|
||||
|
||||
err=linphone_event_update_subscribe(ev,content.type ? &content : NULL);
|
||||
|
|
@ -3472,7 +3486,8 @@ JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneEventImpl_updateSubscribe(
|
|||
if (jtype){
|
||||
env->ReleaseStringUTFChars(jtype,content.type);
|
||||
env->ReleaseStringUTFChars(jsubtype,content.subtype);
|
||||
env->ReleaseStringUTFChars(jdata,(char*)content.data);
|
||||
if (jencoding) env->ReleaseStringUTFChars(jencoding,content.encoding);
|
||||
env->ReleaseByteArrayElements(jdata,(jbyte*)content.data,JNI_ABORT);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
|
@ -3482,7 +3497,7 @@ JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneEventImpl_updateSubscribe(
|
|||
* Method: updatePublish
|
||||
* Signature: (JLjava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneEventImpl_updatePublish(JNIEnv *env, jobject jobj, jlong evptr, jstring jtype, jstring jsubtype, jstring jdata){
|
||||
JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneEventImpl_updatePublish(JNIEnv *env, jobject jobj, jlong evptr, jstring jtype, jstring jsubtype, jbyteArray jdata, jstring jencoding){
|
||||
LinphoneContent content={0};
|
||||
LinphoneEvent *ev=(LinphoneEvent*)evptr;
|
||||
jint err;
|
||||
|
|
@ -3490,8 +3505,9 @@ JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneEventImpl_updatePublish(JN
|
|||
if (jtype){
|
||||
content.type=(char*)env->GetStringUTFChars(jtype,NULL);
|
||||
content.subtype=(char*)env->GetStringUTFChars(jsubtype,NULL);
|
||||
content.data=(void*)env->GetStringUTFChars(jdata,NULL);
|
||||
content.size=strlen((char*)content.data);
|
||||
content.encoding=jencoding ? (char*)env->GetStringUTFChars(jsubtype,NULL) : NULL;
|
||||
content.data=(void*)env->GetByteArrayElements(jdata,NULL);
|
||||
content.size=env->GetArrayLength(jdata);
|
||||
}
|
||||
|
||||
err=linphone_event_update_publish(ev,content.type ? &content : NULL);
|
||||
|
|
@ -3499,7 +3515,8 @@ JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneEventImpl_updatePublish(JN
|
|||
if (jtype){
|
||||
env->ReleaseStringUTFChars(jtype,content.type);
|
||||
env->ReleaseStringUTFChars(jsubtype,content.subtype);
|
||||
env->ReleaseStringUTFChars(jdata,(char*)content.data);
|
||||
if (jencoding) env->ReleaseStringUTFChars(jencoding,content.encoding);
|
||||
env->ReleaseByteArrayElements(jdata,(jbyte*)content.data,JNI_ABORT);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -633,7 +633,7 @@ static void stun_server_resolved(LinphoneCore *lc, const char *name, struct addr
|
|||
ms_warning("Stun server resolution failed.");
|
||||
}
|
||||
lc->net_conf.stun_addrinfo=addrinfo;
|
||||
lc->net_conf.stun_res_id=0;
|
||||
lc->net_conf.stun_res=NULL;
|
||||
}
|
||||
|
||||
void linphone_core_resolve_stun_server(LinphoneCore *lc){
|
||||
|
|
@ -642,7 +642,7 @@ void linphone_core_resolve_stun_server(LinphoneCore *lc){
|
|||
char host[NI_MAXHOST];
|
||||
int port=3478;
|
||||
linphone_parse_host_port(server,host,sizeof(host),&port);
|
||||
lc->net_conf.stun_res_id=sal_resolve_a(lc->sal,host,port,AF_UNSPEC,(SalResolverCallback)stun_server_resolved,lc);
|
||||
lc->net_conf.stun_res=sal_resolve_a(lc->sal,host,port,AF_UNSPEC,(SalResolverCallback)stun_server_resolved,lc);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -663,7 +663,7 @@ const struct addrinfo *linphone_core_get_stun_server_addrinfo(LinphoneCore *lc){
|
|||
int wait_ms=0;
|
||||
int wait_limit=1000;
|
||||
linphone_core_resolve_stun_server(lc);
|
||||
while (!lc->net_conf.stun_addrinfo && lc->net_conf.stun_res_id!=0 && wait_ms<wait_limit){
|
||||
while (!lc->net_conf.stun_addrinfo && lc->net_conf.stun_res!=NULL && wait_ms<wait_limit){
|
||||
sal_iterate(lc->sal);
|
||||
ms_usleep(50000);
|
||||
wait_ms+=50;
|
||||
|
|
|
|||
|
|
@ -498,7 +498,7 @@ typedef struct net_config
|
|||
char *nat_address_ip; /* ip translated from nat_address */
|
||||
char *stun_server;
|
||||
struct addrinfo *stun_addrinfo;
|
||||
unsigned long stun_res_id;
|
||||
SalResolverContext * stun_res;
|
||||
int download_bw;
|
||||
int upload_bw;
|
||||
int mtu;
|
||||
|
|
|
|||
|
|
@ -594,8 +594,10 @@ void sal_get_default_local_ip(Sal *sal, int address_family, char *ip, size_t ipl
|
|||
|
||||
typedef void (*SalResolverCallback)(void *data, const char *name, struct addrinfo *ai_list);
|
||||
|
||||
unsigned long sal_resolve_a(Sal* sal, const char *name, int port, int family, SalResolverCallback cb, void *data);
|
||||
void sal_resolve_cancel(Sal *sal, unsigned long id);
|
||||
typedef struct SalResolverContext SalResolverContext;
|
||||
|
||||
SalResolverContext * sal_resolve_a(Sal* sal, const char *name, int port, int family, SalResolverCallback cb, void *data);
|
||||
//void sal_resolve_cancel(Sal *sal, SalResolverContext *ctx);
|
||||
|
||||
SalCustomHeader *sal_custom_header_append(SalCustomHeader *ch, const char *name, const char *value);
|
||||
const char *sal_custom_header_find(const SalCustomHeader *ch, const char *name);
|
||||
|
|
|
|||
|
|
@ -17,11 +17,19 @@ public interface LinphoneContent {
|
|||
* @return the subtype
|
||||
*/
|
||||
String getSubtype();
|
||||
/**
|
||||
* Get the encoding applied to the data, can be null if no encoding.
|
||||
**/
|
||||
String getEncoding();
|
||||
/**
|
||||
* Get the data as a string.
|
||||
* @return the data
|
||||
*/
|
||||
String getDataAsString();
|
||||
/**
|
||||
* Get the data as a byte array.
|
||||
**/
|
||||
byte [] getData();
|
||||
/**
|
||||
* Get the data size.
|
||||
* @return the data size.
|
||||
|
|
@ -38,9 +46,17 @@ public interface LinphoneContent {
|
|||
* @param subtype the subtype
|
||||
*/
|
||||
void setSubtype(String subtype);
|
||||
/**
|
||||
* Set the encoding applied to the data, can be null if no encoding.
|
||||
**/
|
||||
void setEncoding(String encoding);
|
||||
/**
|
||||
* Set the data, supplied as String.
|
||||
* @param data the data
|
||||
*/
|
||||
void setStringData(String data);
|
||||
/**
|
||||
* Set the data, as a byte buffer.
|
||||
**/
|
||||
void setData(byte data[]);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -108,10 +108,15 @@ abstract public class LinphoneCoreFactory {
|
|||
abstract public LinphoneFriend createLinphoneFriend();
|
||||
|
||||
/**
|
||||
* Create a LinphoneContent object
|
||||
* Create a LinphoneContent object from string data.
|
||||
*/
|
||||
abstract public LinphoneContent createLinphoneContent(String type, String subType, String data);
|
||||
|
||||
/**
|
||||
* Create a LinphoneContent object from byte array.
|
||||
*/
|
||||
abstract public LinphoneContent createLinphoneContent(String type, String subType,byte [] data, String encoding);
|
||||
|
||||
/**
|
||||
* Create a PresenceActivity object.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
package org.linphone.core;
|
||||
|
||||
public class LinphoneContentImpl implements LinphoneContent {
|
||||
private String mType, mSubtype, mData;
|
||||
public LinphoneContentImpl(String type, String subtype, String data){
|
||||
private String mType, mSubtype, mEncoding;
|
||||
private byte[] mData;
|
||||
|
||||
public LinphoneContentImpl(String type, String subtype, byte data[], String encoding ){
|
||||
mType=type;
|
||||
mSubtype=subtype;
|
||||
mData=data;
|
||||
mEncoding=encoding;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -20,12 +23,12 @@ public class LinphoneContentImpl implements LinphoneContent {
|
|||
|
||||
@Override
|
||||
public String getDataAsString() {
|
||||
return mData;
|
||||
return new String(mData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSize() {
|
||||
return mData.length();
|
||||
return mData.length;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -40,7 +43,27 @@ public class LinphoneContentImpl implements LinphoneContent {
|
|||
|
||||
@Override
|
||||
public void setStringData(String data) {
|
||||
mData=data.getBytes();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setData(byte data[]){
|
||||
mData=data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEncoding() {
|
||||
return mEncoding;
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] getData() {
|
||||
return mData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEncoding(String encoding) {
|
||||
mEncoding=encoding;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -151,10 +151,16 @@ public class LinphoneCoreFactoryImpl extends LinphoneCoreFactory {
|
|||
return new LinphoneAuthInfoImpl(username, userid, passwd, ha1, realm, domain);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LinphoneContent createLinphoneContent(String type, String subType,
|
||||
byte [] data, String encoding) {
|
||||
return new LinphoneContentImpl(type,subType,data,encoding);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LinphoneContent createLinphoneContent(String type, String subType,
|
||||
String data) {
|
||||
return new LinphoneContentImpl(type,subType,data);
|
||||
return new LinphoneContentImpl(type,subType,data.getBytes(),null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -1028,19 +1028,21 @@ class LinphoneCoreImpl implements LinphoneCore {
|
|||
return new LinphoneInfoMessageImpl(createInfoMessage(nativePtr));
|
||||
}
|
||||
|
||||
private native Object subscribe(long coreptr, long addrptr, String eventname, int expires, String type, String subtype, String data);
|
||||
private native Object subscribe(long coreptr, long addrptr, String eventname, int expires, String type, String subtype, byte data [], String encoding);
|
||||
@Override
|
||||
public LinphoneEvent subscribe(LinphoneAddress resource, String eventname,
|
||||
int expires, LinphoneContent content) {
|
||||
return (LinphoneEvent)subscribe(nativePtr, ((LinphoneAddressImpl)resource).nativePtr, eventname, expires,
|
||||
content!=null ? content.getType() : null, content!=null ? content.getSubtype() : null, content!=null ? content.getDataAsString() : null);
|
||||
content!=null ? content.getType() : null, content!=null ? content.getSubtype() : null, content!=null ? content.getData() : null,
|
||||
content!=null ? content.getEncoding() : null);
|
||||
}
|
||||
private native Object publish(long coreptr, long addrptr, String eventname, int expires, String type, String subtype, String data);
|
||||
private native Object publish(long coreptr, long addrptr, String eventname, int expires, String type, String subtype, byte data [], String encoding);
|
||||
@Override
|
||||
public LinphoneEvent publish(LinphoneAddress resource, String eventname,
|
||||
int expires, LinphoneContent content) {
|
||||
return (LinphoneEvent)publish(nativePtr, ((LinphoneAddressImpl)resource).nativePtr, eventname, expires,
|
||||
content!=null ? content.getType() : null, content!=null ? content.getSubtype() : null, content!=null ? content.getDataAsString() : null);
|
||||
content!=null ? content.getType() : null, content!=null ? content.getSubtype() : null, content!=null ? content.getData() : null,
|
||||
content!=null ? content.getEncoding() : null);
|
||||
}
|
||||
|
||||
public void setChatDatabasePath(String path) {
|
||||
|
|
|
|||
|
|
@ -26,22 +26,22 @@ public class LinphoneEventImpl implements LinphoneEvent {
|
|||
denySubscription(mNativePtr,reason.mValue);
|
||||
}
|
||||
|
||||
private native int notify(long nativeptr, String type, String subtype, String data);
|
||||
private native int notify(long nativeptr, String type, String subtype, byte data[], String encoding);
|
||||
@Override
|
||||
public void notify(LinphoneContent content) {
|
||||
notify(mNativePtr,content.getType(),content.getSubtype(),content.getDataAsString());
|
||||
notify(mNativePtr,content.getType(),content.getSubtype(),content.getData(),content.getEncoding());
|
||||
}
|
||||
|
||||
private native int updateSubscribe(long nativePtr, String type, String subtype, String data);
|
||||
private native int updateSubscribe(long nativePtr, String type, String subtype, byte data[], String encoding);
|
||||
@Override
|
||||
public void updateSubscribe(LinphoneContent content) {
|
||||
updateSubscribe(mNativePtr,content.getType(), content.getSubtype(),content.getDataAsString());
|
||||
updateSubscribe(mNativePtr,content.getType(), content.getSubtype(),content.getData(),content.getEncoding());
|
||||
}
|
||||
|
||||
private native int updatePublish(long nativePtr, String type, String subtype, String data);
|
||||
private native int updatePublish(long nativePtr, String type, String subtype, byte data[], String encoding);
|
||||
@Override
|
||||
public void updatePublish(LinphoneContent content) {
|
||||
updatePublish(mNativePtr,content.getType(), content.getSubtype(),content.getDataAsString());
|
||||
updatePublish(mNativePtr,content.getType(), content.getSubtype(),content.getData(),content.getEncoding());
|
||||
}
|
||||
|
||||
private native int terminate(long nativePtr);
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ COMMON_CFLAGS=\
|
|||
$(LIBXML2_CFLAGS)
|
||||
|
||||
#-fpermissive to workaround a g++ bug on macos 32bit SDK.
|
||||
AM_CXXFLAGS=$(LIBXML2_CFLAGS) $(STRICT_OPTIONS) -fpermissive
|
||||
AM_CXXFLAGS=$(LIBXML2_CFLAGS) -fpermissive $(STRICT_OPTIONS)
|
||||
|
||||
EXTRA_DIST=xml2lpc_jni.cc lpc2xml_jni.cc
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue