mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-07 05:53:06 +00:00
Merge branch 'master' of git.linphone.org:linphone
Conflicts: coreapi/linphonecore.h coreapi/private.h
This commit is contained in:
commit
d032c1d3c9
16 changed files with 270 additions and 95 deletions
18
.cproject
18
.cproject
|
|
@ -28,6 +28,9 @@
|
|||
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.306286573" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
|
||||
</tool>
|
||||
<tool id="org.eclipse.cdt.build.core.settings.holder.391709798" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder">
|
||||
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.295320884" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value="/Users/jehanmonnier/workspaces/workspace-macosx/opt/include"/>
|
||||
</option>
|
||||
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1702094818" languageId="org.eclipse.cdt.core.gcc" languageName="GNU C" sourceContentType="org.eclipse.cdt.core.cSource,org.eclipse.cdt.core.cHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
|
||||
</tool>
|
||||
<tool id="org.eclipse.cdt.build.core.settings.holder.754828354" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
|
||||
|
|
@ -36,9 +39,24 @@
|
|||
</toolChain>
|
||||
</folderInfo>
|
||||
<fileInfo id="0.2079208171.2090246372" name="ringback.wav" rcbsApplicability="disable" resourcePath="tester/sounds/ringback.wav" toolsToInvoke=""/>
|
||||
<folderInfo id="0.2079208171.1778481546" name="/" resourcePath="include">
|
||||
<toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.1238844827" name="No ToolChain" superClass="org.eclipse.cdt.build.core.prefbase.toolchain" unusedChildren="">
|
||||
<tool id="org.eclipse.cdt.build.core.settings.holder.libs.58439860" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs.1252970003"/>
|
||||
<tool id="org.eclipse.cdt.build.core.settings.holder.899998629" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder.1371414073">
|
||||
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1829150855" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
|
||||
</tool>
|
||||
<tool id="org.eclipse.cdt.build.core.settings.holder.252709365" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder.391709798">
|
||||
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.551083583" languageId="org.eclipse.cdt.core.gcc" languageName="GNU C" sourceContentType="org.eclipse.cdt.core.cSource,org.eclipse.cdt.core.cHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
|
||||
</tool>
|
||||
<tool id="org.eclipse.cdt.build.core.settings.holder.1236597953" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder.754828354">
|
||||
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.714781911" languageId="org.eclipse.cdt.core.assembly" languageName="Assembly" sourceContentType="org.eclipse.cdt.core.asmSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
|
||||
</tool>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="coreapi"/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="gtk"/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="include"/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="tester"/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
|
|
|
|||
|
|
@ -246,7 +246,9 @@ static void process_request_event(void *ud, const belle_sip_request_event_t *eve
|
|||
return;
|
||||
}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);
|
||||
resp=belle_sip_response_create_from_request(req,405);
|
||||
belle_sip_message_add_header(BELLE_SIP_MESSAGE(resp)
|
||||
,BELLE_SIP_HEADER(belle_sip_header_allow_create("INVITE, CANCEL, ACK, BYE, SUBSCRIBE, NOTIFY, MESSAGE, OPTIONS, INFO")));
|
||||
belle_sip_provider_send_response(sal->prov,resp);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ struct SalOp{
|
|||
belle_sip_listener_callbacks_t callbacks;
|
||||
belle_sip_client_transaction_t *pending_auth_transaction;
|
||||
belle_sip_server_transaction_t* pending_server_trans;
|
||||
belle_sip_server_transaction_t* pending_update_server_trans;
|
||||
belle_sip_client_transaction_t* pending_client_trans;
|
||||
SalAuthInfo* auth_info;
|
||||
belle_sip_dialog_t* dialog;
|
||||
|
|
|
|||
|
|
@ -226,6 +226,11 @@ static void call_process_response(void *op_base, const belle_sip_response_event_
|
|||
call_set_error(op,response);
|
||||
if (op->dialog==NULL) call_set_released(op);
|
||||
}
|
||||
} else if ( code >=200
|
||||
&& code<300
|
||||
&& strcmp("UPDATE",belle_sip_request_get_method(req))==0) {
|
||||
handle_sdp_from_response(op,response);
|
||||
op->base.root->callbacks.call_accepted(op);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
@ -384,6 +389,16 @@ static int process_sdp_for_invite(SalOp* op,belle_sip_request_t* invite) {
|
|||
return err;
|
||||
}
|
||||
|
||||
static void sal_op_reset_descriptions(SalOp *op) {
|
||||
if (op->base.remote_media){
|
||||
sal_media_description_unref(op->base.remote_media);
|
||||
op->base.remote_media=NULL;
|
||||
}
|
||||
if (op->result){
|
||||
sal_media_description_unref(op->result);
|
||||
op->result=NULL;
|
||||
}
|
||||
}
|
||||
static void process_request_event(void *op_base, const belle_sip_request_event_t *event) {
|
||||
SalOp* op = (SalOp*)op_base;
|
||||
belle_sip_server_transaction_t* server_transaction=NULL;
|
||||
|
|
@ -408,6 +423,13 @@ static void process_request_event(void *op_base, const belle_sip_request_event_t
|
|||
belle_sip_object_ref(op->pending_server_trans);
|
||||
}
|
||||
|
||||
if (strcmp("UPDATE",method)==0) {
|
||||
if (op->pending_update_server_trans) belle_sip_object_unref(op->pending_update_server_trans);
|
||||
/*updating pending update transaction*/
|
||||
op->pending_update_server_trans=server_transaction;
|
||||
belle_sip_object_ref(op->pending_update_server_trans);
|
||||
}
|
||||
|
||||
if (!op->dialog) {
|
||||
set_or_update_dialog(op,belle_sip_provider_create_dialog(op->base.root->prov,BELLE_SIP_TRANSACTION(op->pending_server_trans)));
|
||||
ms_message("new incoming call from [%s] to [%s]",sal_op_get_from(op),sal_op_get_to(op));
|
||||
|
|
@ -455,6 +477,10 @@ static void process_request_event(void *op_base, const belle_sip_request_event_t
|
|||
} else if (strcmp("PRACK",method)==0) {
|
||||
resp=sal_op_create_response_from_request(op,req,200);
|
||||
belle_sip_server_transaction_send_response(server_transaction,resp);
|
||||
} else if (strcmp("UPDATE",method)==0) {
|
||||
sal_op_reset_descriptions(op);
|
||||
if (process_sdp_for_invite(op,req)==0)
|
||||
op->base.root->callbacks.call_updating(op);
|
||||
} else {
|
||||
belle_sip_error("Unexpected method [%s] for dialog state BELLE_SIP_DIALOG_EARLY",belle_sip_request_get_method(req));
|
||||
unsupported_method(server_transaction,req);
|
||||
|
|
@ -479,10 +505,6 @@ static void process_request_event(void *op_base, const belle_sip_request_event_t
|
|||
}
|
||||
}
|
||||
}
|
||||
/*FIXME
|
||||
if (op->reinvite){
|
||||
op->reinvite=FALSE;
|
||||
}*/
|
||||
op->base.root->callbacks.call_ack(op);
|
||||
} else if(strcmp("BYE",method)==0) {
|
||||
resp=sal_op_create_response_from_request(op,req,200);
|
||||
|
|
@ -492,14 +514,7 @@ static void process_request_event(void *op_base, const belle_sip_request_event_t
|
|||
/*call end not notified by dialog deletion because transaction can end before dialog*/
|
||||
} else if(strcmp("INVITE",method)==0) {
|
||||
/*re-invite*/
|
||||
if (op->base.remote_media){
|
||||
sal_media_description_unref(op->base.remote_media);
|
||||
op->base.remote_media=NULL;
|
||||
}
|
||||
if (op->result){
|
||||
sal_media_description_unref(op->result);
|
||||
op->result=NULL;
|
||||
}
|
||||
sal_op_reset_descriptions(op);
|
||||
if (process_sdp_for_invite(op,req)==0)
|
||||
op->base.root->callbacks.call_updating(op);
|
||||
} else if (strcmp("INFO",method)==0){
|
||||
|
|
@ -576,7 +591,7 @@ int sal_call_set_local_media_description(SalOp *op, SalMediaDescription *desc){
|
|||
|
||||
static belle_sip_header_allow_t *create_allow(){
|
||||
belle_sip_header_allow_t* header_allow;
|
||||
header_allow = belle_sip_header_allow_create("INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO");
|
||||
header_allow = belle_sip_header_allow_create("INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO, UPDATE");
|
||||
return header_allow;
|
||||
}
|
||||
|
||||
|
|
@ -684,14 +699,21 @@ int sal_call_notify_ringing(SalOp *op, bool_t early_media){
|
|||
int sal_call_accept(SalOp*h){
|
||||
belle_sip_response_t *response;
|
||||
belle_sip_header_contact_t* contact_header;
|
||||
belle_sip_server_transaction_t* transaction;
|
||||
|
||||
if (!h->pending_server_trans) {
|
||||
/*first check if an UPDATE transaction need to be accepted*/
|
||||
if (h->pending_update_server_trans) {
|
||||
transaction=h->pending_update_server_trans;
|
||||
} else if (h->pending_server_trans) {
|
||||
/*so it must be an invite/re-invite*/
|
||||
transaction=h->pending_server_trans;
|
||||
} else {
|
||||
ms_error("No transaction to accept for op [%p]",h);
|
||||
return -1;
|
||||
}
|
||||
|
||||
ms_message("Accepting server transaction [%p] on op [%p]", transaction, h);
|
||||
/* sends a 200 OK */
|
||||
response = sal_op_create_response_from_request(h,belle_sip_transaction_get_request(BELLE_SIP_TRANSACTION(h->pending_server_trans)),200);
|
||||
response = sal_op_create_response_from_request(h,belle_sip_transaction_get_request(BELLE_SIP_TRANSACTION(transaction)),200);
|
||||
|
||||
if (response==NULL){
|
||||
ms_error("Fail to build answer for call");
|
||||
|
|
@ -712,7 +734,11 @@ int sal_call_accept(SalOp*h){
|
|||
|
||||
handle_offer_answer_response(h,response);
|
||||
|
||||
belle_sip_server_transaction_send_response(h->pending_server_trans,response);
|
||||
belle_sip_server_transaction_send_response(transaction,response);
|
||||
if (h->pending_update_server_trans) {
|
||||
belle_sip_object_unref(h->pending_update_server_trans);
|
||||
h->pending_update_server_trans=NULL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -738,11 +764,22 @@ int sal_call_decline(SalOp *op, SalReason reason, const char *redirection /*opti
|
|||
}
|
||||
|
||||
int sal_call_update(SalOp *op, const char *subject){
|
||||
belle_sip_request_t *reinvite=belle_sip_dialog_create_request(op->dialog,"INVITE");
|
||||
if (reinvite){
|
||||
belle_sip_message_add_header(BELLE_SIP_MESSAGE(reinvite),belle_sip_header_create( "Subject", subject));
|
||||
sal_op_fill_invite(op, reinvite);
|
||||
return sal_op_send_request(op,reinvite);
|
||||
|
||||
belle_sip_request_t *update;
|
||||
belle_sip_dialog_state_t state=belle_sip_dialog_get_state(op->dialog);
|
||||
/*check for dialog state*/
|
||||
if ( state == BELLE_SIP_DIALOG_CONFIRMED) {
|
||||
update=belle_sip_dialog_create_request(op->dialog,"INVITE");
|
||||
} else if (state == BELLE_SIP_DIALOG_EARLY) {
|
||||
update=belle_sip_dialog_create_request(op->dialog,"UPDATE");
|
||||
} else {
|
||||
ms_error("Cannot update op [%p] with dialog [%p] in state [%s]",op, op->dialog,belle_sip_dialog_state_to_string(state));
|
||||
return -1;
|
||||
}
|
||||
if (update){
|
||||
belle_sip_message_add_header(BELLE_SIP_MESSAGE(update),belle_sip_header_create( "Subject", subject));
|
||||
sal_op_fill_invite(op, update);
|
||||
return sal_op_send_request(op,update);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ void sal_op_release_impl(SalOp *op){
|
|||
|
||||
if (op->pending_client_trans) belle_sip_object_unref(op->pending_client_trans);
|
||||
if (op->pending_server_trans) belle_sip_object_unref(op->pending_server_trans);
|
||||
if (op->pending_update_server_trans) belle_sip_object_unref(op->pending_update_server_trans);
|
||||
if (op->event) belle_sip_object_unref(op->event);
|
||||
__sal_op_free(op);
|
||||
return ;
|
||||
|
|
|
|||
|
|
@ -116,6 +116,7 @@ void linphone_core_update_streams(LinphoneCore *lc, LinphoneCall *call, SalMedia
|
|||
video_stream_change_camera(call->videostream,lc->video_conf.device );
|
||||
#endif
|
||||
}
|
||||
/*FIXME ZRTP, might be restarted in any cases ? */
|
||||
ms_message("No need to restart streams, SDP is unchanged.");
|
||||
goto end;
|
||||
}else {
|
||||
|
|
@ -406,7 +407,8 @@ static void call_accepted(SalOp *op){
|
|||
linphone_call_fix_call_parameters(call);
|
||||
if (!call->current_params.in_conference)
|
||||
lc->current_call=call;
|
||||
linphone_call_set_state(call, LinphoneCallStreamsRunning, "Streams running");
|
||||
if (call->prevstate != LinphoneCallIncomingEarlyMedia) /*don't change state in aswer to a SIP UPDATE in early media*/
|
||||
linphone_call_set_state(call, LinphoneCallStreamsRunning, "Streams running");
|
||||
}
|
||||
}else{
|
||||
/*send a bye*/
|
||||
|
|
@ -472,7 +474,7 @@ static void call_paused_by_remote(LinphoneCore *lc, LinphoneCall *call){
|
|||
linphone_call_set_state (call,LinphoneCallPausedByRemote,"Call paused by remote");
|
||||
}
|
||||
|
||||
static void call_updated_by_remote(LinphoneCore *lc, LinphoneCall *call){
|
||||
static void call_updated_by_remote(LinphoneCore *lc, LinphoneCall *call,bool_t notify_application){
|
||||
/*first check if media capabilities are compatible*/
|
||||
SalMediaDescription* md;
|
||||
linphone_call_make_local_media_description(lc,call);
|
||||
|
|
@ -483,16 +485,21 @@ static void call_updated_by_remote(LinphoneCore *lc, LinphoneCall *call){
|
|||
return;
|
||||
}
|
||||
|
||||
if(lc->vtable.display_status)
|
||||
lc->vtable.display_status(lc,_("Call is updated by remote."));
|
||||
call->defer_update=FALSE;
|
||||
linphone_call_set_state(call, LinphoneCallUpdatedByRemote,"Call updated by remote");
|
||||
if (call->defer_update==FALSE){
|
||||
linphone_core_accept_call_update(lc,call,NULL);
|
||||
if (notify_application) {
|
||||
if(lc->vtable.display_status)
|
||||
lc->vtable.display_status(lc,_("Call is updated by remote."));
|
||||
call->defer_update=FALSE;
|
||||
linphone_call_set_state(call, LinphoneCallUpdatedByRemote,"Call updated by remote");
|
||||
if (call->defer_update==FALSE){
|
||||
linphone_core_accept_call_update(lc,call,NULL);
|
||||
}
|
||||
} else { /*SIP UPDATE case*/
|
||||
/*can be call from any state*/
|
||||
_linphone_core_accept_call_update(lc,call,NULL);
|
||||
}
|
||||
}
|
||||
|
||||
/* this callback is called when an incoming re-INVITE modifies the session*/
|
||||
/* this callback is called when an incoming re-INVITE/ SIP UPDATE modifies the session*/
|
||||
static void call_updating(SalOp *op){
|
||||
LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(op));
|
||||
LinphoneCall *call=(LinphoneCall*)sal_op_get_user_pointer(op);
|
||||
|
|
@ -511,12 +518,16 @@ static void call_updating(SalOp *op){
|
|||
call_resumed(lc,call);
|
||||
}else call_paused_by_remote(lc,call);
|
||||
break;
|
||||
/*SIP UPDATE CASE*/
|
||||
case LinphoneCallOutgoingEarlyMedia:
|
||||
call_updated_by_remote(lc,call,FALSE);
|
||||
break;
|
||||
case LinphoneCallStreamsRunning:
|
||||
case LinphoneCallConnected:
|
||||
if (sal_media_description_has_dir(rmd,SalStreamSendOnly) || sal_media_description_has_dir(rmd,SalStreamInactive)){
|
||||
call_paused_by_remote(lc,call);
|
||||
}else{
|
||||
call_updated_by_remote(lc,call);
|
||||
call_updated_by_remote(lc,call,TRUE);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -206,6 +206,7 @@ int linphone_core_add_to_conference(LinphoneCore *lc, LinphoneCall *call){
|
|||
lc->current_call=NULL;
|
||||
}
|
||||
/*this will trigger a reINVITE that will later redraw the streams */
|
||||
/*FIXME probably a bit too much to just redraw streams !*/
|
||||
linphone_core_update_call(lc,call,params);
|
||||
linphone_call_params_destroy(params);
|
||||
add_local_endpoint(conf,lc);
|
||||
|
|
|
|||
|
|
@ -3231,23 +3231,25 @@ int linphone_core_start_accept_call_update(LinphoneCore *lc, LinphoneCall *call)
|
|||
linphone_core_update_streams (lc,call,md);
|
||||
linphone_call_fix_call_parameters(call);
|
||||
}
|
||||
linphone_call_set_state(call,LinphoneCallStreamsRunning,"Connected (streams running)");
|
||||
|
||||
if (call->state != LinphoneCallOutgoingEarlyMedia) /*don't change the state in case of outgoing early (SIP UPDATE)*/
|
||||
linphone_call_set_state(call,LinphoneCallStreamsRunning,"Connected (streams running)");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @ingroup call_control
|
||||
* Accept call modifications initiated by other end.
|
||||
*
|
||||
*
|
||||
* This call may be performed in response to a #LinphoneCallUpdatedByRemote state notification.
|
||||
* When such notification arrives, the application can decide to call linphone_core_defer_update_call() so that it can
|
||||
* have the time to prompt the user. linphone_call_get_remote_params() can be used to get information about the call parameters
|
||||
* requested by the other party, such as whether a video stream is requested.
|
||||
*
|
||||
*
|
||||
* When the user accepts or refuse the change, linphone_core_accept_call_update() can be done to answer to the other party.
|
||||
* If params is NULL, then the same call parameters established before the update request will continue to be used (no change).
|
||||
* If params is not NULL, then the update will be accepted according to the parameters passed.
|
||||
* Typical example is when a user accepts to start video, then params should indicate that video stream should be used
|
||||
* Typical example is when a user accepts to start video, then params should indicate that video stream should be used
|
||||
* (see linphone_call_params_enable_video()).
|
||||
* @param lc the linphone core object.
|
||||
* @param call the LinphoneCall object
|
||||
|
|
@ -3255,16 +3257,20 @@ int linphone_core_start_accept_call_update(LinphoneCore *lc, LinphoneCall *call)
|
|||
* @return 0 if successful, -1 otherwise (actually when this function call is performed outside ot #LinphoneCallUpdatedByRemote state).
|
||||
**/
|
||||
int linphone_core_accept_call_update(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params){
|
||||
SalMediaDescription *remote_desc;
|
||||
bool_t keep_sdp_version;
|
||||
#ifdef VIDEO_ENABLED
|
||||
bool_t old_has_video = call->params.has_video;
|
||||
#endif
|
||||
if (call->state!=LinphoneCallUpdatedByRemote){
|
||||
ms_error("linphone_core_accept_update(): invalid state %s to call this function.",
|
||||
linphone_call_state_to_string(call->state));
|
||||
return -1;
|
||||
}
|
||||
return _linphone_core_accept_call_update(lc, call, params);
|
||||
}
|
||||
int _linphone_core_accept_call_update(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params){
|
||||
SalMediaDescription *remote_desc;
|
||||
bool_t keep_sdp_version;
|
||||
#ifdef VIDEO_ENABLED
|
||||
bool_t old_has_video = call->params.has_video;
|
||||
#endif
|
||||
|
||||
remote_desc = sal_call_get_remote_media_description(call->op);
|
||||
keep_sdp_version = lp_config_get_int(lc->config, "sip", "keep_sdp_version", 0);
|
||||
if (keep_sdp_version &&(remote_desc->session_id == call->remote_session_id) && (remote_desc->session_ver == call->remote_session_ver)) {
|
||||
|
|
@ -6501,3 +6507,10 @@ void linphone_core_set_chat_database_path(LinphoneCore *lc, const char *path){
|
|||
linphone_core_message_storage_init(lc);
|
||||
}
|
||||
}
|
||||
void linphone_core_enable_sdp_200_ack(LinphoneCore *lc, bool_t enable) {
|
||||
lp_config_set_int(lc->config,"sip","sdp_200_ack",lc->sip_conf.sdp_200_ack=enable);
|
||||
}
|
||||
bool_t linphone_core_sdp_200_ack_enabled(const LinphoneCore *lc) {
|
||||
return lc->sip_conf.sdp_200_ack!=0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2329,6 +2329,21 @@ LINPHONE_PUBLIC bool_t linphone_core_is_provisioning_transient(LinphoneCore *lc)
|
|||
LINPHONE_PUBLIC int linphone_core_migrate_to_multi_transport(LinphoneCore *lc);
|
||||
|
||||
|
||||
/**
|
||||
* Control when media offer is sent in SIP INVITE.
|
||||
* @param lc the linphone core
|
||||
* @param enable true if INVITE has to be sent whitout SDP.
|
||||
* @ingroup network_parameters
|
||||
**/
|
||||
LINPHONE_PUBLIC void linphone_core_enable_sdp_200_ack(LinphoneCore *lc, bool_t enable);
|
||||
/**
|
||||
* Media offer control param for SIP INVITE.
|
||||
* @return true if INVITE has to be sent whitout SDP.
|
||||
* @ingroup network_parameters
|
||||
**/
|
||||
LINPHONE_PUBLIC bool_t linphone_core_sdp_200_ack_enabled(const LinphoneCore *lc);
|
||||
|
||||
|
||||
/**
|
||||
* Enum listing frequent telephony tones.
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -4593,6 +4593,17 @@ JNIEXPORT jstring JNICALL Java_org_linphone_core_PayloadTypeImpl_getSendFmtp(JNI
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_linphone_core_LinphoneCoreImpl_enableSdp200Ack(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc
|
||||
,jboolean enable) {
|
||||
linphone_core_enable_sdp_200_ack((LinphoneCore*)lc,enable);
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL Java_org_linphone_core_LinphoneCoreImpl_isSdp200AckEnabled(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc) {
|
||||
return (jboolean)linphone_core_sdp_200_ack_enabled((const LinphoneCore*)lc);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -599,7 +599,7 @@ LinphoneToneDescription *linphone_core_get_call_error_tone(const LinphoneCore *l
|
|||
void linphone_core_play_call_error_tone(LinphoneCore *lc, LinphoneReason reason);
|
||||
void _linphone_core_set_tone(LinphoneCore *lc, LinphoneReason reason, LinphoneToneID id, const char *audiofile);
|
||||
const char *linphone_core_get_tone_file(const LinphoneCore *lc, LinphoneToneID id);
|
||||
|
||||
int _linphone_core_accept_call_update(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params);
|
||||
typedef struct _LinphoneConference LinphoneConference;
|
||||
|
||||
struct _LinphoneCore
|
||||
|
|
|
|||
|
|
@ -420,7 +420,7 @@ typedef void (*SalOnCallReceived)(SalOp *op);
|
|||
typedef void (*SalOnCallRinging)(SalOp *op);
|
||||
typedef void (*SalOnCallAccepted)(SalOp *op);
|
||||
typedef void (*SalOnCallAck)(SalOp *op);
|
||||
typedef void (*SalOnCallUpdating)(SalOp *op);/*< Called when a reINVITE is received*/
|
||||
typedef void (*SalOnCallUpdating)(SalOp *op);/*< Called when a reINVITE/UPDATE is received*/
|
||||
typedef void (*SalOnCallTerminated)(SalOp *op, const char *from);
|
||||
typedef void (*SalOnCallFailure)(SalOp *op, SalError error, SalReason reason, const char *details, int code);
|
||||
typedef void (*SalOnCallReleased)(SalOp *salop);
|
||||
|
|
|
|||
|
|
@ -1545,4 +1545,16 @@ public interface LinphoneCore {
|
|||
* @return the MTU in bytes.
|
||||
*/
|
||||
public int getMtu();
|
||||
/**
|
||||
Control when media offer is sent in SIP INVITE.
|
||||
* @param enable true if INVITE has to be sent whitout SDP.
|
||||
* */
|
||||
public void enableSdp200Ack(boolean enable);
|
||||
/**
|
||||
* Media offer control param for SIP INVITE.
|
||||
* @return true if INVITE has to be sent whitout SDP.
|
||||
*/
|
||||
public boolean isSdp200AckEnabled();
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -147,6 +147,8 @@ class LinphoneCoreImpl implements LinphoneCore {
|
|||
private native int migrateToMultiTransport(long nativePtr);
|
||||
private native long createProxyConfig(long nativePtr);
|
||||
private native void setCallErrorTone(long nativePtr, int reason, String path);
|
||||
private native void enableSdp200Ack(long nativePtr,boolean enable);
|
||||
private native boolean isSdp200AckEnabled(long nativePtr);
|
||||
|
||||
LinphoneCoreImpl(LinphoneCoreListener listener, File userConfig, File factoryConfig, Object userdata) throws IOException {
|
||||
mListener = listener;
|
||||
|
|
@ -1150,4 +1152,13 @@ class LinphoneCoreImpl implements LinphoneCore {
|
|||
public int getMtu() {
|
||||
return getMtu(nativePtr);
|
||||
}
|
||||
@Override
|
||||
public void enableSdp200Ack(boolean enable) {
|
||||
enableSdp200Ack(nativePtr,enable);
|
||||
}
|
||||
@Override
|
||||
public boolean isSdp200AckEnabled() {
|
||||
return isSdp200AckEnabled(nativePtr);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -478,9 +478,11 @@ static void call_terminated_by_caller(void) {
|
|||
}
|
||||
|
||||
static void call_with_no_sdp(void) {
|
||||
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_no_sdp_rc");
|
||||
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
|
||||
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
|
||||
|
||||
linphone_core_enable_sdp_200_ack(marie->lc,TRUE);
|
||||
|
||||
CU_ASSERT_TRUE(call(marie,pauline));
|
||||
/*just to sleep*/
|
||||
linphone_core_terminate_all_calls(pauline->lc);
|
||||
|
|
@ -1133,6 +1135,92 @@ static void early_media_call_with_ringing(void){
|
|||
linphone_core_manager_destroy(pauline);
|
||||
}
|
||||
|
||||
static void early_media_call_with_update_base(bool_t media_change){
|
||||
char hellopath[256];
|
||||
LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc");
|
||||
LinphoneCoreManager* pauline = linphone_core_manager_new("pauline_rc");
|
||||
MSList* lcs = NULL;
|
||||
LinphoneCall *marie_call, *pauline_call;
|
||||
LinphoneCallParams *pauline_params;
|
||||
|
||||
lcs = ms_list_append(lcs,marie->lc);
|
||||
lcs = ms_list_append(lcs,pauline->lc);
|
||||
if (media_change) {
|
||||
disable_all_codecs_except_one(marie->lc,"pcmu");
|
||||
disable_all_codecs_except_one(pauline->lc,"pcmu");
|
||||
|
||||
}
|
||||
/*
|
||||
Marie calls Pauline, and after the call has rung, transitions to an early_media session
|
||||
*/
|
||||
|
||||
/*use playfile for callee to avoid locking on capture card*/
|
||||
linphone_core_use_files (pauline->lc,TRUE);
|
||||
snprintf(hellopath,sizeof(hellopath), "%s/sounds/hello8000.wav", liblinphone_tester_file_prefix);
|
||||
linphone_core_set_play_file(pauline->lc,hellopath);
|
||||
|
||||
marie_call = linphone_core_invite_address(marie->lc, pauline->identity);
|
||||
|
||||
CU_ASSERT_TRUE(wait_for_list(lcs, &pauline->stat.number_of_LinphoneCallIncomingReceived,1,1000));
|
||||
CU_ASSERT_TRUE(wait_for_list(lcs, &marie->stat.number_of_LinphoneCallOutgoingRinging,1,1000));
|
||||
/* send a 183 to initiate the early media */
|
||||
linphone_core_accept_early_media(pauline->lc, linphone_core_get_current_call(pauline->lc));
|
||||
CU_ASSERT_TRUE( wait_for_list(lcs, &pauline->stat.number_of_LinphoneCallIncomingEarlyMedia,1,2000) );
|
||||
CU_ASSERT_TRUE( wait_for_list(lcs, &marie->stat.number_of_LinphoneCallOutgoingEarlyMedia,1,2000) );
|
||||
|
||||
pauline_call = linphone_core_get_current_call(pauline->lc);
|
||||
pauline_params = linphone_call_params_copy(linphone_call_get_current_params(pauline_call));
|
||||
|
||||
if (media_change) {
|
||||
disable_all_codecs_except_one(marie->lc,"pcma");
|
||||
disable_all_codecs_except_one(pauline->lc,"pcma");
|
||||
}
|
||||
#define UPDATED_SESSION_NAME "nouveau nom de session"
|
||||
|
||||
linphone_call_params_set_session_name(pauline_params,UPDATED_SESSION_NAME);
|
||||
linphone_core_update_call(pauline->lc, pauline_call, pauline_params);
|
||||
|
||||
/*just to wait 2s*/
|
||||
liblinphone_tester_check_rtcp(marie, pauline);
|
||||
wait_for_list(lcs, &marie->stat.number_of_LinphoneCallUpdatedByRemote,100000,2000);
|
||||
|
||||
CU_ASSERT_STRING_EQUAL( linphone_call_params_get_session_name(linphone_call_get_remote_params(marie_call))
|
||||
, UPDATED_SESSION_NAME);
|
||||
|
||||
linphone_core_accept_call(pauline->lc, linphone_core_get_current_call(pauline->lc));
|
||||
|
||||
CU_ASSERT_TRUE(wait_for_list(lcs, &marie->stat.number_of_LinphoneCallStreamsRunning, 1,1000));
|
||||
|
||||
CU_ASSERT_EQUAL(marie->stat.number_of_LinphoneCallOutgoingEarlyMedia,1);
|
||||
CU_ASSERT_EQUAL(marie->stat.number_of_LinphoneCallStreamsRunning,1);
|
||||
CU_ASSERT_EQUAL(marie->stat.number_of_LinphoneCallConnected,1);
|
||||
|
||||
CU_ASSERT_EQUAL(pauline->stat.number_of_LinphoneCallIncomingEarlyMedia,1);
|
||||
CU_ASSERT_EQUAL(pauline->stat.number_of_LinphoneCallStreamsRunning,1);
|
||||
CU_ASSERT_EQUAL(pauline->stat.number_of_LinphoneCallConnected,1);
|
||||
CU_ASSERT_EQUAL(pauline->stat.number_of_LinphoneCallUpdating,1);
|
||||
|
||||
liblinphone_tester_check_rtcp(marie, pauline);
|
||||
|
||||
linphone_core_terminate_all_calls(pauline->lc);
|
||||
|
||||
CU_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallEnd,1,1000));
|
||||
CU_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallEnd,1,1000));
|
||||
|
||||
|
||||
ms_list_free(lcs);
|
||||
|
||||
linphone_core_manager_destroy(marie);
|
||||
linphone_core_manager_destroy(pauline);
|
||||
}
|
||||
|
||||
static void early_media_call_with_session_update(void){
|
||||
early_media_call_with_update_base(FALSE);
|
||||
}
|
||||
|
||||
static void early_media_call_with_codec_update(void){
|
||||
early_media_call_with_update_base(TRUE);
|
||||
}
|
||||
|
||||
static void simple_call_transfer(void) {
|
||||
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
|
||||
|
|
@ -1612,6 +1700,8 @@ test_t call_tests[] = {
|
|||
{ "Simple call compatibility mode", simple_call_compatibility_mode },
|
||||
{ "Early-media call", early_media_call },
|
||||
{ "Early-media call with ringing", early_media_call_with_ringing },
|
||||
{ "Early-media call with updated media session", early_media_call_with_session_update},
|
||||
{ "Early-media call with updated codec", early_media_call_with_codec_update},
|
||||
{ "Call terminated by caller", call_terminated_by_caller },
|
||||
{ "Call without SDP", call_with_no_sdp},
|
||||
{ "Call paused resumed", call_paused_resumed },
|
||||
|
|
|
|||
|
|
@ -1,48 +0,0 @@
|
|||
[sip]
|
||||
sip_port=5082
|
||||
sip_tcp_port=5082
|
||||
sip_tls_port=5083
|
||||
default_proxy=0
|
||||
ping_with_options=0
|
||||
register_only_when_network_is_up=0
|
||||
sdp_200_ack=1
|
||||
|
||||
[auth_info_0]
|
||||
username=marie
|
||||
userid=marie
|
||||
passwd=secret
|
||||
realm=sip.example.org
|
||||
|
||||
|
||||
[proxy_0]
|
||||
reg_proxy=sip.example.org;transport=tcp
|
||||
reg_route=sip.example.org;transport=tcp;lr
|
||||
reg_identity=sip:marie@sip.example.org
|
||||
reg_expires=3600
|
||||
reg_sendregister=1
|
||||
publish=0
|
||||
dial_escape_plus=0
|
||||
|
||||
[friend_0]
|
||||
url="Paupoche" <sip:pauline@sip.example.org>
|
||||
pol=accept
|
||||
subscribe=0
|
||||
|
||||
|
||||
[rtp]
|
||||
audio_rtp_port=8070
|
||||
video_rtp_port=8072
|
||||
|
||||
[video]
|
||||
display=0
|
||||
capture=0
|
||||
show_local=0
|
||||
size=vga
|
||||
enabled=0
|
||||
self_view=0
|
||||
automatically_initiate=0
|
||||
automatically_accept=0
|
||||
device=StaticImage: Static picture
|
||||
|
||||
[sound]
|
||||
echocancellation=0 #to not overload cpu in case of VG
|
||||
Loading…
Add table
Reference in a new issue