Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
4386f18b
Commit
4386f18b
authored
Apr 22, 2014
by
Gautier Pelloux-Prayer
Browse files
replace tabs with spaces and remove trailing spaces
parent
ee6d1e50
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
279 additions
and
279 deletions
+279
-279
coreapi/bellesip_sal/sal_impl.c
coreapi/bellesip_sal/sal_impl.c
+18
-18
coreapi/bellesip_sal/sal_op_call.c
coreapi/bellesip_sal/sal_op_call.c
+16
-16
coreapi/bellesip_sal/sal_op_impl.c
coreapi/bellesip_sal/sal_op_impl.c
+24
-24
coreapi/chat.c
coreapi/chat.c
+16
-16
coreapi/friend.c
coreapi/friend.c
+12
-12
coreapi/linphone_tunnel_stubs.c
coreapi/linphone_tunnel_stubs.c
+2
-2
coreapi/linphonecore.c
coreapi/linphonecore.c
+16
-16
coreapi/misc.c
coreapi/misc.c
+25
-25
coreapi/offeranswer.c
coreapi/offeranswer.c
+17
-17
coreapi/offeranswer.h
coreapi/offeranswer.h
+4
-4
coreapi/quality_reporting.c
coreapi/quality_reporting.c
+42
-42
coreapi/sal.c
coreapi/sal.c
+2
-2
coreapi/upnp.c
coreapi/upnp.c
+55
-55
coreapi/xml2lpc.c
coreapi/xml2lpc.c
+30
-30
No files found.
coreapi/bellesip_sal/sal_impl.c
View file @
4386f18b
...
...
@@ -117,7 +117,7 @@ void sal_process_authentication(SalOp *op) {
belle_sip_response_t
*
response
=
belle_sip_transaction_get_response
((
belle_sip_transaction_t
*
)
op
->
pending_auth_transaction
);
belle_sip_header_from_t
*
from
=
belle_sip_message_get_header_by_type
(
initial_request
,
belle_sip_header_from_t
);
belle_sip_uri_t
*
from_uri
=
belle_sip_header_address_get_uri
((
belle_sip_header_address_t
*
)
from
);
if
(
strcasecmp
(
belle_sip_uri_get_host
(
from_uri
),
"anonymous.invalid"
)
==
0
){
/*prefer using the from from the SalOp*/
from_uri
=
belle_sip_header_address_get_uri
((
belle_sip_header_address_t
*
)
sal_op_get_from_address
(
op
));
...
...
@@ -137,7 +137,7 @@ void sal_process_authentication(SalOp *op) {
ms_error
(
"sal_process_authentication() op=[%p] cannot obtain new request from dialog."
,
op
);
return
;
}
if
(
belle_sip_provider_add_authorization
(
op
->
base
.
root
->
prov
,
new_request
,
response
,
from_uri
,
&
auth_list
))
{
if
(
is_within_dialog
)
{
sal_op_send_request
(
op
,
new_request
);
...
...
@@ -308,7 +308,7 @@ static void process_response_event(void *user_ctx, const belle_sip_response_even
belle_sip_client_transaction_t
*
client_transaction
=
belle_sip_response_event_get_client_transaction
(
event
);
belle_sip_response_t
*
response
=
belle_sip_response_event_get_response
(
event
);
int
response_code
=
belle_sip_response_get_status_code
(
response
);
if
(
!
client_transaction
)
{
ms_warning
(
"Discarding stateless response [%i]"
,
response_code
);
return
;
...
...
@@ -334,11 +334,11 @@ static void process_response_event(void *user_ctx, const belle_sip_response_even
}
sal_op_assign_recv_headers
(
op
,(
belle_sip_message_t
*
)
response
);
if
(
op
->
callbacks
&&
op
->
callbacks
->
process_response_event
)
{
/*handle authorization*/
switch
(
response_code
)
{
case
200
:
case
200
:
break
;
case
401
:
case
407
:
...
...
@@ -677,10 +677,10 @@ static void set_tls_properties(Sal *ctx){
if
(
lp
){
belle_sip_tls_listening_point_t
*
tlp
=
BELLE_SIP_TLS_LISTENING_POINT
(
lp
);
int
verify_exceptions
=
0
;
if
(
!
ctx
->
tls_verify
)
verify_exceptions
=
BELLE_SIP_TLS_LISTENING_POINT_BADCERT_ANY_REASON
;
else
if
(
!
ctx
->
tls_verify_cn
)
verify_exceptions
=
BELLE_SIP_TLS_LISTENING_POINT_BADCERT_CN_MISMATCH
;
belle_sip_tls_listening_point_set_root_ca
(
tlp
,
ctx
->
root_ca
);
/*root_ca might be NULL */
belle_sip_tls_listening_point_set_verify_exceptions
(
tlp
,
verify_exceptions
);
}
...
...
@@ -802,7 +802,7 @@ void sal_auth_info_set_mode(SalAuthInfo* auth_info, SalAuthMode mode) { auth_inf
void
sal_certificates_chain_delete
(
SalCertificatesChain
*
chain
)
{
belle_sip_object_unref
((
belle_sip_object_t
*
)
chain
);
}
void
sal_signing_key_delete
(
SalSigningKey
*
key
)
{
void
sal_signing_key_delete
(
SalSigningKey
*
key
)
{
belle_sip_object_unref
((
belle_sip_object_t
*
)
key
);
}
...
...
@@ -829,7 +829,7 @@ int sal_auth_compute_ha1(const char* userid,const char* realm,const char* passwo
SalCustomHeader
*
sal_custom_header_append
(
SalCustomHeader
*
ch
,
const
char
*
name
,
const
char
*
value
){
belle_sip_message_t
*
msg
=
(
belle_sip_message_t
*
)
ch
;
belle_sip_header_t
*
h
;
if
(
msg
==
NULL
){
msg
=
(
belle_sip_message_t
*
)
belle_sip_request_new
();
belle_sip_object_ref
(
msg
);
...
...
@@ -846,7 +846,7 @@ SalCustomHeader *sal_custom_header_append(SalCustomHeader *ch, const char *name,
const
char
*
sal_custom_header_find
(
const
SalCustomHeader
*
ch
,
const
char
*
name
){
if
(
ch
){
belle_sip_header_t
*
h
=
belle_sip_message_get_header
((
belle_sip_message_t
*
)
ch
,
name
);
if
(
h
){
return
belle_sip_header_get_unparsed_value
(
h
);
}
...
...
@@ -879,12 +879,12 @@ void sal_set_uuid(Sal *sal, const char *uuid){
}
typedef
struct
{
unsigned
int
time_low
;
unsigned
short
time_mid
;
unsigned
short
time_hi_and_version
;
unsigned
char
clock_seq_hi_and_reserved
;
unsigned
char
clock_seq_low
;
unsigned
char
node
[
6
];
unsigned
int
time_low
;
unsigned
short
time_mid
;
unsigned
short
time_hi_and_version
;
unsigned
char
clock_seq_hi_and_reserved
;
unsigned
char
clock_seq_low
;
unsigned
char
node
[
6
];
}
sal_uuid_t
;
...
...
@@ -892,7 +892,7 @@ int sal_create_uuid(Sal*ctx, char *uuid, size_t len){
sal_uuid_t
uuid_struct
;
int
i
;
int
written
;
if
(
len
==
0
)
return
-
1
;
/*create an UUID as described in RFC4122, 4.4 */
belle_sip_random_bytes
((
unsigned
char
*
)
&
uuid_struct
,
sizeof
(
sal_uuid_t
));
...
...
@@ -900,7 +900,7 @@ int sal_create_uuid(Sal*ctx, char *uuid, size_t len){
uuid_struct
.
clock_seq_hi_and_reserved
|=
1
<<
7
;
uuid_struct
.
time_hi_and_version
&=~
(
0xf
<<
12
);
uuid_struct
.
time_hi_and_version
|=
4
<<
12
;
written
=
snprintf
(
uuid
,
len
,
"%8.8x-%4.4x-%4.4x-%2.2x%2.2x-"
,
uuid_struct
.
time_low
,
uuid_struct
.
time_mid
,
uuid_struct
.
time_hi_and_version
,
uuid_struct
.
clock_seq_hi_and_reserved
,
uuid_struct
.
clock_seq_low
);
...
...
coreapi/bellesip_sal/sal_op_call.c
View file @
4386f18b
...
...
@@ -111,9 +111,9 @@ static int set_sdp_from_desc(belle_sip_message_t *msg, const SalMediaDescription
}
static
void
call_process_io_error
(
void
*
user_ctx
,
const
belle_sip_io_error_event_t
*
event
){
SalOp
*
op
=
(
SalOp
*
)
user_ctx
;
if
(
op
->
state
==
SalOpStateTerminated
)
return
;
if
(
!
op
->
dialog
)
{
/*call terminated very early*/
sal_error_info_set
(
&
op
->
error_info
,
SalReasonIOError
,
503
,
"IO error"
,
NULL
);
...
...
@@ -129,7 +129,7 @@ static void process_dialog_terminated(void *ctx, const belle_sip_dialog_terminat
if
(
op
->
dialog
&&
op
->
dialog
==
belle_sip_dialog_terminated_event_get_dialog
(
event
))
{
/*belle_sip_transaction_t* trans=belle_sip_dialog_get_last_transaction(op->dialog);*/
ms_message
(
"Dialog [%p] terminated for op [%p]"
,
belle_sip_dialog_terminated_event_get_dialog
(
event
),
op
);
switch
(
belle_sip_dialog_get_previous_state
(
op
->
dialog
))
{
case
BELLE_SIP_DIALOG_CONFIRMED
:
if
(
op
->
state
!=
SalOpStateTerminated
&&
op
->
state
!=
SalOpStateTerminating
)
{
...
...
@@ -192,7 +192,7 @@ static void call_process_response(void *op_base, const belle_sip_response_event_
req
=
belle_sip_transaction_get_request
(
BELLE_SIP_TRANSACTION
(
client_transaction
));
set_or_update_dialog
(
op
,
belle_sip_response_event_get_dialog
(
event
));
dialog_state
=
op
->
dialog
?
belle_sip_dialog_get_state
(
op
->
dialog
)
:
BELLE_SIP_DIALOG_NULL
;
ms_message
(
"Op [%p] receiving call response [%i], dialog is [%p] in state [%s]"
,
op
,
code
,
op
->
dialog
,
belle_sip_dialog_state_to_string
(
dialog_state
));
switch
(
dialog_state
)
{
...
...
@@ -290,9 +290,9 @@ static void call_process_response(void *op_base, const belle_sip_response_event_
static
void
call_process_timeout
(
void
*
user_ctx
,
const
belle_sip_timeout_event_t
*
event
)
{
SalOp
*
op
=
(
SalOp
*
)
user_ctx
;
if
(
op
->
state
==
SalOpStateTerminated
)
return
;
if
(
!
op
->
dialog
)
{
/*call terminated very early*/
sal_error_info_set
(
&
op
->
error_info
,
SalReasonRequestTimeout
,
408
,
"Request timeout"
,
NULL
);
...
...
@@ -342,7 +342,7 @@ static void unsupported_method(belle_sip_server_transaction_t* server_transactio
* Extract the sdp from a sip message.
* If there is no body in the message, the session_desc is set to null, 0 is returned.
* If body was present is not a SDP or parsing of SDP failed, -1 is returned and SalReason is set appropriately.
*
*
**/
static
int
extract_sdp
(
belle_sip_message_t
*
message
,
belle_sdp_session_description_t
**
session_desc
,
SalReason
*
error
)
{
belle_sip_header_content_type_t
*
content_type
=
belle_sip_message_get_header_by_type
(
message
,
belle_sip_header_content_type_t
);
...
...
@@ -388,7 +388,7 @@ static int process_sdp_for_invite(SalOp* op,belle_sip_request_t* invite) {
belle_sip_object_unref
(
sdp
);
}
else
op
->
sdp_offering
=
TRUE
;
/*INVITE without SDP*/
}
else
err
=-
1
;
if
(
err
==-
1
){
sal_call_decline
(
op
,
reason
,
NULL
);
}
...
...
@@ -582,7 +582,7 @@ int sal_call_set_local_media_description(SalOp *op, SalMediaDescription *desc){
if
(
op
->
base
.
local_media
)
sal_media_description_unref
(
op
->
base
.
local_media
);
op
->
base
.
local_media
=
desc
;
if
(
op
->
base
.
remote_media
){
/*case of an incoming call where we modify the local capabilities between the time
* the call is ringing and it is accepted (for example if you want to accept without video*/
...
...
@@ -597,7 +597,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, UPDATE"
);
header_allow
=
belle_sip_header_allow_create
(
"INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO, UPDATE"
);
return
header_allow
;
}
...
...
@@ -633,7 +633,7 @@ int sal_call(SalOp *op, const char *from, const char *to){
}
if
(
op
->
referred_by
)
belle_sip_message_add_header
(
BELLE_SIP_MESSAGE
(
invite
),
BELLE_SIP_HEADER
(
op
->
referred_by
));
return
sal_op_send_request
(
op
,
invite
);
}
...
...
@@ -679,7 +679,7 @@ int sal_call_notify_ringing(SalOp *op, bool_t early_media){
belle_sip_response_t
*
ringing_response
=
sal_op_create_response_from_request
(
op
,
req
,
status_code
);
belle_sip_header_t
*
require
;
const
char
*
tags
=
NULL
;
if
(
early_media
){
handle_offer_answer_response
(
op
,
ringing_response
);
}
...
...
@@ -692,7 +692,7 @@ int sal_call_notify_ringing(SalOp *op, bool_t early_media){
}
#ifndef SAL_OP_CALL_FORCE_CONTACT_IN_RINGING
if
(
tags
&&
strstr
(
tags
,
"100rel"
)
!=
0
)
if
(
tags
&&
strstr
(
tags
,
"100rel"
)
!=
0
)
#endif
{
belle_sip_header_address_t
*
contact
=
(
belle_sip_header_address_t
*
)
sal_op_get_contact_address
(
op
);
...
...
@@ -740,7 +740,7 @@ int sal_call_accept(SalOp*h){
if
((
contact_header
=
sal_op_create_contact
(
h
)))
{
belle_sip_message_add_header
(
BELLE_SIP_MESSAGE
(
response
),
BELLE_SIP_HEADER
(
contact_header
));
}
_sal_op_add_custom_headers
(
h
,
BELLE_SIP_MESSAGE
(
response
));
handle_offer_answer_response
(
h
,
response
);
...
...
@@ -757,7 +757,7 @@ int sal_call_decline(SalOp *op, SalReason reason, const char *redirection /*opti
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
;
...
...
@@ -812,7 +812,7 @@ int sal_call_send_dtmf(SalOp *h, char dtmf){
if
(
req
){
int
bodylen
;
char
dtmf_body
[
128
]
=
{
0
};
snprintf
(
dtmf_body
,
sizeof
(
dtmf_body
)
-
1
,
"Signal=%c
\r\n
Duration=250
\r\n
"
,
dtmf
);
bodylen
=
strlen
(
dtmf_body
);
belle_sip_message_set_body
((
belle_sip_message_t
*
)
req
,
dtmf_body
,
bodylen
);
...
...
coreapi/bellesip_sal/sal_op_impl.c
View file @
4386f18b
...
...
@@ -90,19 +90,19 @@ SalAuthInfo * sal_op_get_auth_requested(SalOp *op){
belle_sip_header_contact_t
*
sal_op_create_contact
(
SalOp
*
op
){
belle_sip_header_contact_t
*
contact_header
;
belle_sip_uri_t
*
contact_uri
;
if
(
sal_op_get_contact_address
(
op
))
{
contact_header
=
belle_sip_header_contact_create
(
BELLE_SIP_HEADER_ADDRESS
(
sal_op_get_contact_address
(
op
)));
}
else
{
contact_header
=
belle_sip_header_contact_new
();
}
if
(
!
(
contact_uri
=
belle_sip_header_address_get_uri
(
BELLE_SIP_HEADER_ADDRESS
(
contact_header
))))
{
/*no uri, just creating a new one*/
contact_uri
=
belle_sip_uri_new
();
belle_sip_header_address_set_uri
(
BELLE_SIP_HEADER_ADDRESS
(
contact_header
),
contact_uri
);
}
belle_sip_uri_set_secure
(
contact_uri
,
sal_op_is_secure
(
op
));
if
(
op
->
privacy
!=
SalPrivacyNone
){
belle_sip_uri_set_user
(
contact_uri
,
NULL
);
...
...
@@ -213,7 +213,7 @@ void sal_op_resend_request(SalOp* op, belle_sip_request_t* request) {
}
static
void
add_headers
(
SalOp
*
op
,
belle_sip_header_t
*
h
,
belle_sip_message_t
*
msg
){
if
(
BELLE_SIP_OBJECT_IS_INSTANCE_OF
(
h
,
belle_sip_header_contact_t
)){
belle_sip_header_contact_t
*
newct
;
/*special case for contact, we want to keep everything from the custom contact but set automatic mode and add our own parameters as well*/
...
...
@@ -224,7 +224,7 @@ static void add_headers(SalOp *op, belle_sip_header_t *h, belle_sip_message_t *m
}
/*if a header already exists in the message, replace it*/
belle_sip_message_set_header
(
msg
,
h
);
}
void
_sal_op_add_custom_headers
(
SalOp
*
op
,
belle_sip_message_t
*
msg
){
...
...
@@ -246,20 +246,20 @@ static int _sal_op_send_request_with_contact(SalOp* op, belle_sip_request_t* req
belle_sip_header_contact_t
*
contact
;
int
result
=-
1
;
belle_sip_uri_t
*
next_hop_uri
=
NULL
;
if
(
add_contact
)
{
contact
=
sal_op_create_contact
(
op
);
belle_sip_message_set_header
(
BELLE_SIP_MESSAGE
(
request
),
BELLE_SIP_HEADER
(
contact
));
}
_sal_op_add_custom_headers
(
op
,
(
belle_sip_message_t
*
)
request
);
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*/
const
MSList
*
elem
=
sal_op_get_route_addresses
(
op
);
const
char
*
transport
;
const
char
*
method
=
belle_sip_request_get_method
(
request
);
if
(
elem
)
{
outbound_proxy
=
belle_sip_header_address_get_uri
((
belle_sip_header_address_t
*
)
elem
->
data
);
next_hop_uri
=
outbound_proxy
;
...
...
@@ -284,7 +284,7 @@ static int _sal_op_send_request_with_contact(SalOp* op, belle_sip_request_t* req
}
}
}
if
((
strcmp
(
method
,
"REGISTER"
)
==
0
||
strcmp
(
method
,
"SUBSCRIBE"
)
==
0
)
&&
transport
&&
if
((
strcmp
(
method
,
"REGISTER"
)
==
0
||
strcmp
(
method
,
"SUBSCRIBE"
)
==
0
)
&&
transport
&&
(
strcasecmp
(
transport
,
"TCP"
)
==
0
||
strcasecmp
(
transport
,
"TLS"
)
==
0
)){
/*RFC 5923: add 'alias' parameter to tell the server that we want it to keep the connection for future requests*/
belle_sip_header_via_t
*
via
=
belle_sip_message_get_header_by_type
(
BELLE_SIP_MESSAGE
(
request
),
belle_sip_header_via_t
);
...
...
@@ -307,12 +307,12 @@ static int _sal_op_send_request_with_contact(SalOp* op, belle_sip_request_t* req
belle_sip_provider_add_authorization
(
op
->
base
.
root
->
prov
,
request
,
NULL
,
NULL
,
NULL
);
}
result
=
belle_sip_client_transaction_send_request_to
(
client_transaction
,
next_hop_uri
/*might be null*/
);
/*update call id if not set yet for this OP*/
if
(
result
==
0
&&
!
op
->
base
.
call_id
)
{
op
->
base
.
call_id
=
ms_strdup
(
belle_sip_header_call_id_get_call_id
(
BELLE_SIP_HEADER_CALL_ID
(
belle_sip_message_get_header_by_type
(
BELLE_SIP_MESSAGE
(
request
),
belle_sip_header_call_id_t
))));
}
return
result
;
}
...
...
@@ -323,9 +323,9 @@ int sal_op_send_request(SalOp* op, belle_sip_request_t* request) {
return
-
1
;
/*sanity check*/
}
/*
Header field where proxy ACK BYE CAN INV OPT REG
___________________________________________________________
Contact R o - - m o o
Header field where proxy ACK BYE CAN INV OPT REG
___________________________________________________________
Contact R o - - m o o
*/
if
(
strcmp
(
belle_sip_request_get_method
(
request
),
"INVITE"
)
==
0
||
strcmp
(
belle_sip_request_get_method
(
request
),
"REGISTER"
)
==
0
...
...
@@ -415,7 +415,7 @@ SalReason sal_reason_to_sip_code(SalReason r){
SalReason
_sal_reason_from_sip_code
(
int
code
)
{
if
(
code
>=
100
&&
code
<
300
)
return
SalReasonNone
;
switch
(
code
)
{
case
0
:
return
SalReasonIOError
;
...
...
@@ -490,7 +490,7 @@ void sal_error_info_reset(SalErrorInfo *ei){
if
(
ei
->
warnings
){
ms_free
(
ei
->
warnings
);
ei
->
warnings
=
NULL
;
}
if
(
ei
->
full_string
){
ms_free
(
ei
->
full_string
);
...
...
@@ -522,7 +522,7 @@ void sal_op_set_error_info_from_response(SalOp *op, belle_sip_response_t *respon
belle_sip_header_t
*
warning
=
belle_sip_message_get_header
(
BELLE_SIP_MESSAGE
(
response
),
"Warning"
);
SalErrorInfo
*
ei
=&
op
->
error_info
;
const
char
*
warnings
;
warnings
=
warning
?
belle_sip_header_get_unparsed_value
(
warning
)
:
NULL
;
if
(
warnings
==
NULL
)
warnings
=
reason_header
?
belle_sip_header_get_unparsed_value
(
reason_header
)
:
NULL
;
sal_error_info_set
(
ei
,
SalReasonUnknown
,
code
,
reason_phrase
,
warnings
);
...
...
@@ -618,7 +618,7 @@ void sal_op_assign_recv_headers(SalOp *op, belle_sip_message_t *incoming){
}
const
char
*
sal_op_get_remote_contact
(
const
SalOp
*
op
){
/*
/*
* remote contact is filled in process_response
* return sal_custom_header_find(op->base.recv_custom_headers,"Contact");
*/
...
...
@@ -649,16 +649,16 @@ bool_t sal_op_get_body(SalOp *op, belle_sip_message_t *msg, SalBody *salbody){
belle_sip_header_content_type_t
*
content_type
;
belle_sip_header_content_length_t
*
clen
=
NULL
;
belle_sip_header_t
*
content_encoding
;
content_type
=
belle_sip_message_get_header_by_type
(
msg
,
belle_sip_header_content_type_t
);
if
(
content_type
){
body
=
belle_sip_message_get_body
(
msg
);
clen
=
belle_sip_message_get_header_by_type
(
msg
,
belle_sip_header_content_length_t
);
}
content_encoding
=
belle_sip_message_get_header
(
msg
,
"Content-encoding"
);
memset
(
salbody
,
0
,
sizeof
(
SalBody
));
if
(
content_type
&&
body
&&
clen
)
{
salbody
->
type
=
belle_sip_header_content_type_get_type
(
content_type
);
salbody
->
subtype
=
belle_sip_header_content_type_get_subtype
(
content_type
);
...
...
@@ -693,7 +693,7 @@ bool_t sal_op_is_ipv6(SalOp *op){
belle_sip_transaction_t
*
tr
=
NULL
;
belle_sip_header_address_t
*
contact
;
belle_sip_request_t
*
req
;
if
(
op
->
refresher
)
tr
=
(
belle_sip_transaction_t
*
)
belle_sip_refresher_get_transaction
(
op
->
refresher
);
...
...
@@ -701,7 +701,7 @@ bool_t sal_op_is_ipv6(SalOp *op){
tr
=
(
belle_sip_transaction_t
*
)
op
->
pending_client_trans
;
if
(
tr
==
NULL
)
tr
=
(
belle_sip_transaction_t
*
)
op
->
pending_server_trans
;
if
(
tr
==
NULL
){
ms_error
(
"Unable to determine IP version from signaling operation."
);
return
FALSE
;
...
...
coreapi/chat.c
View file @
4386f18b
...
...
@@ -21,7 +21,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "linphonecore.h"
#include "private.h"
#include "lpconfig.h"
...
...
@@ -116,7 +116,7 @@ bool_t linphone_chat_room_matches(LinphoneChatRoom *cr, const LinphoneAddress *f
LinphoneChatRoom
*
linphone_core_get_or_create_chat_room
(
LinphoneCore
*
lc
,
const
char
*
to
)
{
LinphoneAddress
*
to_addr
=
linphone_core_interpret_url
(
lc
,
to
);
LinphoneChatRoom
*
ret
;
if
(
to_addr
==
NULL
){
ms_error
(
"linphone_core_get_or_create_chat_room(): Cannot make a valid address with %s"
,
to
);
return
NULL
;
...
...
@@ -176,7 +176,7 @@ static void _linphone_chat_room_send_message(LinphoneChatRoom *cr, LinphoneChatM
char
*
content_type
;
const
char
*
identity
=
NULL
;
time_t
t
=
time
(
NULL
);
if
(
lp_config_get_int
(
cr
->
lc
->
config
,
"sip"
,
"chat_use_call_dialogs"
,
0
)){
if
((
call
=
linphone_core_get_call_by_remote_address
(
cr
->
lc
,
cr
->
peer
))
!=
NULL
){
if
(
call
->
state
==
LinphoneCallConnected
||
...
...
@@ -266,7 +266,7 @@ void linphone_core_message_received(LinphoneCore *lc, SalOp *op, const SalMessag
char
*
from
;
LinphoneChatMessage
*
msg
;
const
SalCustomHeader
*
ch
;
addr
=
linphone_address_new
(
sal_msg
->
from
);
linphone_address_clean
(
addr
);
cr
=
linphone_core_get_chat_room
(
lc
,
addr
);
...
...
@@ -278,20 +278,20 @@ void linphone_core_message_received(LinphoneCore *lc, SalOp *op, const SalMessag
}
msg
=
linphone_chat_room_create_message
(
cr
,
sal_msg
->
text
);
linphone_chat_message_set_from
(
msg
,
cr
->
peer_url
);
{
LinphoneAddress
*
to
;
to
=
sal_op_get_to
(
op
)
?
linphone_address_new
(
sal_op_get_to
(
op
))
:
linphone_address_new
(
linphone_core_get_identity
(
lc
));
msg
->
to
=
to
;
}
msg
->
time
=
sal_msg
->
time
;
msg
->
state
=
LinphoneChatMessageStateDelivered
;
msg
->
is_read
=
FALSE
;
msg
->
dir
=
LinphoneChatMessageIncoming
;
ch
=
sal_op_get_recv_custom_header
(
op
);
if
(
ch
)
msg
->
custom_headers
=
sal_custom_header_clone
(
ch
);
if
(
sal_msg
->
url
)
{
linphone_chat_message_set_external_body_url
(
msg
,
sal_msg
->
url
);
}
...
...
@@ -437,8 +437,8 @@ LinphoneChatMessage* linphone_chat_room_create_message(LinphoneChatRoom *cr, con
* @return a new #LinphoneChatMessage
*/
LinphoneChatMessage
*
linphone_chat_room_create_message_2
(
LinphoneChatRoom
*
cr
,
const
char
*
message
,
const
char
*
external_body_url
,
LinphoneChatMessageState
state
,
time_t
time
,
bool_t
is_read
,
bool_t
is_incoming
)
{
LinphoneChatRoom
*
cr
,
const
char
*
message
,
const
char
*
external_body_url
,
LinphoneChatMessageState
state
,
time_t
time
,
bool_t
is_read
,
bool_t
is_incoming
)
{
LinphoneCore
*
lc
=
linphone_chat_room_get_lc
(
cr
);
LinphoneChatMessage
*
msg
=
belle_sip_object_new
(
LinphoneChatMessage
);
...
...
@@ -605,13 +605,13 @@ void linphone_chat_room_compose(LinphoneChatRoom *cr) {
*/
const
char
*
linphone_chat_message_state_to_string
(
const
LinphoneChatMessageState
state
)
{
switch
(
state
)
{
case
LinphoneChatMessageStateIdle
:
return
"LinphoneChatMessageStateIdle"
;
case
LinphoneChatMessageStateIdle
:
return
"LinphoneChatMessageStateIdle"
;
case
LinphoneChatMessageStateInProgress
:
return
"LinphoneChatMessageStateInProgress"
;
case
LinphoneChatMessageStateDelivered
:
return
"LinphoneChatMessageStateDelivered"
;
case
LinphoneChatMessageStateNotDelivered
:
return
"LinphoneChatMessageStateNotDelivered"
;
default:
return
"Unknown state"
;
}
}
/**
...
...
@@ -653,8 +653,8 @@ const char* linphone_chat_message_get_external_body_url(const LinphoneChatMessag
/**
* Linphone message can carry external body as defined by rfc2017
*
* @param message a LinphoneChatMessage
*
* @param message a LinphoneChatMessage
* @param url ex: access-type=URL; URL="http://www.foo.com/file"
*/
void
linphone_chat_message_set_external_body_url
(
LinphoneChatMessage
*
message
,
const
char
*
url
)
{
...
...
@@ -675,7 +675,7 @@ void linphone_chat_message_set_from(LinphoneChatMessage* message, const Linphone
}
/**
* Get origin of the message
* Get origin of the message
*@param message #LinphoneChatMessage obj
*@return #LinphoneAddress
*/
...
...
@@ -694,7 +694,7 @@ void linphone_chat_message_set_to(LinphoneChatMessage* message, const LinphoneAd
}
/**
* Get destination of the message
* Get destination of the message
*@param message #LinphoneChatMessage obj
*@return #LinphoneAddress
*/
...
...
@@ -780,7 +780,7 @@ bool_t linphone_chat_message_is_outgoing(LinphoneChatMessage* message) {
* @return the id
*/
unsigned
int
linphone_chat_message_get_storage_id
(
LinphoneChatMessage
*
message
)
{
return
message
->
storage_id
;
return
message
->
storage_id
;
}
/**
...
...
coreapi/friend.c
View file @
4386f18b
...
...
@@ -62,8 +62,8 @@ const char *linphone_online_status_to_string(LinphoneOnlineStatus ss){
case
LinphoneStatusPending
:
str
=
_
(
"Pending"
);
break
;
case
LinphoneStatusVacation
:
str
=
_
(
"Vacation"
);
case
LinphoneStatusVacation
:
str
=
_
(
"Vacation"
);
default:
str
=
_
(
"Unknown-bug"
);
}
...
...
@@ -109,7 +109,7 @@ LinphoneFriend *linphone_find_friend_by_out_subscribe(MSList *l, SalOp *op){
void
__linphone_friend_do_subscribe
(
LinphoneFriend
*
fr
){
LinphoneCore
*
lc
=
fr
->
lc
;
if
(
fr
->
outsub
==
NULL
){
/* people for which we don't have yet an answer should appear as offline */
fr
->
presence
=
NULL
;
...
...
@@ -132,7 +132,7 @@ LinphoneFriend * linphone_friend_new(){
obj
->
pol
=
LinphoneSPAccept
;
obj
->
presence
=
NULL
;
obj
->
subscribe
=
TRUE
;
return
obj
;
return
obj
;
}
LinphoneFriend
*
linphone_friend_new_with_address
(
const
char
*
addr
){
...
...
@@ -255,7 +255,7 @@ void linphone_friend_close_subscriptions(LinphoneFriend *lf){
linphone_friend_unsubscribe
(
lf
);
if
(
lf
->
insub
){
sal_notify_presence_close
(
lf
->
insub
);
}
}
...
...
@@ -388,7 +388,7 @@ BuddyInfo * linphone_friend_get_info(const LinphoneFriend *lf){
**/
void
linphone_friend_update_subscribes
(
LinphoneFriend
*
fr
,
LinphoneProxyConfig
*
proxy
,
bool_t
only_when_registered
){
int
can_subscribe
=
1
;
if
(
only_when_registered
&&
(
fr
->
subscribe
||
fr
->
subscribe_active
)){
LinphoneProxyConfig
*
cfg
=
linphone_core_lookup_known_proxy
(
fr
->
lc
,
fr
->
uri
);
if
(
proxy
&&
proxy
!=
cfg
)
return
;
...
...
@@ -592,13 +592,13 @@ LinphoneFriend * linphone_friend_new_from_config_file(LinphoneCore *lc, int inde
int
a
;
LinphoneFriend
*
lf
;
LpConfig
*
config
=
lc
->
config
;
sprintf
(
item
,
"friend_%i"
,
index
);
if
(
!
lp_config_has_section
(
config
,
item
)){
return
NULL
;
}
tmp
=
lp_config_get_string
(
config
,
item
,
"url"
,
NULL
);
if
(
tmp
==
NULL
)
{
return
NULL
;
...
...
@@ -614,7 +614,7 @@ LinphoneFriend * linphone_friend_new_from_config_file(LinphoneCore *lc, int inde
}
a
=
lp_config_get_int
(
config
,
item
,
"subscribe"
,
0
);
linphone_friend_send_subscribe
(
lf
,
a
);
linphone_friend_set_ref_key
(
lf
,
lp_config_get_string
(
config
,
item
,
"refkey"
,
NULL
));
return
lf
;
}
...
...
@@ -639,9 +639,9 @@ void linphone_friend_write_to_config_file(LpConfig *config, LinphoneFriend *lf,
char
key
[
50
];
char
*
tmp
;
const
char
*
refkey
;
sprintf
(
key
,
"friend_%i"
,
index
);
if
(
lf
==
NULL
){
lp_config_clean_section
(
config
,
key
);
return
;
...
...
coreapi/linphone_tunnel_stubs.c
View file @
4386f18b
...
...
@@ -46,7 +46,7 @@ void linphone_tunnel_remove_server(LinphoneTunnel *tunnel, LinphoneTunnelConfig
}
const
MSList
*
linphone_tunnel_get_servers
(
LinphoneTunnel
*
tunnel
){