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
313fbaa6
Commit
313fbaa6
authored
Apr 28, 2013
by
Simon Morlat
Browse files
implement use_dates and dates in text messages.
parent
1f4a7fd9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
8 deletions
+20
-8
coreapi/bellesip_sal/sal_impl.c
coreapi/bellesip_sal/sal_impl.c
+8
-0
coreapi/bellesip_sal/sal_impl.h
coreapi/bellesip_sal/sal_impl.h
+1
-0
coreapi/bellesip_sal/sal_op_call.c
coreapi/bellesip_sal/sal_op_call.c
+0
-6
coreapi/bellesip_sal/sal_op_message.c
coreapi/bellesip_sal/sal_op_message.c
+5
-1
coreapi/bellesip_sal/sal_op_registration.c
coreapi/bellesip_sal/sal_op_registration.c
+5
-1
coreapi/callbacks.c
coreapi/callbacks.c
+1
-0
No files found.
coreapi/bellesip_sal/sal_impl.c
View file @
313fbaa6
...
...
@@ -677,3 +677,11 @@ const char* sal_op_type_to_string(const SalOpType_t type) {
return
"SalOpUnknown"
;
}
}
void
sal_expire_old_registration_contacts
(
Sal
*
ctx
,
bool_t
enabled
){
ms_warning
(
"sal_expire_old_registration_contacts not implemented "
);
}
void
sal_use_dates
(
Sal
*
ctx
,
bool_t
enabled
){
ctx
->
use_dates
=
enabled
;
}
coreapi/bellesip_sal/sal_impl.h
View file @
313fbaa6
...
...
@@ -42,6 +42,7 @@ struct Sal{
bool_t
nat_helper_enabled
;
bool_t
tls_verify
;
bool_t
tls_verify_cn
;
bool_t
use_dates
;
};
typedef
enum
SalOpSate
{
...
...
coreapi/bellesip_sal/sal_op_call.c
View file @
313fbaa6
...
...
@@ -787,12 +787,6 @@ int sal_call_is_offerer(const SalOp *h){
return
h
->
sdp_offering
;
}
void
sal_expire_old_registration_contacts
(
Sal
*
ctx
,
bool_t
enabled
){
ms_warning
(
"sal_expire_old_registration_contacts not implemented "
);
}
void
sal_use_dates
(
Sal
*
ctx
,
bool_t
enabled
){
ms_warning
(
"sal_use_dates not implemented yet"
);
}
coreapi/bellesip_sal/sal_op_message.c
View file @
313fbaa6
...
...
@@ -87,6 +87,7 @@ static void process_request_event(void *op_base, const belle_sip_request_event_t
belle_sip_response_t
*
resp
;
belle_sip_header_call_id_t
*
call_id
=
belle_sip_message_get_header_by_type
(
req
,
belle_sip_header_call_id_t
);
belle_sip_header_cseq_t
*
cseq
=
belle_sip_message_get_header_by_type
(
req
,
belle_sip_header_cseq_t
);
belle_sip_header_date_t
*
date
=
belle_sip_message_get_header_by_type
(
req
,
belle_sip_header_date_t
);
SalMessage
salmsg
;
char
message_id
[
256
]
=
{
0
};
int
response_code
=
501
;
...
...
@@ -109,6 +110,7 @@ static void process_request_event(void *op_base, const belle_sip_request_event_t
salmsg
.
text
=
plain_text
?
belle_sip_message_get_body
(
BELLE_SIP_MESSAGE
(
req
))
:
NULL
;
salmsg
.
url
=
external_body
?
belle_sip_parameters_get_parameter
(
BELLE_SIP_PARAMETERS
(
content_type
),
"URL"
)
:
NULL
;
salmsg
.
message_id
=
message_id
;
salmsg
.
time
=
date
?
belle_sip_header_date_get_time
(
date
)
:
time
(
NULL
);
op
->
base
.
root
->
callbacks
.
text_received
(
op
,
&
salmsg
);
belle_sip_object_unref
(
address
);
belle_sip_free
(
from
);
...
...
@@ -124,10 +126,11 @@ static void process_request_event(void *op_base, const belle_sip_request_event_t
}
int
sal_message_send
(
SalOp
*
op
,
const
char
*
from
,
const
char
*
to
,
const
char
*
content_type
,
const
char
*
msg
){
/*FIXME impement time*/
belle_sip_request_t
*
req
;
char
content_type_raw
[
256
];
size_t
content_length
=
msg
?
strlen
(
msg
)
:
0
;
time_t
curtime
=
time
(
NULL
);
sal_op_message_fill_cbs
(
op
);
if
(
from
)
sal_op_set_from
(
op
,
from
);
...
...
@@ -138,6 +141,7 @@ int sal_message_send(SalOp *op, const char *from, const char *to, const char* co
snprintf
(
content_type_raw
,
sizeof
(
content_type_raw
),
BELLE_SIP_CONTENT_TYPE
": %s"
,
content_type
);
belle_sip_message_add_header
(
BELLE_SIP_MESSAGE
(
req
),
BELLE_SIP_HEADER
(
belle_sip_header_content_type_parse
(
content_type_raw
)));
belle_sip_message_add_header
(
BELLE_SIP_MESSAGE
(
req
),
BELLE_SIP_HEADER
(
belle_sip_header_content_length_create
(
content_length
)));
belle_sip_message_add_header
(
BELLE_SIP_MESSAGE
(
req
),
BELLE_SIP_HEADER
(
belle_sip_header_date_create_from_time
(
&
curtime
)));
belle_sip_message_set_body
(
BELLE_SIP_MESSAGE
(
req
),
msg
,
content_length
);
return
sal_op_send_request
(
op
,
req
);
...
...
coreapi/bellesip_sal/sal_op_registration.c
View file @
313fbaa6
...
...
@@ -73,6 +73,7 @@ static void register_refresher_listener ( const belle_sip_refresher_t* refresher
int
sal_register
(
SalOp
*
op
,
const
char
*
proxy
,
const
char
*
from
,
int
expires
){
belle_sip_request_t
*
req
;
belle_sip_uri_t
*
req_uri
;
op
->
type
=
SalOpRegister
;
sal_op_set_from
(
op
,
from
);
sal_op_set_to
(
op
,
from
);
...
...
@@ -80,7 +81,10 @@ int sal_register(SalOp *op, const char *proxy, const char *from, int expires){
req
=
sal_op_build_request
(
op
,
"REGISTER"
);
req_uri
=
belle_sip_request_get_uri
(
req
);
belle_sip_uri_set_user
(
req_uri
,
NULL
);
/*remove userinfo if any*/
if
(
op
->
base
.
root
->
use_dates
){
time_t
curtime
=
time
(
NULL
);
belle_sip_message_add_header
(
BELLE_SIP_MESSAGE
(
req
),
BELLE_SIP_HEADER
(
belle_sip_header_date_create_from_time
(
&
curtime
)));
}
return
sal_op_send_and_create_refresher
(
op
,
req
,
expires
,
register_refresher_listener
);
}
...
...
coreapi/callbacks.c
View file @
313fbaa6
...
...
@@ -967,6 +967,7 @@ static void text_delivery_update(SalOp *op, SalTextDeliveryStatus status){
chat_msg
->
state
=
chatStatusSal2Linphone
(
status
);
linphone_chat_message_store_state
(
chat_msg
);
if
(
chat_msg
&&
chat_msg
->
cb
)
{
ms_message
(
"Notifying text delivery with status %i"
,
chat_msg
->
state
);
chat_msg
->
cb
(
chat_msg
,
chat_msg
->
state
,
chat_msg
->
cb_ud
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment