Commit 9df45abe authored by Simon Morlat's avatar Simon Morlat
Browse files

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

parents 5f3a41e6 aa5f676d
......@@ -63,6 +63,7 @@ cd /c/sources
Building belle-sip
******************
* make sure that java version 1.6 is available in the PATH. java-1.7 will not work with antlr generator.
* download the sources with msys-git shell using the following command:
$ git clone git://git.linphone.org/belle-sip.git
* compile and install
......
......@@ -378,6 +378,8 @@ void linphone_core_remove_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *in
/**
* Returns an unmodifiable list of currently entered LinphoneAuthInfo.
* @param[in] lc The LinphoneCore object
* @return \mslist{LinphoneAuthInfo}
**/
const MSList *linphone_core_get_auth_info_list(const LinphoneCore *lc){
return lc->auth_info;
......
......@@ -843,8 +843,8 @@ static void register_success(SalOp *op, bool_t registered){
LinphoneProxyConfig *cfg=(LinphoneProxyConfig*)sal_op_get_user_pointer(op);
char *msg;
if (!cfg || cfg->deletion_date!=0){
ms_message("Registration success for removed proxy config, ignored");
if (!cfg){
ms_message("Registration success for deleted proxy config, ignored");
return;
}
linphone_proxy_config_set_state(cfg, registered ? LinphoneRegistrationOk : LinphoneRegistrationCleared ,
......@@ -868,10 +868,6 @@ static void register_failure(SalOp *op){
ms_warning("Registration failed for unknown proxy config.");
return ;
}
if (cfg->deletion_date!=0){
ms_message("Registration failed for removed proxy config, ignored");
return;
}
if (details==NULL)
details=_("no response timeout");
......
......@@ -246,8 +246,8 @@ bool_t linphone_core_chat_enabled(const LinphoneCore *lc){
/**
* Returns an list of chat rooms
* @param lc #LinphoneCore object
* @return A list of #LinphoneChatRoom
* @param[in] lc #LinphoneCore object
* @return \mslist{LinphoneChatRoom}
**/
MSList* linphone_core_get_chat_rooms(LinphoneCore *lc) {
return lc->chatrooms;
......
......@@ -34,7 +34,7 @@ DETAILS_AT_TOP = NO
INHERIT_DOCS = YES
DISTRIBUTE_GROUP_DOC = NO
TAB_SIZE = 8
ALIASES =
ALIASES = mslist{1}="A list of \ref \1 objects. \xmlonly <mslist>\1</mslist> \endxmlonly"
OPTIMIZE_OUTPUT_FOR_C = YES
OPTIMIZE_OUTPUT_JAVA = NO
SUBGROUPING = YES
......
......@@ -236,6 +236,14 @@ static MSList *make_codec_list(LinphoneCore *lc, const MSList *codecs, int bandw
for(it=codecs;it!=NULL;it=it->next){
PayloadType *pt=(PayloadType*)it->data;
if (pt->flags & PAYLOAD_TYPE_ENABLED){
int sample_rate = payload_type_get_rate(pt);
if( strcasecmp("G722",pt->mime_type) == 0 ){
/* G722 spec says 8000 but the codec actually requires 16000 */
ms_debug("Correcting sample rate for G722");
sample_rate = 16000;
}
if (bandwidth_limit>0 && !linphone_core_is_payload_type_usable_for_bandwidth(lc,pt,bandwidth_limit)){
ms_message("Codec %s/%i eliminated because of audio bandwidth constraint of %i kbit/s",
pt->mime_type,pt->clock_rate,bandwidth_limit);
......@@ -244,7 +252,7 @@ static MSList *make_codec_list(LinphoneCore *lc, const MSList *codecs, int bandw
if (linphone_core_check_payload_type_usability(lc,pt)){
l=ms_list_append(l,payload_type_clone(pt));
nb++;
if (max_sample_rate && payload_type_get_rate(pt)>*max_sample_rate) *max_sample_rate=payload_type_get_rate(pt);
if (max_sample_rate && sample_rate>*max_sample_rate) *max_sample_rate=sample_rate;
}
}
if ((nb_codecs_limit > 0) && (nb >= nb_codecs_limit)) break;
......@@ -305,7 +313,7 @@ static void setup_encryption_keys(LinphoneCall *call, SalMediaDescription *md){
for(i=0; i<md->nb_streams; i++) {
if (!sal_stream_description_active(&md->streams[i])) continue;
if (sal_stream_description_has_srtp(&md->streams[i]) == TRUE) {
if (keep_srtp_keys && old_md && sal_stream_description_has_srtp(&old_md->streams[i]) == TRUE){
if (keep_srtp_keys && old_md && (sal_stream_description_active(&old_md->streams[i]) == TRUE) && (sal_stream_description_has_srtp(&old_md->streams[i]) == TRUE)) {
int j;
ms_message("Keeping same crypto keys.");
for(j=0;j<SAL_CRYPTO_ALGO_MAX;++j){
......@@ -562,8 +570,6 @@ static void port_config_set(LinphoneCall *call, int stream_index, int min_port,
static void linphone_call_init_common(LinphoneCall *call, LinphoneAddress *from, LinphoneAddress *to){
int min_port, max_port;
ms_message("New LinphoneCall [%p] initialized (LinphoneCore version: %s)",call,linphone_core_get_version());
call->magic=linphone_call_magic;
call->refcnt=1;
call->state=LinphoneCallIdle;
call->transfer_state = LinphoneCallIdle;
call->media_start_time=0;
......@@ -639,13 +645,79 @@ static void linphone_call_outgoing_select_ip_version(LinphoneCall *call, Linphon
}else call->af=AF_INET;
}
/**
* Fill the local ip that routes to the internet according to the destination, or guess it by other special means (upnp).
*/
static void linphone_call_get_local_ip(LinphoneCall *call, const LinphoneAddress *remote_addr){
const char *ip;
int af = call->af;
const char *dest = NULL;
if (call->dest_proxy == NULL) {
struct addrinfo hints;
struct addrinfo *res = NULL;
int err;
const char *domain = linphone_address_get_domain(remote_addr);
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_DGRAM;
hints.ai_flags = AI_NUMERICHOST;
err = getaddrinfo(domain, NULL, &hints, &res);
if (err == 0) {
dest = domain;
}
}
if (linphone_core_get_firewall_policy(call->core)==LinphonePolicyUseNatAddress
&& (ip=linphone_core_get_nat_address_resolved(call->core))!=NULL){
strncpy(call->localip,ip,LINPHONE_IPADDR_SIZE);
return;
}
#ifdef BUILD_UPNP
else if (call->core->upnp != NULL && linphone_core_get_firewall_policy(call->core)==LinphonePolicyUseUpnp &&
linphone_upnp_context_get_state(call->core->upnp) == LinphoneUpnpStateOk) {
ip = linphone_upnp_context_get_external_ipaddress(call->core->upnp);
strncpy(call->localip,ip,LINPHONE_IPADDR_SIZE);
return;
}
#endif //BUILD_UPNP
if (af==AF_UNSPEC){
if (linphone_core_ipv6_enabled(call->core)){
bool_t has_ipv6;
has_ipv6=linphone_core_get_local_ip_for(AF_INET6,dest,call->localip)==0;
if (strcmp(call->localip,"::1")!=0)
return; /*this machine has real ipv6 connectivity*/
if (linphone_core_get_local_ip_for(AF_INET,dest,call->localip)==0 && strcmp(call->localip,"127.0.0.1")!=0)
return; /*this machine has only ipv4 connectivity*/
if (has_ipv6){
/*this machine has only local loopback for both ipv4 and ipv6, so prefer ipv6*/
strncpy(call->localip,"::1",LINPHONE_IPADDR_SIZE);
return;
}
}
/*in all other cases use IPv4*/
af=AF_INET;
}
if (linphone_core_get_local_ip_for(af,dest,call->localip)==0)
return;
}
static void linphone_call_destroy(LinphoneCall *obj);
BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphoneCall);
BELLE_SIP_INSTANCIATE_VPTR(LinphoneCall, belle_sip_object_t,
(belle_sip_object_destroy_t)linphone_call_destroy,
NULL, // clone
NULL, // marshal
FALSE
);
LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, LinphoneAddress *from, LinphoneAddress *to, const LinphoneCallParams *params, LinphoneProxyConfig *cfg){
LinphoneCall *call=ms_new0(LinphoneCall,1);
LinphoneCall *call = belle_sip_object_new(LinphoneCall);
call->dir=LinphoneCallOutgoing;
call->core=lc;
linphone_call_outgoing_select_ip_version(call,to,cfg);
linphone_core_get_local_ip(lc,call->af,call->localip);
linphone_call_get_local_ip(call, to);
linphone_call_init_common(call,from,to);
_linphone_call_params_copy(&call->params,params);
......@@ -700,7 +772,7 @@ void linphone_call_set_compatible_incoming_call_parameters(LinphoneCall *call, c
}
LinphoneCall * linphone_call_new_incoming(LinphoneCore *lc, LinphoneAddress *from, LinphoneAddress *to, SalOp *op){
LinphoneCall *call=ms_new0(LinphoneCall,1);
LinphoneCall *call = belle_sip_object_new(LinphoneCall);
const SalMediaDescription *md;
LinphoneFirewallPolicy fpol;
......@@ -731,7 +803,7 @@ LinphoneCall * linphone_call_new_incoming(LinphoneCore *lc, LinphoneAddress *fro
}
linphone_address_clean(from);
linphone_core_get_local_ip(lc,call->af,call->localip);
linphone_call_get_local_ip(call, from);
linphone_call_init_common(call, from, to);
call->log->call_id=ms_strdup(sal_op_get_call_id(op)); /*must be known at that time*/
call->dest_proxy = linphone_core_lookup_known_proxy(call->core, to);
......@@ -991,7 +1063,6 @@ static void linphone_call_destroy(LinphoneCall *obj)
linphone_call_params_uninit(&obj->params);
linphone_call_params_uninit(&obj->current_params);
sal_error_info_reset(&obj->non_op_error);
ms_free(obj);
}
/**
......@@ -999,27 +1070,13 @@ static void linphone_call_destroy(LinphoneCall *obj)
* @{
**/
/**
* Increments the call 's reference count.
* An application that wishes to retain a pointer to call object
* must use this function to unsure the pointer remains
* valid. Once the application no more needs this pointer,
* it must call linphone_call_unref().
**/
LinphoneCall * linphone_call_ref(LinphoneCall *obj){
obj->refcnt++;
belle_sip_object_ref(obj);
return obj;
}
/**
* Decrements the call object reference count.
* See linphone_call_ref().
**/
void linphone_call_unref(LinphoneCall *obj){
obj->refcnt--;
if (obj->refcnt==0){
linphone_call_destroy(obj);
}
belle_sip_object_unref(obj);
}
/**
......@@ -1146,7 +1203,7 @@ const LinphoneErrorInfo *linphone_call_get_error_info(const LinphoneCall *call){
*
* return user_pointer an opaque user pointer that can be retrieved at any time
**/
void *linphone_call_get_user_pointer(LinphoneCall *call)
void *linphone_call_get_user_data(const LinphoneCall *call)
{
return call->user_pointer;
}
......@@ -1158,7 +1215,7 @@ void *linphone_call_get_user_pointer(LinphoneCall *call)
*
* the user_pointer is an opaque user pointer that can be retrieved at any time in the LinphoneCall
**/
void linphone_call_set_user_pointer(LinphoneCall *call, void *user_pointer)
void linphone_call_set_user_data(LinphoneCall *call, void *user_pointer)
{
call->user_pointer = user_pointer;
}
......@@ -1342,17 +1399,17 @@ void linphone_call_params_enable_video(LinphoneCallParams *cp, bool_t enabled){
}
/**
* Returns the audio codec used in the call, described as a PayloadType structure.
* Returns the audio codec used in the call, described as a LinphonePayloadType structure.
**/
const PayloadType* linphone_call_params_get_used_audio_codec(const LinphoneCallParams *cp) {
const LinphonePayloadType* linphone_call_params_get_used_audio_codec(const LinphoneCallParams *cp) {
return cp->audio_codec;
}
/**
* Returns the video codec used in the call, described as a PayloadType structure.
* Returns the video codec used in the call, described as a LinphonePayloadType structure.
**/
const PayloadType* linphone_call_params_get_used_video_codec(const LinphoneCallParams *cp) {
const LinphonePayloadType* linphone_call_params_get_used_video_codec(const LinphoneCallParams *cp) {
return cp->video_codec;
}
......@@ -1679,6 +1736,7 @@ int linphone_call_prepare_ice(LinphoneCall *call, bool_t incoming_offer){
void linphone_call_init_audio_stream(LinphoneCall *call){
LinphoneCore *lc=call->core;
AudioStream *audiostream;
const char *location;
int dscp;
if (call->audiostream != NULL) return;
......@@ -1702,6 +1760,13 @@ void linphone_call_init_audio_stream(LinphoneCall *call){
else if (strcasecmp(type,"full")==0)
audio_stream_enable_echo_limiter(audiostream,ELControlFull);
}
/* equalizer location in the graph: 'mic' = in input graph, otherwise in output graph.
Any other value than mic will default to output graph for compatibility */
location = lp_config_get_string(lc->config,"sound","eq_location","hp");
audiostream->eq_loc = (strcasecmp(location,"mic") == 0) ? MSEqualizerMic : MSEqualizerHP;
ms_error("Equalizer location: %s", location);
audio_stream_enable_gain_control(audiostream,TRUE);
if (linphone_core_echo_cancellation_enabled(lc)){
int len,delay,framesize;
......@@ -2257,7 +2322,7 @@ static void linphone_call_start_video_stream(LinphoneCall *call, const char *cna
}
}else ms_warning("No video stream accepted.");
}else{
ms_warning("No valid video stream defined.");
ms_message("No valid video stream defined.");
}
#endif
}
......
......@@ -288,14 +288,14 @@ const char *linphone_call_log_get_call_id(const LinphoneCallLog *cl){
/**
* Assign a user pointer to the call log.
**/
void linphone_call_log_set_user_pointer(LinphoneCallLog *cl, void *up){
void linphone_call_log_set_user_data(LinphoneCallLog *cl, void *up){
cl->user_pointer=up;
}
/**
* Returns the user pointer associated with the call log.
**/
void *linphone_call_log_get_user_pointer(const LinphoneCallLog *cl){
void *linphone_call_log_get_user_data(const LinphoneCallLog *cl){
return cl->user_pointer;
}
......@@ -1466,6 +1466,8 @@ LinphoneCore *linphone_core_new_with_config(const LinphoneCoreVTable *vtable, st
/**
* Returns the list of available audio codecs.
* @param[in] lc The LinphoneCore object
* @return \mslist{PayloadType}
*
* This list is unmodifiable. The ->data field of the MSList points a PayloadType
* structure holding the codec information.
......@@ -1480,6 +1482,8 @@ const MSList *linphone_core_get_audio_codecs(const LinphoneCore *lc)
/**
* Returns the list of available video codecs.
* @param[in] lc The LinphoneCore object
* @return \mslist{PayloadType}
*
* This list is unmodifiable. The ->data field of the MSList points a PayloadType
* structure holding the codec information.
......@@ -1518,44 +1522,6 @@ int linphone_core_set_primary_contact(LinphoneCore *lc, const char *contact)
}
/*Returns the local ip that routes to the internet, or guessed by other special means (upnp)*/
/*result must be an array of chars at least LINPHONE_IPADDR_SIZE */
void linphone_core_get_local_ip(LinphoneCore *lc, int af, char *result){
const char *ip;
if (linphone_core_get_firewall_policy(lc)==LinphonePolicyUseNatAddress
&& (ip=linphone_core_get_nat_address_resolved(lc))!=NULL){
strncpy(result,ip,LINPHONE_IPADDR_SIZE);
return;
}
#ifdef BUILD_UPNP
else if (lc->upnp != NULL && linphone_core_get_firewall_policy(lc)==LinphonePolicyUseUpnp &&
linphone_upnp_context_get_state(lc->upnp) == LinphoneUpnpStateOk) {
ip = linphone_upnp_context_get_external_ipaddress(lc->upnp);
strncpy(result,ip,LINPHONE_IPADDR_SIZE);
return;
}
#endif //BUILD_UPNP
if (af==AF_UNSPEC){
if (linphone_core_ipv6_enabled(lc)){
bool_t has_ipv6;
has_ipv6=linphone_core_get_local_ip_for(AF_INET6,NULL,result)==0;
if (strcmp(result,"::1")!=0)
return; /*this machine has real ipv6 connectivity*/
if (linphone_core_get_local_ip_for(AF_INET,NULL,result)==0 && strcmp(result,"127.0.0.1")!=0)
return; /*this machine has only ipv4 connectivity*/
if (has_ipv6){
/*this machine has only local loopback for both ipv4 and ipv6, so prefer ipv6*/
strncpy(result,"::1",LINPHONE_IPADDR_SIZE);
return;
}
}
/*in all other cases use IPv4*/
af=AF_INET;
}
if (linphone_core_get_local_ip_for(af,NULL,result)==0)
return;
}
static void update_primary_contact(LinphoneCore *lc){
char *guessed=NULL;
char tmp[LINPHONE_IPADDR_SIZE];
......@@ -1570,7 +1536,7 @@ static void update_primary_contact(LinphoneCore *lc){
ms_error("Could not parse identity contact !");
url=linphone_address_new("sip:unknown@unkwownhost");
}
linphone_core_get_local_ip(lc, AF_UNSPEC, tmp);
linphone_core_get_local_ip_for(AF_UNSPEC, NULL, tmp);
if (strcmp(tmp,"127.0.0.1")==0 || strcmp(tmp,"::1")==0 ){
ms_warning("Local loopback network only !");
lc->sip_conf.loopback_only=TRUE;
......@@ -1631,6 +1597,9 @@ LinphoneAddress *linphone_core_get_primary_contact_parsed(LinphoneCore *lc){
/**
* Sets the list of audio codecs.
* @param[in] lc The LinphoneCore object
* @param[in] codecs \mslist{PayloadType}
* @return 0
*
* @ingroup media_parameters
* The list is taken by the LinphoneCore thus the application should not free it.
......@@ -1646,6 +1615,9 @@ int linphone_core_set_audio_codecs(LinphoneCore *lc, MSList *codecs)
/**
* Sets the list of video codecs.
* @param[in] lc The LinphoneCore object
* @param[in] codecs \mslist{PayloadType}
* @return 0
*
* @ingroup media_parameters
* The list is taken by the LinphoneCore thus the application should not free it.
......@@ -2160,7 +2132,7 @@ static void monitor_network_state(LinphoneCore *lc, time_t curtime){
/* only do the network up checking every five seconds */
if (lc->network_last_check==0 || (curtime-lc->network_last_check)>=5){
linphone_core_get_local_ip(lc,AF_UNSPEC,newip);
linphone_core_get_local_ip_for(AF_UNSPEC,NULL,newip);
if (strcmp(newip,"::1")!=0 && strcmp(newip,"127.0.0.1")!=0){
new_status=TRUE;
}else new_status=FALSE; /*no network*/
......@@ -2190,9 +2162,10 @@ static void proxy_update(LinphoneCore *lc){
for(elem=lc->sip_conf.deleted_proxies;elem!=NULL;elem=next){
LinphoneProxyConfig* cfg = (LinphoneProxyConfig*)elem->data;
next=elem->next;
if (ms_time(NULL) - cfg->deletion_date > 5) {
if (ms_time(NULL) - cfg->deletion_date > 32) {
lc->sip_conf.deleted_proxies =ms_list_remove_link(lc->sip_conf.deleted_proxies,elem);
ms_message("clearing proxy config for [%s]",linphone_proxy_config_get_addr(cfg));
ms_message("Proxy config for [%s] is definitely removed from core.",linphone_proxy_config_get_addr(cfg));
_linphone_proxy_config_release_ops(cfg);
linphone_proxy_config_destroy(cfg);
}
}
......@@ -3279,6 +3252,7 @@ int linphone_core_update_call(LinphoneCore *lc, LinphoneCall *call, const Linpho
#ifdef VIDEO_ENABLED
if ((call->videostream != NULL) && (call->state == LinphoneCallStreamsRunning)) {
video_stream_set_sent_video_size(call->videostream,linphone_core_get_preferred_video_size(lc));
video_stream_set_fps(call->videostream, linphone_core_get_preferred_framerate(lc));
if (call->camera_enabled && call->videostream->cam!=lc->video_conf.device){
video_stream_change_camera(call->videostream,lc->video_conf.device);
}else video_stream_update_video_params(call->videostream);
......@@ -3671,6 +3645,8 @@ int linphone_core_terminate_all_calls(LinphoneCore *lc){
/**
* Returns the current list of calls.
* @param[in] lc The LinphoneCore object
* @return \mslist{LinphoneCall}
*
* Note that this list is read-only and might be changed by the core after a function call to linphone_core_iterate().
* Similarly the LinphoneCall objects inside it might be destroyed without prior notice.
......@@ -4813,6 +4789,8 @@ LinphoneFirewallPolicy linphone_core_get_firewall_policy(const LinphoneCore *lc)
/**
* Get the list of call logs (past calls).
* @param[in] lc The LinphoneCore object
* @return \mslist{LinphoneCallLog}
*
* @ingroup call_logs
**/
......@@ -6260,8 +6238,8 @@ static PayloadType* find_payload_type_from_list(const char* type, int rate, int
}
PayloadType* linphone_core_find_payload_type(LinphoneCore* lc, const char* type, int rate, int channels) {
PayloadType* result = find_payload_type_from_list(type, rate, channels, linphone_core_get_audio_codecs(lc));
LinphonePayloadType* linphone_core_find_payload_type(LinphoneCore* lc, const char* type, int rate, int channels) {
LinphonePayloadType* result = find_payload_type_from_list(type, rate, channels, linphone_core_get_audio_codecs(lc));
if (result) {
return result;
} else {
......@@ -6304,6 +6282,19 @@ LinphoneCallParams *linphone_core_create_default_call_parameters(LinphoneCore *l
return p;
}
/**
* Create a LinphoneCallParams suitable for linphone_core_invite_with_params(), linphone_core_accept_call_with_params(), linphone_core_accept_early_media_with_params(),
* linphone_core_accept_call_update().
* The parameters are initialized according to the current LinphoneCore configuration and the current state of the LinphoneCall.
* @param lc the LinphoneCore
* @param call the call for which the parameters are to be build, or NULL in the case where the parameters are to be used for a new outgoing call.
* @return a new LinphoneCallParams
*/
LinphoneCallParams *linphone_core_create_call_params(LinphoneCore *lc, LinphoneCall *call){
if (!call) return linphone_core_create_default_call_parameters(lc);
return linphone_call_params_copy(&call->params);
}
const char *linphone_reason_to_string(LinphoneReason err){
switch(err){
case LinphoneReasonNone:
......@@ -6714,3 +6705,20 @@ bool_t linphone_core_sdp_200_ack_enabled(const LinphoneCore *lc) {
void linphone_core_set_file_transfer_server(LinphoneCore *core, const char * server_url) {
core->file_transfer_server=ms_strdup(server_url);
}
int linphone_payload_type_get_type(const LinphonePayloadType *pt) {
return pt->type;
}
int linphone_payload_type_get_normal_bitrate(const LinphonePayloadType *pt) {
return pt->normal_bitrate;
}
char * linphone_payload_type_get_mime_type(const LinphonePayloadType *pt) {
return pt->mime_type;
}
int linphone_payload_type_get_channels(const LinphonePayloadType *pt) {
return pt->channels;
}
......@@ -247,6 +247,48 @@ LinphoneDictionary* lp_config_section_to_dict( const LpConfig* lpconfig, const c
void lp_config_load_dict_to_section( LpConfig* lpconfig, const char* section, const LinphoneDictionary* dict);
/**
* @addtogroup media_parameters
* @{
**/
/**
* Object representing an RTP payload type.
*/
typedef PayloadType LinphonePayloadType;
/**
* Get the type of payload.
* @param[in] pt LinphonePayloadType object
* @return The type of payload.
*/
LINPHONE_PUBLIC int linphone_payload_type_get_type(const LinphonePayloadType *pt);
/**
* Get the normal bitrate in bits/s.
* @param[in] pt LinphonePayloadType object
* @return The normal bitrate in bits/s.
*/
LINPHONE_PUBLIC int linphone_payload_type_get_normal_bitrate(const LinphonePayloadType *pt);
/**
* Get the mime type.
* @param[in] pt LinphonePayloadType object
* @return The mime type.
*/
LINPHONE_PUBLIC char * linphone_payload_type_get_mime_type(const LinphonePayloadType *pt);
/**
* Get the number of channels.
* @param[in] pt LinphonePayloadType object
* @return The number of channels.
*/
LINPHONE_PUBLIC int linphone_payload_type_get_channels(const LinphonePayloadType *pt);
/**
* @}
**/
#ifdef IN_LINPHONE
#include "linphonefriend.h"
#include "event.h"
......@@ -356,8 +398,12 @@ LINPHONE_PUBLIC bool_t linphone_call_log_video_enabled(LinphoneCallLog *cl);
LINPHONE_PUBLIC time_t linphone_call_log_get_start_date(LinphoneCallLog *cl);
LINPHONE_PUBLIC int linphone_call_log_get_duration(LinphoneCallLog *cl);
LINPHONE_PUBLIC float linphone_call_log_get_quality(LinphoneCallLog *cl);
LINPHONE_PUBLIC void linphone_call_log_set_user_pointer(LinphoneCallLog *cl, void *up);
LINPHONE_PUBLIC void *linphone_call_log_get_user_pointer(const LinphoneCallLog *cl);
/** @deprecated Use linphone_call_log_set_user_data() instead. */
#define linphone_call_log_set_user_pointer(cl, ud) linphone_call_log_set_user_data(cl, ud)
LINPHONE_PUBLIC void linphone_call_log_set_user_data(LinphoneCallLog *cl, void *up);
/** @deprecated Use linphone_call_log_get_user_data() instead. */
#define linphone_call_log_get_user_pointer(cl) linphone_call_log_get_user_data(cl)
LINPHONE_PUBLIC void *linphone_call_log_get_user_data(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);
LINPHONE_PUBLIC const rtp_stats_t *linphone_call_log_get_local_stats(const LinphoneCallLog *cl);
......@@ -379,8 +425,8 @@ struct _LinphoneCallParams;
**/
typedef struct _LinphoneCallParams LinphoneCallParams;
LINPHONE_PUBLIC const PayloadType* linphone_call_params_get_used_audio_codec(const LinphoneCallParams *cp);
LINPHONE_PUBLIC const PayloadType* linphone_call_params_get_used_video_codec(const LinphoneCallParams *cp);
LINPHONE_PUBLIC const LinphonePayloadType* linphone_call_params_get_used_audio_codec(const LinphoneCallParams *cp);
LINPHONE_PUBLIC const LinphonePayloadType* linphone_call_params_get_used_video_codec(const LinphoneCallParams *cp);
LINPHONE_PUBLIC LinphoneCallParams * linphone_call_params_copy(const LinphoneCallParams *cp);
LINPHONE_PUBLIC void linphone_call_params_enable_video(LinphoneCallParams *cp, bool_t enabled);
LINPHONE_PUBLIC bool_t linphone_call_params_video_enabled(const LinphoneCallParams *cp);
......@@ -683,6 +729,41 @@ typedef enum _LinphoneCallState{
LINPHONE_PUBLIC const char *linphone_call_state_to_string(LinphoneCallState cs);
/**
* Acquire a reference to the call.
* An application that wishes to retain a pointer to call object
* must use this function to unsure the pointer remains
* valid. Once the application no more needs this pointer,
* it must call linphone_call_unref().
* @param[in] call The call.
* @return The same call.
* @ingroup call_control
**/
LINPHONE_PUBLIC LinphoneCall *linphone_call_ref(LinphoneCall *call);
/**
* Release reference to the call.
* @param[in] call The call.
* @ingroup call_control
**/
LINPHONE_PUBLIC void