linphone-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Linphone-developers] I guess I found a bug in file sal_op_call.c, from


From: Rodrigo Pimenta Carvalho
Subject: [Linphone-developers] I guess I found a bug in file sal_op_call.c, from liblinphone
Date: Tue, 25 Mar 2014 18:39:46 -0300

Hi.
I was analyzing the code for linphone-android. See what I have found, please.

In file sal_op_call.c, we have:

int sal_call_decline(SalOp *op, SalReason reason, const char *redirection /*optional*/){
belle_sip_response_t* response;
belle_sip_header_contact_t* contact=NULL;
int status=sal_reason_to_sip_code(reason);


if (reason==SalReasonRedirect){
if (redirection!=NULL) {
if (strstr(redirection,"sip:")!=0) status=302;
status=380;  <------------------------------------------------------------------------------------------------ This line seems to be forgotten here!
contact= belle_sip_header_contact_new();
belle_sip_header_address_set_uri(BELLE_SIP_HEADER_ADDRESS(contact),belle_sip_uri_parse(redirection));
} else {
ms_error("Cannot redirect to null");
}
}
response = sal_op_create_response_from_request(op,belle_sip_transaction_get_request(BELLE_SIP_TRANSACTION(op->pending_server_trans)),status);
if (contact) belle_sip_message_add_header(BELLE_SIP_MESSAGE(response),BELLE_SIP_HEADER(contact));
belle_sip_server_transaction_send_response(op->pending_server_trans,response);
return 0;
}

Why does someone would set status to 380 immediately setting it to 302?
Is it a bug? If not, why should the code set the status to 380 in this point?
Maybe we have to put a "else" somewhere in this code to decide between setting status to 302 or 380, haven't we? Confirm, please.

Any reply will be very helpful!
Thanks alot.
Rodrigo Pimenta Carvalho.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]