mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-07 14:18:25 +00:00
fix call error reporting when dialog is not established yet
This commit is contained in:
parent
eb26ab5c1c
commit
3d1c5e7ce1
4 changed files with 31 additions and 50 deletions
|
|
@ -350,11 +350,11 @@ static void process_response_event(void *user_ctx, const belle_sip_response_even
|
|||
|
||||
}
|
||||
static void process_timeout(void *user_ctx, const belle_sip_timeout_event_t *event) {
|
||||
/* belle_sip_client_transaction_t* client_transaction = belle_sip_timeout_event_get_client_transaction(event);
|
||||
belle_sip_client_transaction_t* client_transaction = belle_sip_timeout_event_get_client_transaction(event);
|
||||
SalOp* op = (SalOp*)belle_sip_transaction_get_application_data(BELLE_SIP_TRANSACTION(client_transaction));
|
||||
if (op->callbacks.process_timeout) {
|
||||
if (op && op->callbacks.process_timeout) {
|
||||
op->callbacks.process_timeout(op,event);
|
||||
} else*/ {
|
||||
} else {
|
||||
ms_error("Unhandled event timeout [%p]",event);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,9 +86,16 @@ static void call_process_io_error(void *user_ctx, const belle_sip_io_error_event
|
|||
}
|
||||
static void process_dialog_terminated(void *ctx, const belle_sip_dialog_terminated_event_t *event) {
|
||||
SalOp* op=(SalOp*)ctx;
|
||||
|
||||
if (op->dialog) {
|
||||
op->base.root->callbacks.call_terminated(op,op->dir==SalOpDirIncoming?sal_op_get_from(op):sal_op_get_to(op));
|
||||
op->state=SalOpStateTerminated;
|
||||
if (belle_sip_dialog_get_previous_state(op->dialog) == BELLE_SIP_DIALOG_CONFIRMED) {
|
||||
/*this is probably a "normal termination from a BYE*/
|
||||
op->base.root->callbacks.call_terminated(op,op->dir==SalOpDirIncoming?sal_op_get_from(op):sal_op_get_to(op));
|
||||
op->state=SalOpStateTerminated;
|
||||
} else {
|
||||
/*let the process response handle this case*/
|
||||
}
|
||||
|
||||
belle_sip_object_unref(op->dialog);
|
||||
op->dialog=NULL;
|
||||
}
|
||||
|
|
@ -124,48 +131,9 @@ static void call_response_event(void *op_base, const belle_sip_response_event_t
|
|||
reason = ms_strdup_printf("%s %s",reason,belle_sip_header_extension_get_value(BELLE_SIP_HEADER_EXTENSION(reason_header)));
|
||||
}
|
||||
if (code >=400) {
|
||||
switch(code) {
|
||||
case 400:
|
||||
error=SalErrorUnknown;
|
||||
break;
|
||||
case 404:
|
||||
error=SalErrorFailure;
|
||||
sr=SalReasonNotFound;
|
||||
break;
|
||||
case 415:
|
||||
error=SalErrorFailure;
|
||||
sr=SalReasonMedia;
|
||||
break;
|
||||
case 422:
|
||||
ms_error ("422 not implemented yet");;
|
||||
break;
|
||||
case 480:
|
||||
error=SalErrorFailure;
|
||||
sr=SalReasonTemporarilyUnavailable;
|
||||
break;
|
||||
case 486:
|
||||
error=SalErrorFailure;
|
||||
sr=SalReasonBusy;
|
||||
break;
|
||||
case 487:
|
||||
break;
|
||||
case 600:
|
||||
error=SalErrorFailure;
|
||||
sr=SalReasonDoNotDisturb;
|
||||
break;
|
||||
case 603:
|
||||
error=SalErrorFailure;
|
||||
sr=SalReasonDeclined;
|
||||
break;
|
||||
default:
|
||||
if (code>0){
|
||||
error=SalErrorFailure;
|
||||
sr=SalReasonUnknown;
|
||||
}else error=SalErrorNoResponse;
|
||||
/* no break */
|
||||
}
|
||||
|
||||
sal_compute_sal_errors_from_code(code,&error,&sr);
|
||||
op->base.root->callbacks.call_failure(op,error,sr,reason,code);
|
||||
op->state=SalOpStateTerminated;
|
||||
if (reason_header != NULL){
|
||||
ms_free(reason);
|
||||
}
|
||||
|
|
@ -246,7 +214,14 @@ static void call_response_event(void *op_base, const belle_sip_response_event_t
|
|||
|
||||
}
|
||||
static void call_process_timeout(void *user_ctx, const belle_sip_timeout_event_t *event) {
|
||||
ms_error("process_timeout not implemented yet");
|
||||
SalOp* op=(SalOp*)user_ctx;
|
||||
if (!op->dialog) {
|
||||
/*call terminated very early*/
|
||||
op->base.root->callbacks.call_failure(op,SalErrorNoResponse,SalReasonUnknown,"Request Timeout",408);
|
||||
op->state=SalOpStateTerminated;
|
||||
} else {
|
||||
/*dialog will terminated shortly, nothing to do*/
|
||||
}
|
||||
}
|
||||
static void call_process_transaction_terminated(void *user_ctx, const belle_sip_transaction_terminated_event_t *event) {
|
||||
ms_error("process_transaction_terminated not implemented yet");
|
||||
|
|
|
|||
|
|
@ -119,8 +119,8 @@ int sal_op_send_request(SalOp* op, belle_sip_request_t* request) {
|
|||
belle_sip_header_route_t* route_header;
|
||||
belle_sip_uri_t* outbound_proxy=NULL;
|
||||
MSList* iterator;
|
||||
if (!op->dialog) {
|
||||
/*don't put route header if dialog is in confirmed state*/
|
||||
if (!op->dialog || belle_sip_dialog_get_state(op->dialog) == BELLE_SIP_DIALOG_NULL) {
|
||||
/*don't put route header if dialog is in confirmed state*/
|
||||
for(iterator=(MSList*)sal_op_get_route_addresses(op);iterator!=NULL;iterator=iterator->next) {
|
||||
if(!outbound_proxy) {
|
||||
/*first toute is outbound proxy*/
|
||||
|
|
|
|||
|
|
@ -97,7 +97,13 @@ static void register_response_event(void *user_ctx, const belle_sip_response_eve
|
|||
}
|
||||
}
|
||||
static void register_process_timeout(void *user_ctx, const belle_sip_timeout_event_t *event) {
|
||||
ms_error("process_timeout not implemented yet");
|
||||
SalOp* op = (SalOp*)user_ctx;
|
||||
ms_error("register_process_timeout timeout error reported for [%s]",sal_op_get_proxy(op));
|
||||
if (!op->registration_refresher) {
|
||||
op->base.root->callbacks.register_failure(op,SalErrorNoResponse,SalReasonUnknown,"Request Timeout");
|
||||
} else {
|
||||
/*refresher will report error*/
|
||||
}
|
||||
}
|
||||
static void register_process_transaction_terminated(void *user_ctx, const belle_sip_transaction_terminated_event_t *event) {
|
||||
ms_error("process_transaction_terminated not implemented yet");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue