]> sjero.net Git - linphone/commitdiff
add new gstate REG_PENDING, OUT_RINGING
authorJehan Monnier <jehan.monnier@linphone.org>
Fri, 21 May 2010 13:52:14 +0000 (15:52 +0200)
committerJehan Monnier <jehan.monnier@linphone.org>
Fri, 21 May 2010 13:52:14 +0000 (15:52 +0200)
concatenate Reason header with reason phrase in case of state error

.cproject
coreapi/callbacks.c
coreapi/linphonecore.h
coreapi/proxy.c
coreapi/sal_eXosip2.c

index 4dc56ec673c52f3f9ce76e3207a4e7dc4ef532c0..869153cf536861f0ff4e7fd39d9ca11a4bd4d4bd 100644 (file)
--- a/.cproject
+++ b/.cproject
@@ -1,4 +1,4 @@
-<?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">
 </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">
index f15404dbf8b56051942462abdccc9cffd9daa8eb..018ce53439b910dd245671b4377458c11c5f152f 100644 (file)
@@ -124,6 +124,7 @@ static void call_ringing(SalOp *h){
                if (lc->sound_conf.play_sndcard!=NULL){
                        ms_message("Remote ringing...");
                        lc->ringstream=ring_start(lc->sound_conf.remote_ring,2000,lc->sound_conf.play_sndcard);
+                       gstate_new_state(lc, GSTATE_CALL_OUT_RINGING, NULL);
                }
        }else{
                /*accept early media */
@@ -137,7 +138,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;
@@ -270,7 +271,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=lc->call;
 
        if (sal_op_get_user_pointer(op)!=lc->call){
index 945ea25eaa321191d2678d0b65c69b48dc27538a..e38f0373f178f41d867e2869f9dfc9a95def2bc8 100644 (file)
@@ -345,6 +345,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,
@@ -353,7 +354,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 {
index 591103154a2b3b70849a0f43f44838d354076859..bf4e0613a9929594346bd0c7555e3105beb6d7a2 100644 (file)
@@ -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);
+               }
        }
 }
 
index ba5730139614ceb3f80de28890d1d049e973fe0b..068a2aac50375f4a4be07cfbb3d65dc9d2de9ef6 100644 (file)
@@ -994,10 +994,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) {
@@ -1008,6 +1010,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)
        {
@@ -1054,6 +1065,9 @@ static bool_t call_failure(Sal *sal, eXosip_event_t *ev){
                        }else error=SalErrorNoResponse;
        }
        sal->callbacks.call_failure(op,error,sr,reason);
+       if (computedReason != NULL){
+               ms_free(computedReason);
+       }
        return TRUE;
 }