Commit 2d666723 authored by Simon Morlat's avatar Simon Morlat
Browse files

Merge branch 'master' into dev_multicall

Conflicts:
	coreapi/callbacks.c
	coreapi/sal_eXosip2.c
	mediastreamer2
parents f6537cb2 4fed6f59
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?>
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
......@@ -7,6 +7,8 @@
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="0.2079208171" moduleId="org.eclipse.cdt.core.settings" name="Default">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.MachO64" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
......@@ -18,7 +20,7 @@
<configuration artifactName="linphone" buildProperties="" description="" id="0.2079208171" name="Default" parent="org.eclipse.cdt.build.core.prefbase.cfg">
<folderInfo id="0.2079208171." name="/" resourcePath="">
<toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.2084203071" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
<targetPlatform id="org.eclipse.cdt.build.core.prefbase.toolchain.2084203071.81924294" name=""/>
<targetPlatform binaryParser="org.eclipse.cdt.core.MachO64;org.eclipse.cdt.core.ELF" id="org.eclipse.cdt.build.core.prefbase.toolchain.2084203071.81924294" name=""/>
<builder id="org.eclipse.cdt.build.core.settings.default.builder.731584538" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
<tool id="org.eclipse.cdt.build.core.settings.holder.libs.1252970003" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
<tool id="org.eclipse.cdt.build.core.settings.holder.1371414073" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder">
......@@ -201,6 +203,27 @@
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
<buildTargets>
<target name="all" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildTarget>all</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
<target name="install" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
<buildCommand>make</buildCommand>
<buildArguments/>
<buildTarget>install</buildTarget>
<stopOnError>true</stopOnError>
<useDefaultCommand>true</useDefaultCommand>
<runAllBuilders>true</runAllBuilders>
</target>
</buildTargets>
</storageModule>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
......
......@@ -57,14 +57,6 @@ const char *linphone_address_get_display_name(const LinphoneAddress* u){
return sal_address_get_display_name(u);
}
/**
* Returns the display name without quotes.
* @note WARNING: the returned string must be freed by user.
**/
char *linphone_address_get_display_name_unquoted(const LinphoneAddress *addr){
return sal_address_get_display_name_unquoted(addr);
}
/**
* Returns the username.
**/
......
......@@ -148,6 +148,7 @@ static void call_ringing(SalOp *h){
MSSndCard *ringcard=lc->sound_conf.lsd_card ? lc->sound_conf.lsd_card : lc->sound_conf.play_sndcard;
ms_message("Remote ringing...");
lc->ringstream=ring_start(lc->sound_conf.remote_ring,2000,ringcard);
gstate_new_state(lc, GSTATE_CALL_OUT_RINGING, NULL);
}
}else{
/*accept early media */
......@@ -161,7 +162,7 @@ static void call_ringing(SalOp *h){
if (lc->vtable.show) lc->vtable.show(lc);
if (lc->vtable.display_status)
lc->vtable.display_status(lc,_("Early media."));
gstate_new_state(lc, GSTATE_CALL_OUT_CONNECTED, NULL);
gstate_new_state(lc, GSTATE_CALL_OUT_RINGING, NULL);
if (lc->ringstream!=NULL){
ring_stop(lc->ringstream);
lc->ringstream=NULL;
......@@ -348,7 +349,7 @@ static void call_failure(SalOp *op, SalError error, SalReason sr, const char *de
/*char *retrymsg=_("%s. Retry after %i minute(s).");*/
char *msg600=_("User does not want to be disturbed.");
char *msg603=_("Call declined.");
char *msg=NULL;
char *msg=(char*)details;
LinphoneCall *call=(LinphoneCall*)sal_op_get_user_pointer(op);
if (lc->vtable.show) lc->vtable.show(lc);
......
......@@ -64,7 +64,6 @@ LinphoneAddress * linphone_address_new(const char *uri);
LinphoneAddress * linphone_address_clone(const LinphoneAddress *uri);
const char *linphone_address_get_scheme(const LinphoneAddress *u);
const char *linphone_address_get_display_name(const LinphoneAddress* u);
char *linphone_address_get_display_name_unquoted(const LinphoneAddress *u);
const char *linphone_address_get_username(const LinphoneAddress *u);
const char *linphone_address_get_domain(const LinphoneAddress *u);
void linphone_address_set_display_name(LinphoneAddress *u, const char *display_name);
......@@ -367,6 +366,7 @@ typedef enum _gstate {
GSTATE_REG_NONE = 10, /* initial state */
GSTATE_REG_OK,
GSTATE_REG_FAILED,
GSTATE_REG_PENDING, /* a registration request is ongoing*/
/* states for GSTATE_GROUP_CALL */
GSTATE_CALL_IDLE = 20, /* initial state */
GSTATE_CALL_OUT_INVITE,
......@@ -375,7 +375,8 @@ typedef enum _gstate {
GSTATE_CALL_IN_CONNECTED,
GSTATE_CALL_END,
GSTATE_CALL_ERROR,
GSTATE_INVALID
GSTATE_INVALID,
GSTATE_CALL_OUT_RINGING /*remote ringing*/
} gstate_t;
struct _LinphoneGeneralState {
......
......@@ -239,7 +239,11 @@ static void linphone_proxy_config_register(LinphoneProxyConfig *obj){
sal_op_release(obj->op);
obj->op=sal_op_new(obj->lc->sal);
sal_op_set_user_pointer(obj->op,obj);
sal_register(obj->op,obj->reg_proxy,obj->reg_identity,obj->expires);
if (!sal_register(obj->op,obj->reg_proxy,obj->reg_identity,obj->expires)) {
gstate_new_state(obj->lc,GSTATE_REG_PENDING,NULL);
} else {
gstate_new_state(obj->lc,GSTATE_REG_FAILED,NULL);
}
}
}
......
......@@ -1017,10 +1017,12 @@ static void authentication_ok(Sal *sal, eXosip_event_t *ev){
static bool_t call_failure(Sal *sal, eXosip_event_t *ev){
SalOp *op;
int code=0;
char* computedReason=NULL;
const char *reason=NULL;
SalError error=SalErrorUnknown;
SalReason sr=SalReasonUnknown;
op=(SalOp*)find_op(sal,ev);
if (op==NULL) {
......@@ -1031,6 +1033,15 @@ static bool_t call_failure(Sal *sal, eXosip_event_t *ev){
if (ev->response){
code=osip_message_get_status_code(ev->response);
reason=osip_message_get_reason_phrase(ev->response);
osip_header_t *h=NULL;
if (!osip_message_header_get_byname( ev->response
,"Reason"
,0
,&h)) {
computedReason = ms_strdup_printf("%s %s",reason,osip_header_get_value(h));
reason = computedReason;
}
}
switch(code)
{
......@@ -1077,6 +1088,9 @@ static bool_t call_failure(Sal *sal, eXosip_event_t *ev){
}else error=SalErrorNoResponse;
}
sal->callbacks.call_failure(op,error,sr,reason,code);
if (computedReason != NULL){
ms_free(computedReason);
}
return TRUE;
}
......@@ -1601,18 +1615,6 @@ int sal_unregister(SalOp *h){
return 0;
}
static void sal_address_quote_displayname(SalAddress *addr){
osip_from_t *u=(osip_from_t*)addr;
if (u->displayname!=NULL && u->displayname[0]!='\0'
&& u->displayname[0]!='"'){
int len=strlen(u->displayname)+1+2;
char *quoted=osip_malloc(len);
snprintf(quoted,len,"\"%s\"",u->displayname);
osip_free(u->displayname);
u->displayname=quoted;
}
}
SalAddress * sal_address_new(const char *uri){
osip_from_t *from;
osip_from_init(&from);
......@@ -1620,7 +1622,11 @@ SalAddress * sal_address_new(const char *uri){
osip_from_free(from);
return NULL;
}
sal_address_quote_displayname ((SalAddress*)from);
if (from->displayname!=NULL && from->displayname[0]=='"'){
char *unquoted=osip_strdup_without_quote(from->displayname);
osip_free(from->displayname);
from->displayname=unquoted;
}
return (SalAddress*)from;
}
......@@ -1642,18 +1648,6 @@ const char *sal_address_get_display_name(const SalAddress* addr){
return null_if_empty(u->displayname);
}
char *sal_address_get_display_name_unquoted(const SalAddress *addr){
const osip_from_t *u=(const osip_from_t*)addr;
const char *dn=null_if_empty(u->displayname);
char *ret=NULL;
if (dn!=NULL) {
char *tmp=osip_strdup_without_quote(dn);
ret=ms_strdup(tmp);
osip_free(tmp);
}
return ret;
}
const char *sal_address_get_username(const SalAddress *addr){
const osip_from_t *u=(const osip_from_t*)addr;
return null_if_empty(u->url->username);
......@@ -1672,7 +1666,6 @@ void sal_address_set_display_name(SalAddress *addr, const char *display_name){
}
if (display_name!=NULL && display_name[0]!='\0'){
u->displayname=osip_strdup(display_name);
sal_address_quote_displayname(addr);
}
}
......@@ -1724,7 +1717,19 @@ void sal_address_clean(SalAddress *addr){
char *sal_address_as_string(const SalAddress *u){
char *tmp,*ret;
osip_from_to_str((osip_from_t*)u,&tmp);
osip_from_t *from=(osip_from_t *)u;
char *old_displayname=NULL;
/* hack to force use of quotes around the displayname*/
if (from->displayname!=NULL
&& from->displayname[0]!='"'){
old_displayname=from->displayname;
from->displayname=osip_enquote(from->displayname);
}
osip_from_to_str(from,&tmp);
if (old_displayname!=NULL){
ms_free(from->displayname);
from->displayname=old_displayname;
}
ret=ms_strdup(tmp);
osip_free(tmp);
return ret;
......@@ -1741,6 +1746,7 @@ char *sal_address_as_string_uri_only(const SalAddress *u){
void sal_address_destroy(SalAddress *u){
osip_from_free((osip_from_t*)u);
}
void sal_set_keepalive_period(Sal *ctx,unsigned int value) {
eXosip_set_option (EXOSIP_OPT_UDP_KEEP_ALIVE, &value);
}
......
......@@ -308,7 +308,7 @@ void linphone_gtk_show_friends(void){
LinphoneFriend *lf=(LinphoneFriend*)itf->data;
const LinphoneAddress *f_uri=linphone_friend_get_address(lf);
char *uri=linphone_address_as_string(f_uri);
char *name=linphone_address_get_display_name_unquoted (f_uri);
const char *name=linphone_address_get_display_name(f_uri);
const char *display=name;
char *escaped=NULL;
if (lookup){
......@@ -341,7 +341,6 @@ void linphone_gtk_show_friends(void){
}
}
ms_free(uri);
if (name!=NULL) ms_free(name);
}
}
......@@ -373,17 +372,16 @@ void linphone_gtk_remove_contact(GtkWidget *button){
void linphone_gtk_show_contact(LinphoneFriend *lf){
GtkWidget *w=linphone_gtk_create_window("contact");
char *uri;
char *name;
const char *name;
const LinphoneAddress *f_uri=linphone_friend_get_address(lf);
uri=linphone_address_as_string_uri_only(f_uri);
name=linphone_address_get_display_name_unquoted (f_uri);
name=linphone_address_get_display_name(f_uri);
if (uri) {
gtk_entry_set_text(GTK_ENTRY(linphone_gtk_get_widget(w,"sip_address")),uri);
ms_free(uri);
}
if (name){
gtk_entry_set_text(GTK_ENTRY(linphone_gtk_get_widget(w,"name")),name);
ms_free(name);
}
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(w,"show_presence")),
linphone_friend_get_send_subscribe(lf));
......
......@@ -72,7 +72,7 @@ void linphone_gtk_show_idle_view(void){
void display_peer_name_in_label(GtkWidget *label, const char *uri){
LinphoneAddress *from;
char *displayname=NULL;
const char *displayname=NULL;
char *id=NULL;
char *uri_label;
......@@ -83,14 +83,13 @@ void display_peer_name_in_label(GtkWidget *label, const char *uri){
from=linphone_address_new(uri);
if (from!=NULL){
displayname=linphone_address_get_display_name_unquoted (from);
displayname=linphone_address_get_display_name(from);
id=linphone_address_as_string_uri_only(from);
}else id=ms_strdup(uri);
if (displayname!=NULL){
uri_label=g_markup_printf_escaped("<span size=\"large\">%s</span>\n<i>%s</i>",
displayname,id);
ms_free(displayname);
}else
uri_label=g_markup_printf_escaped("<span size=\"large\"><i>%s</i></span>\n",id);
gtk_label_set_markup(GTK_LABEL(label),uri_label);
......
......@@ -395,7 +395,7 @@ static void set_video_window_decorations(GdkWindow *w){
linphone_address_clean(uri);
if (linphone_address_get_display_name(uri)!=NULL){
display_name=linphone_address_get_display_name_unquoted (uri);
display_name=ms_strdup(linphone_address_get_display_name(uri));
}else{
display_name=linphone_address_as_string(uri);
}
......
......@@ -803,9 +803,8 @@ void linphone_gtk_show_parameters(void){
contact=linphone_core_get_primary_contact_parsed(lc);
if (contact){
if (linphone_address_get_display_name(contact)) {
char *dn=linphone_address_get_display_name_unquoted (contact);
const char *dn=linphone_address_get_display_name(contact);
gtk_entry_set_text(GTK_ENTRY(linphone_gtk_get_widget(pb,"displayname")),dn);
ms_free(dn);
}
if (linphone_address_get_username(contact))
gtk_entry_set_text(GTK_ENTRY(linphone_gtk_get_widget(pb,"username")),linphone_address_get_username(contact));
......
......@@ -38,6 +38,7 @@ public interface LinphoneCore {
static public GeneralState GSTATE_REG_NONE = new GeneralState(10,"GSTATE_REG_NONE"); /* initial state */
static public GeneralState GSTATE_REG_OK = new GeneralState(11,"GSTATE_REG_OK");
static public GeneralState GSTATE_REG_FAILED = new GeneralState(12,"GSTATE_REG_FAILED");
static public GeneralState GSTATE_REG_PENDING = new GeneralState(13,"GSTATE_REG_PENDING");
/* states for GSTATE_GROUP_CALL */
static public GeneralState GSTATE_CALL_IDLE = new GeneralState(20,"GSTATE_CALL_IDLE"); /* initial state */
static public GeneralState GSTATE_CALL_OUT_INVITE = new GeneralState(21,"GSTATE_CALL_OUT_INVITE");
......@@ -47,6 +48,7 @@ public interface LinphoneCore {
static public GeneralState GSTATE_CALL_END = new GeneralState(25,"GSTATE_CALL_END");
static public GeneralState GSTATE_CALL_ERROR = new GeneralState(26,"GSTATE_CALL_ERROR");
static public GeneralState GSTATE_INVALID = new GeneralState(27,"GSTATE_INVALID");
static public GeneralState GSTATE_CALL_OUT_RINGING = new GeneralState(28,"GSTATE_CALL_OUT_RINGING");
private final int mValue;
private final String mStringValue;
......
......@@ -61,5 +61,5 @@ abstract public class LinphoneCoreFactory {
*/
abstract public void setDebugMode(boolean enable);
abstract public void setLogHandler(LinphoneLogHandler handler);
//abstract public void setLogHandler(LinphoneLogHandler handler);
}
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