|
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
*LinphoneChatMessageState is used to notify if messages have been succesfully delivered or not.
Call back used to notify message delivery status
- Parameters
-
*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
|
Destroy a LinphoneChatRoom.
- Parameters
-
void linphone_chat_room_send_message |
( |
LinphoneChatRoom * |
cr, |
|
|
const char * |
msg |
|
) |
| |
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.
Returns back pointer to LinphoneCore object.
Assign a user pointer to the chat room.
Retrieve the user pointer associated with the chat room.
Create a message attached to a dedicated chat room;
- Parameters
-
cr | the chat room. |
message | text message, NULL if absent. |
- Returns
- a new LinphoneChatMessage
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.
Returns the chatroom this message belongs to.
Returns the peer (remote) address for the message.
*User pointer set function
User pointer get function
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.
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" |
Set origin of the message
- Parameters
-
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
Get the time the message was sent.
Get text part of this message
- Returns
- text or NULL if no text.
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 |
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 |
Duplicate a LinphoneChatMessage
Destroys a LinphoneChatMessage.
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 |