Commit d69cf918 authored by jehan's avatar jehan

Merge branch 'master' of git.linphone.org:linphone

Conflicts:
	mediastreamer2
parents d10666ae df6e2005
......@@ -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
......
......@@ -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;
......
This diff is collapsed.
......@@ -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.
*/
......
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
......
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