]> sjero.net Git - linphone/commitdiff
Merge branch 'master' of git.linphone.org:linphone-private
authorJehan Monnier <jehan.monnier@linphone.org>
Fri, 21 May 2010 13:58:31 +0000 (15:58 +0200)
committerJehan Monnier <jehan.monnier@linphone.org>
Fri, 21 May 2010 13:58:31 +0000 (15:58 +0200)
1  2 
coreapi/linphonecore.h
coreapi/sal_eXosip2.c

diff --combined coreapi/linphonecore.h
index e38f0373f178f41d867e2869f9dfc9a95def2bc8,39606ae3540b98cef324cf4610fc42b925f11b8e..1c4b4d6cb1b9560277ec72d4e093cbc227ea2187
@@@ -1,6 -1,6 +1,6 @@@
  /*
  linphone
- Copyright (C) 2000  Simon MORLAT (simon.morlat@linphone.org)
+ Copyright (C) 2000 - 2010 Simon MORLAT (simon.morlat@linphone.org)
  
  This program is free software; you can redistribute it and/or
  modify it under the terms of the GNU General Public License
@@@ -64,6 -64,7 +64,7 @@@ LinphoneAddress * linphone_address_new(
  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);
@@@ -127,6 -128,8 +128,8 @@@ typedef struct _LinphoneCallLog
        int duration; /**<Duration of the call in seconds*/
        char *refkey;
        void *user_pointer;
+       rtp_stats_t local_stats;
+       rtp_stats_t remote_stats;
        struct _LinphoneCore *lc;
  } LinphoneCallLog;
  
@@@ -137,6 -140,8 +140,8 @@@ void linphone_call_log_set_user_pointer
  void *linphone_call_log_get_user_pointer(const LinphoneCallLog *cl);
  void linphone_call_log_set_ref_key(LinphoneCallLog *cl, const char *refkey);
  const char *linphone_call_log_get_ref_key(const LinphoneCallLog *cl);
+ const rtp_stats_t *linphone_call_log_get_local_stats(const LinphoneCallLog *cl);
+ const rtp_stats_t *linphone_call_log_get_remote_stats(const LinphoneCallLog *cl);
  char * linphone_call_log_to_str(LinphoneCallLog *cl);
  
  typedef enum{
@@@ -345,7 -350,6 +350,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,
    GSTATE_CALL_IN_CONNECTED,
    GSTATE_CALL_END,
    GSTATE_CALL_ERROR,
 -  GSTATE_INVALID
 +  GSTATE_INVALID,
 +  GSTATE_CALL_OUT_RINGING /*remote ringing*/
  } gstate_t;
  
  struct _LinphoneGeneralState {
@@@ -787,6 -790,8 +792,8 @@@ void linphone_core_destroy(LinphoneCor
  /*for advanced users:*/
  void linphone_core_set_audio_transports(LinphoneCore *lc, RtpTransport *rtp, RtpTransport *rtcp);
  
+ int linphone_core_get_current_call_stats(LinphoneCore *lc, rtp_stats_t *local, rtp_stats_t *remote);
  #ifdef __cplusplus
  }
  #endif
diff --combined coreapi/sal_eXosip2.c
index 068a2aac50375f4a4be07cfbb3d65dc9d2de9ef6,d9612fe11ceb5eb5ebc0ba5827d23aedc41710a2..990cae0dc0d47e8af15fcd0fa5acb4f1d225cd0d
@@@ -994,12 -994,10 +994,12 @@@ static void authentication_ok(Sal *sal
  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) {
        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)
        {
                        }else error=SalErrorNoResponse;
        }
        sal->callbacks.call_failure(op,error,sr,reason);
 +      if (computedReason != NULL){
 +              ms_free(computedReason);
 +      }
        return TRUE;
  }
  
@@@ -1589,7 -1575,17 +1589,17 @@@ 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_free(from);
                return NULL;
        }
+       sal_address_quote_displayname ((SalAddress*)from);
        return (SalAddress*)from;
  }
  
@@@ -1619,6 -1616,18 +1630,18 @@@ const char *sal_address_get_display_nam
        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);
@@@ -1635,8 -1644,10 +1658,10 @@@ void sal_address_set_display_name(SalAd
                osip_free(u->displayname);
                u->displayname=NULL;
        }
-       if (display_name!=NULL)
+       if (display_name!=NULL && display_name[0]!='\0'){
                u->displayname=osip_strdup(display_name);
+               sal_address_quote_displayname(addr);
+       }
  }
  
  void sal_address_set_username(SalAddress *addr, const char *username){