Commit bb0f07f6 authored by Simon Morlat's avatar Simon Morlat

add info api

refactor selection of proxy, identity, configurations of op
fix bug when automatically restarting a call after a 415 due to srtp
parent cc0b90e9
......@@ -45,6 +45,7 @@ liblinphone_la_SOURCES=\
ec-calibrator.c \
conference.c \
message_storage.c \
info.c \
$(GITVERSION_FILE)
if BUILD_UPNP
......@@ -52,16 +53,17 @@ liblinphone_la_SOURCES+=upnp.c upnp.h
endif
if USE_BELLESIP
liblinphone_la_SOURCES+= bellesip_sal/sal_address_impl.c \
bellesip_sal/sal_impl.c \
bellesip_sal/sal_op_impl.c \
bellesip_sal/sal_op_call.c \
bellesip_sal/sal_op_registration.c \
bellesip_sal/sal_sdp.c \
bellesip_sal/sal_op_message.c \
bellesip_sal/sal_op_presence.c \
bellesip_sal/sal_op_publish.c \
bellesip_sal/sal_op_call_transfer.c
liblinphone_la_SOURCES+= bellesip_sal/sal_address_impl.c \
bellesip_sal/sal_impl.c \
bellesip_sal/sal_op_impl.c \
bellesip_sal/sal_op_call.c \
bellesip_sal/sal_op_registration.c \
bellesip_sal/sal_sdp.c \
bellesip_sal/sal_op_message.c \
bellesip_sal/sal_op_presence.c \
bellesip_sal/sal_op_publish.c \
bellesip_sal/sal_op_call_transfer.c \
bellesip_sal/sal_op_info.c
else
liblinphone_la_SOURCES+= sal_eXosip2.c sal_eXosip2.h\
sal_eXosip2_sdp.c \
......
......@@ -53,16 +53,18 @@ void _belle_sip_log(belle_sip_log_level lev, const char *fmt, va_list args) {
void sal_enable_logs(){
belle_sip_set_log_level(BELLE_SIP_LOG_MESSAGE);
}
void sal_disable_logs() {
belle_sip_set_log_level(BELLE_SIP_LOG_ERROR);
}
void sal_add_pending_auth(Sal *sal, SalOp *op){
if (ms_list_find(sal->pending_auths,op)==NULL){
sal->pending_auths=ms_list_append(sal->pending_auths,sal_op_ref(op));
}
}
void sal_remove_pending_auth(Sal *sal, SalOp *op){
void sal_remove_pending_auth(Sal *sal, SalOp *op){
if (ms_list_find(sal->pending_auths,op)){
sal->pending_auths=ms_list_remove(sal->pending_auths,op);
sal_op_unref(op);
......@@ -104,6 +106,7 @@ void sal_process_authentication(SalOp *op) {
}
}
static void process_dialog_terminated(void *sal, const belle_sip_dialog_terminated_event_t *event){
belle_sip_dialog_t* dialog = belle_sip_dialog_terminated_get_dialog(event);
SalOp* op = belle_sip_dialog_get_application_data(dialog);
......@@ -113,6 +116,7 @@ static void process_dialog_terminated(void *sal, const belle_sip_dialog_terminat
ms_error("sal process_dialog_terminated no op found for this dialog [%p], ignoring",dialog);
}
}
static void process_io_error(void *user_ctx, const belle_sip_io_error_event_t *event){
belle_sip_client_transaction_t*client_transaction;
SalOp* op;
......@@ -126,6 +130,7 @@ static void process_io_error(void *user_ctx, const belle_sip_io_error_event_t *e
ms_error("sal process_io_error not implemented yet for non transaction");
}
}
static void process_request_event(void *sal, const belle_sip_request_event_t *event) {
SalOp* op=NULL;
belle_sip_request_t* req = belle_sip_request_event_get_request(event);
......@@ -152,11 +157,14 @@ static void process_request_event(void *sal, const belle_sip_request_event_t *ev
op=sal_op_new((Sal*)sal);
op->dir=SalOpDirIncoming;
sal_op_message_fill_cbs(op);
} else if (strcmp("OPTIONS",belle_sip_request_get_method(req))==0) {
resp=belle_sip_response_create_from_request(req,200);
belle_sip_provider_send_response(((Sal*)sal)->prov,resp);
return;
}else if (strcmp("INFO",belle_sip_request_get_method(req))==0) {
op=sal_op_new((Sal*)sal);
op->dir=SalOpDirIncoming;
sal_op_info_fill_cbs(op);
}else {
ms_error("sal process_request_event not implemented yet for method [%s]",belle_sip_request_get_method(req));
resp=belle_sip_response_create_from_request(req,501);
......@@ -447,6 +455,8 @@ void sal_set_callbacks(Sal *ctx, const SalCallbacks *cbs){
ctx->callbacks.ping_reply=(SalOnPingReply)unimplemented_stub;
if (ctx->callbacks.auth_requested==NULL)
ctx->callbacks.auth_requested=(SalOnAuthRequested)unimplemented_stub;
if (ctx->callbacks.info_received==NULL)
ctx->callbacks.info_received=(SalOnInfoReceived)unimplemented_stub;
}
......@@ -739,10 +749,12 @@ const char *sal_custom_header_find(const SalCustomHeader *ch, const char *name){
}
void sal_custom_header_free(SalCustomHeader *ch){
if (ch==NULL) return;
belle_sip_object_unref((belle_sip_message_t*)ch);
}
SalCustomHeader *sal_custom_header_clone(const SalCustomHeader *ch){
if (ch==NULL) return NULL;
return (SalCustomHeader*)belle_sip_object_ref((belle_sip_message_t*)ch);
}
......
......@@ -52,6 +52,7 @@ typedef enum SalOpSate {
,SalOpStateTerminating /*this state is used to wait until a proceeding state, so we can send the cancel*/
,SalOpStateTerminated
}SalOpSate_t;
const char* sal_op_state_to_string(const SalOpSate_t value);
typedef enum SalOpDir {
......@@ -64,7 +65,8 @@ typedef enum SalOpType {
SalOpCall,
SalOpMessage,
SalOpPresence,
SalOpPublish
SalOpPublish,
SalOpInfo
}SalOpType_t;
const char* sal_op_type_to_string(const SalOpType_t type);
......@@ -121,7 +123,11 @@ void sal_compute_sal_errors_from_code(int code ,SalError* sal_err,SalReason* sal
void sal_op_presence_fill_cbs(SalOp*op);
/*messaging*/
void sal_op_message_fill_cbs(SalOp*op);
/*call transfert*/
/*info*/
void sal_op_info_fill_cbs(SalOp*op);
/*call transfer*/
void sal_op_process_refer(SalOp *op, const belle_sip_request_event_t *event);
void sal_op_call_process_notify(SalOp *op, const belle_sip_request_event_t *event);
/*create SalAuthInfo by copying username and realm from suth event*/
......
......@@ -621,7 +621,7 @@ static void call_failure(SalOp *op, SalError error, SalReason sr, const char *de
call->localdesc->streams[i].proto = SalProtoRtpAvp;
memset(call->localdesc->streams[i].crypto, 0, sizeof(call->localdesc->streams[i].crypto));
}
linphone_core_start_invite(lc, call);
linphone_core_restart_invite(lc, call);
}
return;
}
......@@ -973,6 +973,7 @@ static LinphoneChatMessageState chatStatusSal2Linphone(SalTextDeliveryStatus sta
static int op_equals(LinphoneCall *a, SalOp *b) {
return a->op !=b; /*return 0 if equals*/
}
static void text_delivery_update(SalOp *op, SalTextDeliveryStatus status){
LinphoneChatMessage *chat_msg=(LinphoneChatMessage* )sal_op_get_user_pointer(op);
const MSList* calls = linphone_core_get_calls(chat_msg->chat_room->lc);
......@@ -995,6 +996,11 @@ static void text_delivery_update(SalOp *op, SalTextDeliveryStatus status){
}
}
static void info_received(SalOp *op, const SalBody *body){
LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(op));
linphone_core_notify_info_message(lc,op,body);
}
SalCallbacks linphone_sal_callbacks={
call_received,
call_ringing,
......@@ -1023,7 +1029,8 @@ SalCallbacks linphone_sal_callbacks={
subscribe_received,
subscribe_closed,
ping_reply,
auth_requested
auth_requested,
info_received
};
......@@ -65,7 +65,6 @@ void linphone_chat_room_destroy(LinphoneChatRoom *cr){
static void _linphone_chat_room_send_message(LinphoneChatRoom *cr, LinphoneChatMessage* msg){
MSList *routes=NULL;
SalOp *op=NULL;
LinphoneCall *call;
char* content_type;
......@@ -88,18 +87,14 @@ static void _linphone_chat_room_send_message(LinphoneChatRoom *cr, LinphoneChatM
}
msg->time=t;
if (op==NULL){
LinphoneProxyConfig *proxy=linphone_core_lookup_known_proxy(cr->lc,cr->peer_url,&routes);
LinphoneProxyConfig *proxy=linphone_core_lookup_known_proxy(cr->lc,cr->peer_url);
if (proxy){
identity=linphone_proxy_config_get_identity(proxy);
}else identity=linphone_core_get_primary_contact(cr->lc);
/*sending out of calls*/
op = sal_op_new(cr->lc->sal);
linphone_transfer_routes_to_op(routes,op);
linphone_configure_op(cr->lc,op,cr->peer_url,msg->custom_headers,FALSE);
sal_op_set_user_pointer(op, msg); /*if out of call, directly store msg*/
if (msg->custom_headers){
sal_op_set_sent_custom_header(op,msg->custom_headers);
msg->custom_headers=NULL; /*transfered to the SalOp*/
}
}
if (msg->external_body_url) {
content_type=ms_strdup_printf("message/external-body; access-type=URL; URL=\"%s\"",msg->external_body_url);
......
......@@ -106,13 +106,11 @@ LinphoneFriend *linphone_find_friend_by_out_subscribe(MSList *l, SalOp *op){
void __linphone_friend_do_subscribe(LinphoneFriend *fr){
char *friend=NULL;
const char *route=NULL;
const char *from=NULL;
LinphoneProxyConfig *cfg;
MSList *routes=NULL;
friend=linphone_address_as_string(fr->uri);
cfg=linphone_core_lookup_known_proxy(fr->lc,linphone_friend_get_address(fr),&routes);
cfg=linphone_core_lookup_known_proxy(fr->lc,linphone_friend_get_address(fr));
if (cfg!=NULL){
from=linphone_proxy_config_get_identity(cfg);
}else from=linphone_core_get_primary_contact(fr->lc);
......@@ -129,12 +127,7 @@ void __linphone_friend_do_subscribe(LinphoneFriend *fr){
fr->outsub=NULL;
}
fr->outsub=sal_op_new(fr->lc->sal);
sal_op_set_route(fr->outsub,route);
if (cfg && cfg->op && sal_op_get_contact(cfg->op))
sal_op_set_contact(fr->outsub,sal_op_get_contact(cfg->op));
else
sal_op_set_contact(fr->outsub,NULL);
linphone_transfer_routes_to_op(routes,fr->outsub);
linphone_configure_op(fr->lc,fr->outsub,fr->uri,NULL,TRUE);
sal_subscribe_presence(fr->outsub,from,friend);
fr->subscribe_active=TRUE;
ms_free(friend);
......
......@@ -468,17 +468,23 @@ static void discover_mtu(LinphoneCore *lc, const char *remote){
}
}
LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, LinphoneAddress *from, LinphoneAddress *to, const LinphoneCallParams *params)
{
void linphone_call_create_op(LinphoneCall *call){
if (call->op) sal_op_release(call->op);
call->op=sal_op_new(call->core->sal);
sal_op_set_user_pointer(call->op,call);
if (call->params.referer)
sal_call_set_referer(call->op,call->params.referer->op);
linphone_configure_op(call->core,call->op,call->log->to,call->params.custom_headers,FALSE);
}
LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, LinphoneAddress *from, LinphoneAddress *to, const LinphoneCallParams *params, LinphoneProxyConfig *cfg){
LinphoneCall *call=ms_new0(LinphoneCall,1);
call->dir=LinphoneCallOutgoing;
call->op=sal_op_new(lc->sal);
sal_op_set_user_pointer(call->op,call);
call->core=lc;
linphone_core_get_local_ip(lc,NULL,call->localip);
linphone_call_init_common(call,from,to);
_linphone_call_params_copy(&call->params,params);
sal_op_set_sent_custom_header(call->op,call->params.custom_headers);
if (linphone_core_get_firewall_policy(call->core) == LinphonePolicyUseIce) {
call->ice_session = ice_session_new();
......@@ -498,9 +504,10 @@ LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, LinphoneAddr
discover_mtu(lc,linphone_address_get_domain (to));
if (params->referer){
sal_call_set_referer(call->op,params->referer->op);
call->referer=linphone_call_ref(params->referer);
}
call->dest_proxy=cfg;
linphone_call_create_op(call);
return call;
}
......@@ -2530,17 +2537,10 @@ void linphone_call_set_contact_op(LinphoneCall* call) {
#else
LinphoneAddress *contact;
#endif
LinphoneProxyConfig *cfg = NULL;
if (call->dest_proxy == NULL) {
/* Try to define the destination proxy if it has not already been done to have a correct contact field in the SIP messages */
linphone_core_get_default_proxy(call->core, &cfg);
call->dest_proxy = cfg;
call->dest_proxy = linphone_core_lookup_known_proxy(call->core, call->log->to, NULL);
if (cfg != call->dest_proxy && call->dest_proxy != NULL) {
ms_message("Overriding default proxy setting for this call:");
ms_message("The used identity will be %s", linphone_proxy_config_get_identity(call->dest_proxy));
}
call->dest_proxy = linphone_core_lookup_known_proxy(call->core, call->log->to);
}
contact=get_fixed_contact(call->core,call,call->dest_proxy);
......
......@@ -2050,7 +2050,7 @@ static void linphone_core_grab_buddy_infos(LinphoneCore *lc, LinphoneProxyConfig
for(elem=linphone_core_get_friend_list(lc);elem!=NULL;elem=elem->next){
LinphoneFriend *lf=(LinphoneFriend*)elem->data;
if (lf->info==NULL){
if (linphone_core_lookup_known_proxy(lc,lf->uri,NULL)==cfg){
if (linphone_core_lookup_known_proxy(lc,lf->uri)==cfg){
if (linphone_address_get_username(lf->uri)!=NULL){
BuddyLookupRequest *req;
char *tmp=linphone_address_as_string_uri_only(lf->uri);
......@@ -2363,7 +2363,7 @@ void linphone_core_notify_refer_state(LinphoneCore *lc, LinphoneCall *referer, L
system.
*/
static MSList *make_routes_for_proxy(LinphoneProxyConfig *proxy, const LinphoneAddress *addr){
static MSList *make_routes_for_proxy(LinphoneProxyConfig *proxy, const LinphoneAddress *dest){
MSList *ret=NULL;
const char *local_route=linphone_proxy_config_get_route(proxy);
const LinphoneAddress *srv_route=linphone_proxy_config_get_service_route(proxy);
......@@ -2380,8 +2380,8 @@ static MSList *make_routes_for_proxy(LinphoneProxyConfig *proxy, const LinphoneA
const char *transport=sal_address_get_transport_name(proxy_addr);
if (transport){
SalAddress *route=sal_address_new(NULL);
sal_address_set_domain(route,sal_address_get_domain((SalAddress*)addr));
sal_address_set_port_int(route,sal_address_get_port_int((SalAddress*)addr));
sal_address_set_domain(route,sal_address_get_domain((SalAddress*)dest));
sal_address_set_port_int(route,sal_address_get_port_int((SalAddress*)dest));
sal_address_set_transport_name(route,transport);
ret=ms_list_append(ret,route);
}
......@@ -2390,7 +2390,7 @@ static MSList *make_routes_for_proxy(LinphoneProxyConfig *proxy, const LinphoneA
return ret;
}
LinphoneProxyConfig * linphone_core_lookup_known_proxy(LinphoneCore *lc, const LinphoneAddress *uri, MSList **routes){
LinphoneProxyConfig * linphone_core_lookup_known_proxy(LinphoneCore *lc, const LinphoneAddress *uri){
const MSList *elem;
LinphoneProxyConfig *found_cfg=NULL;
LinphoneProxyConfig *default_cfg=lc->default_proxy;
......@@ -2416,31 +2416,17 @@ LinphoneProxyConfig * linphone_core_lookup_known_proxy(LinphoneCore *lc, const L
end:
if (found_cfg!=NULL && found_cfg!=default_cfg){
ms_message("Overriding default proxy setting for this call/message/subscribe operation.");
};
/*if route argument is given, fill adequate route set for this proxy.*/
if (routes){
if (found_cfg){
*routes=make_routes_for_proxy(found_cfg,uri);
}else if (default_cfg){
/*if the default proxy config has a locally configured route, we should use it*/
const char *route=linphone_proxy_config_get_route(default_cfg);
if (route)
*routes=ms_list_append(*routes,sal_address_new(route));
}
}
}else found_cfg=default_cfg;
return found_cfg;
}
const char *linphone_core_find_best_identity(LinphoneCore *lc, const LinphoneAddress *to){
LinphoneProxyConfig *cfg=linphone_core_lookup_known_proxy(lc,to,NULL);
if (cfg==NULL)
linphone_core_get_default_proxy (lc,&cfg);
LinphoneProxyConfig *cfg=linphone_core_lookup_known_proxy(lc,to);
if (cfg!=NULL){
return linphone_proxy_config_get_identity (cfg);
}
return linphone_core_get_primary_contact (lc);
return linphone_core_get_primary_contact(lc);
}
......@@ -2475,6 +2461,11 @@ int linphone_core_proceed_with_invite_if_ready(LinphoneCore *lc, LinphoneCall *c
return 0;
}
int linphone_core_restart_invite(LinphoneCore *lc, LinphoneCall *call){
linphone_call_create_op(call);
return linphone_core_start_invite(lc,call);
}
int linphone_core_start_invite(LinphoneCore *lc, LinphoneCall *call){
int err;
char *real_url,*barmsg;
......@@ -2587,7 +2578,7 @@ LinphoneCall * linphone_core_invite_address(LinphoneCore *lc, const LinphoneAddr
return call;
}
void linphone_transfer_routes_to_op(MSList *routes, SalOp *op){
static void linphone_transfer_routes_to_op(MSList *routes, SalOp *op){
MSList *it;
for(it=routes;it!=NULL;it=it->next){
SalAddress *addr=(SalAddress*)it->data;
......@@ -2597,6 +2588,26 @@ void linphone_transfer_routes_to_op(MSList *routes, SalOp *op){
ms_list_free(routes);
}
void linphone_configure_op(LinphoneCore *lc, SalOp *op, const LinphoneAddress *dest, SalCustomHeader *headers, bool_t with_contact){
MSList *routes=NULL;
LinphoneProxyConfig *proxy=linphone_core_lookup_known_proxy(lc,dest);
const char *identity;
if (proxy){
identity=linphone_proxy_config_get_identity(proxy);
}else identity=linphone_core_get_primary_contact(lc);
/*sending out of calls*/
if (proxy){
routes=make_routes_for_proxy(proxy,dest);
linphone_transfer_routes_to_op(routes,op);
}
sal_op_set_to_address(op,dest);
sal_op_set_from(op,identity);
sal_op_set_sent_custom_header(op,headers);
if (with_contact && proxy && proxy->op && sal_op_get_contact(proxy->op)){
sal_op_set_contact(op,sal_op_get_contact(proxy->op));
}
}
/**
* Initiates an outgoing call given a destination LinphoneAddress
*
......@@ -2619,7 +2630,6 @@ LinphoneCall * linphone_core_invite_address_with_params(LinphoneCore *lc, const
LinphoneAddress *parsed_url2=NULL;
char *real_url=NULL;
LinphoneCall *call;
MSList *routes=NULL;
bool_t defer = FALSE;
linphone_core_preempt_sound_resources(lc);
......@@ -2632,7 +2642,7 @@ LinphoneCall * linphone_core_invite_address_with_params(LinphoneCore *lc, const
linphone_core_get_default_proxy(lc,&proxy);
real_url=linphone_address_as_string(addr);
proxy=linphone_core_lookup_known_proxy(lc,addr,&routes);
proxy=linphone_core_lookup_known_proxy(lc,addr);
if (proxy!=NULL)
from=linphone_proxy_config_get_identity(proxy);
......@@ -2642,9 +2652,7 @@ LinphoneCall * linphone_core_invite_address_with_params(LinphoneCore *lc, const
parsed_url2=linphone_address_new(from);
call=linphone_call_new_outgoing(lc,parsed_url2,linphone_address_clone(addr),params);
call->dest_proxy=proxy;
linphone_transfer_routes_to_op(routes,call->op);
call=linphone_call_new_outgoing(lc,parsed_url2,linphone_address_clone(addr),params,proxy);
if(linphone_core_add_call(lc,call)!= 0)
{
......
......@@ -221,6 +221,37 @@ LINPHONE_PUBLIC void linphone_call_params_set_record_file(LinphoneCallParams *cp
LINPHONE_PUBLIC const char *linphone_call_params_get_record_file(const LinphoneCallParams *cp);
LINPHONE_PUBLIC void linphone_call_params_add_custom_header(LinphoneCallParams *params, const char *header_name, const char *header_value);
LINPHONE_PUBLIC const char *linphone_call_params_get_custom_header(const LinphoneCallParams *params, const char *header_name);
struct _LinphoneInfoMessage;
/**
* The LinphoneInfoMessage is an object representing an informational message sent or received by the core.
**/
typedef struct _LinphoneInfoMessage LinphoneInfoMessage;
/**
* The LinphoneContent struct holds data that can be embedded in a signaling message.
**/
struct _LinphoneContent{
char *type; /**<mime type for the data, for example "application"*/
char *subtype; /**<mime subtype for the data, for example "html"*/
void *data; /**<the actual data buffer, usually a string */
size_t size; /**<the size of the data buffer, excluding null character despite null character is always set for convenience.*/
};
/**
* Alias to the LinphoneContent struct.
**/
typedef struct _LinphoneContent LinphoneContent;
LINPHONE_PUBLIC LinphoneInfoMessage *linphone_core_create_info_message(LinphoneCore *lc);
LINPHONE_PUBLIC int linphone_core_send_info_message(LinphoneCore *lc, const LinphoneInfoMessage *info, const LinphoneAddress *addr);
LINPHONE_PUBLIC void linphone_info_message_add_header(LinphoneInfoMessage *im, const char *name, const char *value);
LINPHONE_PUBLIC const char *linphone_info_message_get_header(LinphoneInfoMessage *im, const char *name);
LINPHONE_PUBLIC void linphone_info_message_set_content(LinphoneInfoMessage *im, const LinphoneContent *content);
LINPHONE_PUBLIC const LinphoneContent * linphone_info_message_get_content(LinphoneInfoMessage *im);
LINPHONE_PUBLIC void linphone_info_message_destroy(LinphoneInfoMessage *im);
/**
* Enum describing failure reasons.
* @ingroup initializing
......@@ -827,6 +858,8 @@ typedef void (*LinphoneTransferStateChanged)(struct _LinphoneCore *lc, LinphoneC
/** Callback prototype for receiving quality statistics for calls*/
typedef void (*CallStatsUpdated)(struct _LinphoneCore *lc, LinphoneCall *call, const LinphoneCallStats *stats);
/** Callback prototype for receiving info messages*/
typedef void (*LinphoneInfoReceivedCb)(struct _LinphoneCore *lc, const LinphoneInfoMessage *msg);
/**
* This structure holds all callbacks that the application should implement.
* None is mandatory.
......@@ -839,7 +872,6 @@ typedef struct _LinphoneVTable{
NewSubscribtionRequestCb new_subscription_request; /**< Notify about pending subscription request */
AuthInfoRequested auth_info_requested; /**< Ask the application some authentication information */
CallLogUpdated call_log_updated; /**< Notifies that call log list has been updated */
TextMessageReceived text_received; /** @deprecated, use #message_received instead <br> A text message has been received */
MessageReceived message_received; /** a message is received, can be text or external body*/
DtmfReceived dtmf_received; /**< A dtmf has been received received */
ReferReceived refer_received; /**< An out of call refer was received */
......@@ -848,11 +880,13 @@ typedef struct _LinphoneVTable{
BuddyInfoUpdated buddy_info_updated; /**< a LinphoneFriend's BuddyInfo has changed*/
NotifyReceivedCb notify_recv; /**< Other notifications*/
CallStatsUpdated call_stats_updated; /**<Notifies on refreshing of call's statistics. */
DisplayStatusCb display_status; /**< DEPRECATED Callback that notifies various events with human readable text.*/
DisplayMessageCb display_message;/**< DEPRECATED Callback to display a message to the user */
DisplayMessageCb display_warning;/**< DEPRECATED Callback to display a warning to the user */
DisplayUrlCb display_url; /**< DEPRECATED */
ShowInterfaceCb show; /**< DEPRECATED Notifies the application that it should show up*/
LinphoneInfoReceivedCb info_received; /**<Notifies an incoming informational message received.*/
DisplayStatusCb display_status; /**< @deprecated Callback that notifies various events with human readable text.*/
DisplayMessageCb display_message;/**< @deprecated Callback to display a message to the user */
DisplayMessageCb display_warning;/**< @deprecated Callback to display a warning to the user */
DisplayUrlCb display_url; /**< @deprecated */
ShowInterfaceCb show; /**< @deprecated Notifies the application that it should show up*/
TextMessageReceived text_received; /** @deprecated, use #message_received instead <br> A text message has been received */
} LinphoneCoreVTable;
/**
......@@ -1522,14 +1556,15 @@ typedef struct _LinphoneTunnel LinphoneTunnel;
*/
LINPHONE_PUBLIC LinphoneTunnel *linphone_core_get_tunnel(LinphoneCore *lc);
void linphone_core_set_sip_dscp(LinphoneCore *lc, int dscp);
int linphone_core_get_sip_dscp(const LinphoneCore *lc);
LINPHONE_PUBLIC void linphone_core_set_sip_dscp(LinphoneCore *lc, int dscp);
LINPHONE_PUBLIC int linphone_core_get_sip_dscp(const LinphoneCore *lc);
LINPHONE_PUBLIC void linphone_core_set_audio_dscp(LinphoneCore *lc, int dscp);
LINPHONE_PUBLIC int linphone_core_get_audio_dscp(const LinphoneCore *lc);
void linphone_core_set_audio_dscp(LinphoneCore *lc, int dscp);
int linphone_core_get_audio_dscp(const LinphoneCore *lc);
LINPHONE_PUBLIC void linphone_core_set_video_dscp(LinphoneCore *lc, int dscp);
LINPHONE_PUBLIC int linphone_core_get_video_dscp(const LinphoneCore *lc);
void linphone_core_set_video_dscp(LinphoneCore *lc, int dscp);
int linphone_core_get_video_dscp(const LinphoneCore *lc);
#ifdef __cplusplus
......
......@@ -64,7 +64,7 @@ void linphone_subscription_new(LinphoneCore *lc, SalOp *op, const char *from){
tmp=linphone_address_as_string(uri);
ms_message("Receiving new subscription from %s.",from);
cfg=linphone_core_lookup_known_proxy(lc,uri,NULL);
cfg=linphone_core_lookup_known_proxy(lc,uri);
if (cfg!=NULL){
if (cfg->op){
if (sal_op_get_contact(cfg->op)) {
......
......@@ -215,7 +215,7 @@ struct _LinphoneCall
};
LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, LinphoneAddress *from, LinphoneAddress *to, const LinphoneCallParams *params);
LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, LinphoneAddress *from, LinphoneAddress *to, const LinphoneCallParams *params, LinphoneProxyConfig *cfg);
LinphoneCall * linphone_call_new_incoming(struct _LinphoneCore *lc, LinphoneAddress *from, LinphoneAddress *to, SalOp *op);
void linphone_call_set_state(LinphoneCall *call, LinphoneCallState cstate, const char *message);
void linphone_call_set_contact_op(LinphoneCall* call);
......@@ -315,8 +315,7 @@ LinphoneFriend * linphone_friend_new_from_config_file(struct _LinphoneCore *lc,
void linphone_proxy_config_update(LinphoneProxyConfig *cfg);
void linphone_proxy_config_get_contact(LinphoneProxyConfig *cfg, const char **ip, int *port);
LinphoneProxyConfig * linphone_core_lookup_known_proxy(LinphoneCore *lc, const LinphoneAddress *uri, MSList **routes);
void linphone_transfer_routes_to_op(MSList *routes, SalOp *op);
LinphoneProxyConfig * linphone_core_lookup_known_proxy(LinphoneCore *lc, const LinphoneAddress *uri);
const char *linphone_core_find_best_identity(LinphoneCore *lc, const LinphoneAddress *to);
int linphone_core_get_local_ip_for(int type, const char *dest, char *result);
......@@ -353,6 +352,7 @@ void linphone_core_stop_waiting(LinphoneCore *lc);
int linphone_core_proceed_with_invite_if_ready(LinphoneCore *lc, LinphoneCall *call, LinphoneProxyConfig *dest_proxy);
int linphone_core_start_invite(LinphoneCore *lc, LinphoneCall *call);
int linphone_core_restart_invite(LinphoneCore *lc, LinphoneCall *call);
int linphone_core_start_update_call(LinphoneCore *lc, LinphoneCall *call);
int linphone_core_start_accept_call_update(LinphoneCore *lc, LinphoneCall *call);
void linphone_core_start_refered_call(LinphoneCore *lc, LinphoneCall *call);
......@@ -739,6 +739,9 @@ typedef enum _LinphoneToneID{
void linphone_core_play_named_tone(LinphoneCore *lc, LinphoneToneID id);
bool_t linphone_core_tone_indications_enabled(LinphoneCore*lc);
const char *linphone_core_create_uuid(LinphoneCore *lc);
void linphone_configure_op(LinphoneCore *lc, SalOp *op, const LinphoneAddress *dest, SalCustomHeader *headers, bool_t with_contact);
void linphone_call_create_op(LinphoneCall *call);
void linphone_core_notify_info_message(LinphoneCore* lc,SalOp *op, const SalBody *body);
#ifdef __cplusplus
}
......
......@@ -315,6 +315,13 @@ typedef struct SalAuthInfo{
char *ha1;
}SalAuthInfo;
typedef struct SalBody{
const char *type;
const char *subtype;
const void *data;
size_t size;
}SalBody;
typedef void (*SalOnCallReceived)(SalOp *op);
typedef void (*SalOnCallRinging)(SalOp *op);
typedef void (*SalOnCallAccepted)(SalOp *op);
......@@ -343,6 +350,7 @@ typedef void (*SalOnNotifyPresence)(SalOp *op, SalSubscribeStatus ss, SalPresenc
typedef void (*SalOnSubscribeReceived)(SalOp *salop, const char *from);
typedef void (*SalOnSubscribeClosed)(SalOp *salop, const char *from);
typedef void (*SalOnPingReply)(SalOp *salop);
typedef void (*SalOnInfoReceived)(SalOp *salop, const SalBody *body);
/*allows sal implementation to access auth info if available, return TRUE if found*/
......@@ -376,6 +384,7 @@ typedef struct SalCallbacks{
SalOnSubscribeClosed subscribe_closed;
SalOnPingReply ping_reply;
SalOnAuthRequested auth_requested;
SalOnInfoReceived info_received;
}SalCallbacks;
......@@ -518,6 +527,9 @@ int sal_publish(SalOp *op, const char *from, const char *to, SalPresenceStatus s
/*ping: main purpose is to obtain its own contact address behind firewalls*/
int sal_ping(SalOp *op, const char *from, const char *to);
/*info messages*/
int sal_send_info(SalOp *op, const char *from, const char *to, const SalBody *body);
#define payload_type_set_number(pt,n) (pt)->user_data=(void*)((long)n);
......
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