|
LinphoneChatRoom * | linphone_core_create_chat_room (LinphoneCore *lc, const char *to) |
|
void | linphone_chat_room_destroy (LinphoneChatRoom *cr) |
|
void | linphone_chat_room_send_message (LinphoneChatRoom *cr, const char *msg) |
|
LinphoneChatRoom * | linphone_core_get_chat_room (LinphoneCore *lc, const LinphoneAddress *addr) |
|
LinphoneCore * | linphone_chat_room_get_lc (LinphoneChatRoom *cr) |
|
void | linphone_chat_room_set_user_data (LinphoneChatRoom *cr, void *ud) |
|
void * | linphone_chat_room_get_user_data (LinphoneChatRoom *cr) |
|
const LinphoneAddress * | linphone_chat_room_get_peer_address (LinphoneChatRoom *cr) |
|
LinphoneChatMessage * | linphone_chat_room_create_message (LinphoneChatRoom *cr, const char *message) |
|
void | linphone_chat_room_send_message2 (LinphoneChatRoom *cr, LinphoneChatMessage *msg, LinphoneChatMessageStateChangeCb status_cb, void *ud) |
|
const char * | linphone_chat_message_state_to_string (const LinphoneChatMessageState state) |
|
LinphoneChatRoom * | linphone_chat_message_get_chat_room (LinphoneChatMessage *msg) |
|
const LinphoneAddress * | linphone_chat_message_get_peer_address (LinphoneChatMessage *msg) |
|
void | linphone_chat_message_set_user_data (LinphoneChatMessage *message, void *ud) |
|
void * | linphone_chat_message_get_user_data (const LinphoneChatMessage *message) |
|
const char * | linphone_chat_message_get_external_body_url (const LinphoneChatMessage *message) |
|
void | linphone_chat_message_set_external_body_url (LinphoneChatMessage *message, const char *url) |
|
void | linphone_chat_message_set_from (LinphoneChatMessage *message, const LinphoneAddress *from) |
|
const LinphoneAddress * | linphone_chat_message_get_from (const LinphoneChatMessage *message) |
|
const LinphoneAddress * | linphone_chat_message_get_to (const LinphoneChatMessage *message) |
|
LinphoneAddress * | linphone_chat_message_get_local_address (const LinphoneChatMessage *message) |
|
time_t | linphone_chat_message_get_time (const LinphoneChatMessage *message) |
|
LinphoneChatMessageState | linphone_chat_message_get_state (const LinphoneChatMessage *message) |
|
const char * | linphone_chat_message_get_text (const LinphoneChatMessage *message) |
|
void | linphone_chat_message_add_custom_header (LinphoneChatMessage *message, const char *header_name, const char *header_value) |
|
const char * | linphone_chat_message_get_custom_header (LinphoneChatMessage *message, const char *header_name) |
|
LinphoneChatMessage * | linphone_chat_message_clone (const LinphoneChatMessage *msg) |
|
void | linphone_chat_message_destroy (LinphoneChatMessage *msg) |
|
void | linphone_core_set_chat_database_path (LinphoneCore *lc, const char *path) |
|
Exchanging text messages
Messages are sent using LinphoneChatRoom object. First step is to create a chat room from a peer sip uri.
Once created, messages are sent using function linphone_chat_room_send_message() .
Incoming message are received from call back LinphoneCoreVTable.text_received
A complete tutorial can be found at : Chat room tutorial
◆ LinphoneChatMessage
◆ LinphoneChatRoom
◆ LinphoneChatMessageState
LinphoneChatMessageState is used to notify if messages have been succesfully delivered or not.
◆ LinphoneChatMessageStateChangeCb
Call back used to notify message delivery status
- Parameters
-
◆ _LinphoneChatMessageStates
LinphoneChatMessageState is used to notify if messages have been succesfully delivered or not.
Enumerator |
---|
LinphoneChatMessageStateIdle | initial state
|
LinphoneChatMessageStateInProgress | delivery in progress
|
LinphoneChatMessageStateDelivered | message succesffully delivered an acknoleged by remote end point
|
LinphoneChatMessageStateNotDelivered | message was not delivered
|
◆ linphone_core_create_chat_room()
◆ linphone_chat_room_destroy()
Destroy a LinphoneChatRoom.
- Parameters
-
◆ linphone_chat_room_send_message()
void linphone_chat_room_send_message |
( |
LinphoneChatRoom * |
cr, |
|
|
const char * |
msg |
|
) |
| |
◆ linphone_core_get_chat_room()
Retrieve an existing chat room whose peer is the supplied address, if exists.
- Parameters
-
lc | the linphone core |
add | a linphone address. |
- Returns
- the matching chatroom, or NULL if no such chatroom exists.
◆ linphone_chat_room_get_lc()
Returns back pointer to LinphoneCore object.
◆ linphone_chat_room_set_user_data()
Assign a user pointer to the chat room.
◆ linphone_chat_room_get_user_data()
Retrieve the user pointer associated with the chat room.
◆ linphone_chat_room_get_peer_address()
◆ linphone_chat_room_create_message()
Create a message attached to a dedicated chat room;
- Parameters
-
cr | the chat room. |
message | text message, NULL if absent. |
- Returns
- a new LinphoneChatMessage
◆ linphone_chat_room_send_message2()
Send a message to peer member of this chat room.
- Parameters
-
cr | LinphoneChatRoom object |
msg | LinphoneChatMessage message to be sent |
status_cb | LinphoneChatMessageStateChangeCb status callback invoked when message is delivered or could not be delivered. May be NULL |
ud | user data for the status cb. |
- Note
- The LinphoneChatMessage must not be destroyed until the the callback is called.
◆ linphone_chat_message_state_to_string()
◆ linphone_chat_message_get_chat_room()
Returns the chatroom this message belongs to.
◆ linphone_chat_message_get_peer_address()
Returns the peer (remote) address for the message.
◆ linphone_chat_message_set_user_data()
User pointer set function
◆ linphone_chat_message_get_user_data()
User pointer get function
◆ linphone_chat_message_get_external_body_url()
const char * linphone_chat_message_get_external_body_url |
( |
const LinphoneChatMessage * |
message | ) |
|
Linphone message can carry external body as defined by rfc2017
- Parameters
-
- Returns
- external body url or NULL if not present.
◆ linphone_chat_message_set_external_body_url()
void linphone_chat_message_set_external_body_url |
( |
LinphoneChatMessage * |
message, |
|
|
const char * |
url |
|
) |
| |
Linphone message can carry external body as defined by rfc2017
- Parameters
-
message | a LinphoneChatMessage |
url | ex: access-type=URL; URL="http://www.foo.com/file" |
◆ linphone_chat_message_set_from()
Set origin of the message
- Parameters
-
◆ linphone_chat_message_get_from()
◆ linphone_chat_message_get_to()
◆ linphone_chat_message_get_local_address()
Returns the origin address of a message if it was a outgoing message, or the destination address if it was an incoming message.
- Parameters
-
- Returns
- LinphoneAddress
◆ linphone_chat_message_get_time()
Get the time the message was sent.
◆ linphone_chat_message_get_state()
◆ linphone_chat_message_get_text()
Get text part of this message
- Returns
- text or NULL if no text.
◆ linphone_chat_message_add_custom_header()
void linphone_chat_message_add_custom_header |
( |
LinphoneChatMessage * |
message, |
|
|
const char * |
header_name, |
|
|
const char * |
header_value |
|
) |
| |
Add custom headers to the message.
- Parameters
-
message | the message |
header_name | name of the header_name |
header_value | header value |
◆ linphone_chat_message_get_custom_header()
const char * linphone_chat_message_get_custom_header |
( |
LinphoneChatMessage * |
message, |
|
|
const char * |
header_name |
|
) |
| |
Retrieve a custom header value given its name.
- Parameters
-
message | the message |
header_name | header name searched |
◆ linphone_chat_message_clone()
Duplicate a LinphoneChatMessage
◆ linphone_chat_message_destroy()
Destroys a LinphoneChatMessage.
◆ linphone_core_set_chat_database_path()
void linphone_core_set_chat_database_path |
( |
LinphoneCore * |
lc, |
|
|
const char * |
path |
|
) |
| |
Sets the database filename where chat messages will be stored. If the file does not exist, it will be created.
- Parameters
-
lc | the linphone core |
path | filesystem path |