liblinphone 3.8.1

- Main Page
- Related Pages
- Modules
- Data Structures

Macros | Typedefs | Enumerations | Functions
Chat room and Messaging

## Macros
#define | linphone_chat_message_set_from(msg, addr) linphone_chat_message_set_from_address(msg, addr)
#define | linphone_chat_message_get_from(msg) linphone_chat_message_get_from_address(msg)
#define | linphone_chat_message_get_to(msg) linphone_chat_message_get_to_address(msg)

## Typedefs
typedef struct _LinphoneChatMessageCbs | LinphoneChatMessageCbs
typedef struct _LinphoneChatMessage | LinphoneChatMessage
typedef struct _LinphoneChatRoom | LinphoneChatRoom
typedef enum _LinphoneChatMessageState | LinphoneChatMessageState
typedef void(* | LinphoneChatMessageStateChangedCb )(LinphoneChatMessage *msg, LinphoneChatMessageState state, void *ud)
typedef void(* | LinphoneChatMessageCbsMsgStateChangedCb )(LinphoneChatMessage *msg, LinphoneChatMessageState state)
typedef void(* | LinphoneChatMessageCbsFileTransferRecvCb )(LinphoneChatMessage *message, const LinphoneContent *content, const LinphoneBuffer *buffer)
typedef LinphoneBuffer *(* | LinphoneChatMessageCbsFileTransferSendCb )(LinphoneChatMessage *message, const LinphoneContent *content, size_t offset, size_t size)
typedef void(* | LinphoneChatMessageCbsFileTransferProgressIndicationCb )(LinphoneChatMessage *message, const LinphoneContent *content, size_t offset, size_t total)

## Enumerations
enum | _LinphoneChatMessageState { LinphoneChatMessageStateIdle, LinphoneChatMessageStateInProgress, LinphoneChatMessageStateDelivered, LinphoneChatMessageStateNotDelivered, LinphoneChatMessageStateFileTransferError, LinphoneChatMessageStateFileTransferDone }

## Functions
LinphoneChatMessageCbs * | linphone_chat_message_cbs_ref (LinphoneChatMessageCbs *cbs)
void | linphone_chat_message_cbs_unref (LinphoneChatMessageCbs *cbs)
void * | linphone_chat_message_cbs_get_user_data (const LinphoneChatMessageCbs *cbs)
void | linphone_chat_message_cbs_set_user_data (LinphoneChatMessageCbs *cbs, void *ud)
LinphoneChatMessageCbsMsgStateChangedCb | linphone_chat_message_cbs_get_msg_state_changed (const LinphoneChatMessageCbs *cbs)
void | linphone_chat_message_cbs_set_msg_state_changed (LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsMsgStateChangedCb cb)
LinphoneChatMessageCbsFileTransferRecvCb | linphone_chat_message_cbs_get_file_transfer_recv (const LinphoneChatMessageCbs *cbs)
void | linphone_chat_message_cbs_set_file_transfer_recv (LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsFileTransferRecvCb cb)
LinphoneChatMessageCbsFileTransferSendCb | linphone_chat_message_cbs_get_file_transfer_send (const LinphoneChatMessageCbs *cbs)
void | linphone_chat_message_cbs_set_file_transfer_send (LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsFileTransferSendCb cb)
LinphoneChatMessageCbsFileTransferProgressIndicationCb | linphone_chat_message_cbs_get_file_transfer_progress_indication (const LinphoneChatMessageCbs *cbs)
void | linphone_chat_message_cbs_set_file_transfer_progress_indication (LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsFileTransferProgressIndicationCb cb)
void | linphone_core_disable_chat (LinphoneCore *lc, LinphoneReason deny_reason)
void | linphone_core_enable_chat (LinphoneCore *lc)
bool_t | linphone_core_chat_enabled (const LinphoneCore *lc)
MSList * | linphone_core_get_chat_rooms (LinphoneCore *lc)
LinphoneChatRoom * | linphone_core_get_or_create_chat_room (LinphoneCore *lc, const char *to)
LinphoneChatRoom * | linphone_core_create_chat_room (LinphoneCore *lc, const char *to)
LinphoneChatRoom * | linphone_core_get_chat_room (LinphoneCore *lc, const LinphoneAddress *addr)
LinphoneChatRoom * | linphone_core_get_chat_room_from_uri (LinphoneCore *lc, const char *to)
void | linphone_chat_room_destroy (LinphoneChatRoom *cr)
LinphoneChatRoom * | linphone_chat_room_ref (LinphoneChatRoom *cr)
void | linphone_chat_room_unref (LinphoneChatRoom *cr)
void * | linphone_chat_room_get_user_data (const LinphoneChatRoom *cr)
void | linphone_chat_room_set_user_data (LinphoneChatRoom *cr, void *ud)
void | linphone_chat_room_send_message (LinphoneChatRoom *cr, const char *msg)
bool_t | linphone_chat_room_is_remote_composing (const LinphoneChatRoom *cr)
LinphoneCore * | linphone_chat_room_get_lc (LinphoneChatRoom *cr)
LinphoneCore * | linphone_chat_room_get_core (LinphoneChatRoom *cr)
const LinphoneAddress * | linphone_chat_room_get_peer_address (LinphoneChatRoom *cr)
LinphoneChatMessage * | linphone_chat_room_create_message (LinphoneChatRoom *cr, const char *message)
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)
void | linphone_chat_room_send_message2 (LinphoneChatRoom *cr, LinphoneChatMessage *msg, LinphoneChatMessageStateChangedCb status_cb, void *ud)
void | linphone_chat_room_send_chat_message (LinphoneChatRoom *cr, LinphoneChatMessage *msg)
void | linphone_chat_room_compose (LinphoneChatRoom *cr)
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)
const char * | linphone_chat_message_get_appdata (const LinphoneChatMessage *message)
void | linphone_chat_message_set_appdata (LinphoneChatMessage *message, const char *data)
const LinphoneContent * | linphone_chat_message_get_file_transfer_information (const LinphoneChatMessage *message)
void | linphone_chat_message_download_file (LinphoneChatMessage *message)
void | linphone_chat_message_start_file_download (LinphoneChatMessage *message, LinphoneChatMessageStateChangedCb status_cb, void *ud)
void | linphone_chat_message_cancel_file_transfer (LinphoneChatMessage *msg)
void | linphone_chat_message_set_from_address (LinphoneChatMessage *message, const LinphoneAddress *from)
const LinphoneAddress * | linphone_chat_message_get_from_address (const LinphoneChatMessage *message)
void | linphone_chat_message_set_to_address (LinphoneChatMessage *message, const LinphoneAddress *to)
const LinphoneAddress * | linphone_chat_message_get_to_address (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)
bool_t | linphone_chat_message_is_read (LinphoneChatMessage *message)
bool_t | linphone_chat_message_is_outgoing (LinphoneChatMessage *message)
unsigned int | linphone_chat_message_get_storage_id (LinphoneChatMessage *message)
LinphoneChatMessage * | linphone_chat_message_clone (const LinphoneChatMessage *msg)
void | linphone_chat_message_destroy (LinphoneChatMessage *msg)
LinphoneChatMessage * | linphone_chat_message_ref (LinphoneChatMessage *msg)
void | linphone_chat_message_unref (LinphoneChatMessage *msg)
const LinphoneErrorInfo * | linphone_chat_message_get_error_info (const LinphoneChatMessage *msg)
void | linphone_chat_message_set_file_transfer_filepath (LinphoneChatMessage *msg, const char *filepath)
const char * | linphone_chat_message_get_file_transfer_filepath (LinphoneChatMessage *msg)
LinphoneChatMessageCbs * | linphone_chat_message_get_callbacks (const LinphoneChatMessage *msg)
LinphoneChatMessage * | linphone_chat_room_create_file_transfer_message (LinphoneChatRoom *cr, LinphoneContent *initial_content)
void | linphone_core_set_chat_database_path (LinphoneCore *lc, const char *path)
void | linphone_chat_room_mark_as_read (LinphoneChatRoom *cr)
void | linphone_chat_room_delete_message (LinphoneChatRoom *cr, LinphoneChatMessage *msg)
void | linphone_chat_room_delete_history (LinphoneChatRoom *cr)
int | linphone_chat_room_get_history_size (LinphoneChatRoom *cr)
MSList * | linphone_chat_room_get_history_range (LinphoneChatRoom *cr, int begin, int end)
int | linphone_chat_room_get_unread_messages_count (LinphoneChatRoom *cr)

## Detailed Description

Exchanging text messages
Messages are sent using LinphoneChatRoom object. First step is to create a chat room from a peer sip uri.

LinphoneChatRoom* chat_room = linphone_core_create_chat_room(lc,"sip:joe@sip.linphone.org");

Once created, messages are sent using function linphone_chat_room_send_message() .

linphone_chat_room_send_message(chat_room,"Hello world"); /*sending message*/

Incoming message are received from call back LinphoneCoreVTable.text_received

void text_received(LinphoneCore *lc, LinphoneChatRoom *room, const LinphoneAddress *from, const char *message) {
printf(" Message [%s] received from [%s] \n",message,linphone_address_as_string (from));
}

A complete tutorial can be found at : Chat room tutorial

## Macro Definition Documentation

#define linphone_chat_message_set_from | ( |  | msg,
|  |  | addr
| ) |  | linphone_chat_message_set_from_address(msg, addr)

Deprecated:
  Use linphone_chat_message_set_from_address() instead.

#define linphone_chat_message_get_from | ( |  | msg | ) | linphone_chat_message_get_from_address(msg)

Deprecated:
  Use linphone_chat_message_get_from_address() instead.

#define linphone_chat_message_get_to | ( |  | msg | ) | linphone_chat_message_get_to_address(msg)

Deprecated:
  Use linphone_chat_message_get_to_address() instead.

## Typedef Documentation

typedef struct _LinphoneChatMessageCbs LinphoneChatMessageCbs

An object to handle the callbacks for the handling a LinphoneChatMessage objects.

typedef struct _LinphoneChatMessage LinphoneChatMessage

A chat room message to hold content to be sent.
Can be created by linphone_chat_room_create_message().

typedef struct _LinphoneChatRoom LinphoneChatRoom

A chat room is the place where text messages are exchanged.
Can be created by linphone_core_create_chat_room().

typedef enum _LinphoneChatMessageState LinphoneChatMessageState

LinphoneChatMessageState is used to notify if messages have been succesfully delivered or not.

typedef void(* LinphoneChatMessageStateChangedCb)(LinphoneChatMessage *msg, LinphoneChatMessageState state, void *ud)

Call back used to notify message delivery status

Parameters

  msg | LinphoneChatMessage object
  status | LinphoneChatMessageState
  ud | application user data

Deprecated:

typedef void(* LinphoneChatMessageCbsMsgStateChangedCb)(LinphoneChatMessage *msg, LinphoneChatMessageState state)

Call back used to notify message delivery status

Parameters

  msg | LinphoneChatMessage object
  status | LinphoneChatMessageState

typedef void(* LinphoneChatMessageCbsFileTransferRecvCb)(LinphoneChatMessage *message, const LinphoneContent *content, const LinphoneBuffer *buffer)

File transfer receive callback prototype. This function is called by the core upon an incoming File transfer is started. This function may be call several time for the same file in case of large file.

Parameters

  message | LinphoneChatMessage message from which the body is received.
  content | LinphoneContent incoming content information
  buffer | LinphoneBuffer holding the received data. Empty buffer means end of file.

typedef LinphoneBuffer*(* LinphoneChatMessageCbsFileTransferSendCb)(LinphoneChatMessage *message, const LinphoneContent *content, size_t offset, size_t size)

File transfer send callback prototype. This function is called by the core when an outgoing file transfer is started. This function is called until size is set to 0.

Parameters

  message | LinphoneChatMessage message from which the body is received.
  content | LinphoneContent outgoing content
  offset | the offset in the file from where to get the data to be sent
  size | the number of bytes expected by the framework

Returns
  A LinphoneBuffer object holding the data written by the application. An empty buffer means end of file.

typedef void(* LinphoneChatMessageCbsFileTransferProgressIndicationCb)(LinphoneChatMessage *message, const LinphoneContent *content, size_t offset, size_t total)

File transfer progress indication callback prototype.

Parameters

  message | LinphoneChatMessage message from which the body is received.
  content | LinphoneContent incoming content information
  offset | The number of bytes sent/received since the beginning of the transfer.
  total | The total number of bytes to be sent/received.

## Enumeration Type Documentation

enum _LinphoneChatMessageState

LinphoneChatMessageState is used to notify if messages have been succesfully delivered or not.

Enumerator
LinphoneChatMessageStateIdle | Initial state
LinphoneChatMessageStateInProgress | Delivery in progress
LinphoneChatMessageStateDelivered | Message successfully delivered and acknowledged by remote end point
LinphoneChatMessageStateNotDelivered | Message was not delivered
LinphoneChatMessageStateFileTransferError | Message was received(and acknowledged) but cannot get file from server
LinphoneChatMessageStateFileTransferDone | File transfer has been completed successfully.

## Function Documentation

LinphoneChatMessageCbs * linphone_chat_message_cbs_ref | ( | LinphoneChatMessageCbs * | cbs | ) |

Acquire a reference to the LinphoneChatMessageCbs object.

Parameters

  [in] | cbs | LinphoneChatMessageCbs object.

Returns
  The same LinphoneChatMessageCbs object.

void linphone_chat_message_cbs_unref | ( | LinphoneChatMessageCbs * | cbs | ) |

Release reference to the LinphoneChatMessageCbs object.

Parameters

  [in] | cbs | LinphoneChatMessageCbs object.

void * linphone_chat_message_cbs_get_user_data | ( | const LinphoneChatMessageCbs * | cbs | ) |

Retrieve the user pointer associated with the LinphoneChatMessageCbs object.

Parameters

  [in] | cbs | LinphoneChatMessageCbs object.

Returns
  The user pointer associated with the LinphoneChatMessageCbs object.

void linphone_chat_message_cbs_set_user_data | ( | LinphoneChatMessageCbs * | cbs,
|  | void * | ud
| ) |  |

Assign a user pointer to the LinphoneChatMessageCbs object.

Parameters

  [in] | cbs | LinphoneChatMessageCbs object.
  [in] | ud | The user pointer to associate with the LinphoneChatMessageCbs object.

LinphoneChatMessageCbsMsgStateChangedCb linphone_chat_message_cbs_get_msg_state_changed | ( | const LinphoneChatMessageCbs * | cbs | ) |

Get the message state changed callback.

Parameters

  [in] | cbs | LinphoneChatMessageCbs object.

Returns
  The current message state changed callback.

void linphone_chat_message_cbs_set_msg_state_changed | ( | LinphoneChatMessageCbs * | cbs,
|  | LinphoneChatMessageCbsMsgStateChangedCb | cb
| ) |  |

Set the message state changed callback.

Parameters

  [in] | cbs | LinphoneChatMessageCbs object.
  [in] | cb | The message state changed callback to be used.

LinphoneChatMessageCbsFileTransferRecvCb linphone_chat_message_cbs_get_file_transfer_recv | ( | const LinphoneChatMessageCbs * | cbs | ) |

Get the file transfer receive callback.

Parameters

  [in] | cbs | LinphoneChatMessageCbs object.

Returns
  The current file transfer receive callback.

void linphone_chat_message_cbs_set_file_transfer_recv | ( | LinphoneChatMessageCbs * | cbs,
|  | LinphoneChatMessageCbsFileTransferRecvCb | cb
| ) |  |

Set the file transfer receive callback.

Parameters

  [in] | cbs | LinphoneChatMessageCbs object.
  [in] | cb | The file transfer receive callback to be used.

LinphoneChatMessageCbsFileTransferSendCb linphone_chat_message_cbs_get_file_transfer_send | ( | const LinphoneChatMessageCbs * | cbs | ) |

Get the file transfer send callback.

Parameters

  [in] | cbs | LinphoneChatMessageCbs object.

Returns
  The current file transfer send callback.

void linphone_chat_message_cbs_set_file_transfer_send | ( | LinphoneChatMessageCbs * | cbs,
|  | LinphoneChatMessageCbsFileTransferSendCb | cb
| ) |  |

Set the file transfer send callback.

Parameters

  [in] | cbs | LinphoneChatMessageCbs object.
  [in] | cb | The file transfer send callback to be used.

LinphoneChatMessageCbsFileTransferProgressIndicationCb linphone_chat_message_cbs_get_file_transfer_progress_indication | ( | const LinphoneChatMessageCbs * | cbs | ) |

Get the file transfer progress indication callback.

Parameters

  [in] | cbs | LinphoneChatMessageCbs object.

Returns
  The current file transfer progress indication callback.

void linphone_chat_message_cbs_set_file_transfer_progress_indication | ( | LinphoneChatMessageCbs * | cbs,
|  | LinphoneChatMessageCbsFileTransferProgressIndicationCb | cb
| ) |  |

Set the file transfer progress indication callback.

Parameters

  [in] | cbs | LinphoneChatMessageCbs object.
  [in] | cb | The file transfer progress indication callback to be used.

void linphone_core_disable_chat | ( | LinphoneCore * | lc,
|  | LinphoneReason | deny_reason
| ) |  |

Inconditionnaly disable incoming chat messages.

Parameters

  lc | the core
  deny_reason | the deny reason (#LinphoneReasonNone has no effect).

void linphone_core_enable_chat | ( | LinphoneCore * | lc | ) |

Enable reception of incoming chat messages. By default it is enabled but it can be disabled with linphone_core_disable_chat().

Parameters

  lc | the core

bool_t linphone_core_chat_enabled | ( | const LinphoneCore * | lc | ) |

Returns whether chat is enabled.

MSList * linphone_core_get_chat_rooms | ( | LinphoneCore * | lc | ) |

Returns an list of chat rooms

Parameters

  [in] | lc | LinphoneCore object

Returns
  A list of LinphoneChatRoom objects.

LinphoneChatRoom * linphone_core_get_or_create_chat_room | ( | LinphoneCore * | lc,
|  | const char * | to
| ) |  |

Create a new chat room for messaging from a sip uri like sip:joe@s.nosp@m.ip.l.nosp@m.inpho.nosp@m.ne.o.nosp@m.rg if not already existing, else return exisiting one

Parameters

  lc | LinphoneCore object
  to | destination address for messages

Returns
  LinphoneChatRoom where messaging can take place.

Deprecated:
  Use linphone_core_get_chat_room() or linphone_core_get_chat_room_from_uri() instead.

LinphoneChatRoom * linphone_core_create_chat_room | ( | LinphoneCore * | lc,
|  | const char * | to
| ) |  |

Create a new chat room for messaging from a sip uri like sip:joe@s.nosp@m.ip.l.nosp@m.inpho.nosp@m.ne.o.nosp@m.rg

Parameters

  lc | LinphoneCore object
  to | destination address for messages

Returns
  LinphoneChatRoom where messaging can take place.

Deprecated:
  Use linphone_core_get_chat_room() or linphone_core_get_chat_room_from_uri() instead.

LinphoneChatRoom * linphone_core_get_chat_room | ( | LinphoneCore * | lc,
|  | const LinphoneAddress * | addr
| ) |  |

Get a chat room whose peer is the supplied address. If it does not exist yet, it will be created.

Parameters

  lc | the linphone core
  addr | a linphone address.

Returns
  LinphoneChatRoom where messaging can take place.

LinphoneChatRoom * linphone_core_get_chat_room_from_uri | ( | LinphoneCore * | lc,
|  | const char * | to
| ) |  |

Get a chat room for messaging from a sip uri like sip:joe@s.nosp@m.ip.l.nosp@m.inpho.nosp@m.ne.o.nosp@m.rg. If it does not exist yet, it will be created.

Parameters

  lc | The linphone core
  to | The destination address for messages.

Returns
  LinphoneChatRoom where messaging can take place.

void linphone_chat_room_destroy | ( | LinphoneChatRoom * | cr | ) |

Destroy a LinphoneChatRoom.

Parameters

  cr | LinphoneChatRoom object

Deprecated:
  Use linphone_chat_room_unref() instead.

LinphoneChatRoom * linphone_chat_room_ref | ( | LinphoneChatRoom * | cr | ) |

Acquire a reference to the chat room.

Parameters

  [in] | cr | The chat room.

Returns
  The same chat room.

void linphone_chat_room_unref | ( | LinphoneChatRoom * | cr | ) |

Release reference to the chat room.

Parameters

  [in] | cr | The chat room.

void * linphone_chat_room_get_user_data | ( | const LinphoneChatRoom * | cr | ) |

Retrieve the user pointer associated with the chat room.

Parameters

  [in] | cr | The chat room.

Returns
  The user pointer associated with the chat room.

void linphone_chat_room_set_user_data | ( | LinphoneChatRoom * | cr,
|  | void * | ud
| ) |  |

Assign a user pointer to the chat room.

Parameters

  [in] | cr | The chat room.
  [in] | ud | The user pointer to associate with the chat room.

void linphone_chat_room_send_message | ( | LinphoneChatRoom * | cr,
|  | const char * | msg
| ) |  |

Send a message to peer member of this chat room.

Deprecated:
  linphone_chat_room_send_message2() gives more control on the message expedition.
  Parameters

    cr | LinphoneChatRoom object
    msg | message to be sent

bool_t linphone_chat_room_is_remote_composing | ( | const LinphoneChatRoom * | cr | ) |

Tells whether the remote is currently composing a message.

Parameters

  [in] | cr | The "LinphoneChatRoom object corresponding to the conversation.

Returns
  TRUE if the remote is currently composing a message, FALSE otherwise.

LinphoneCore * linphone_chat_room_get_lc | ( | LinphoneChatRoom * | cr | ) |

Returns back pointer to LinphoneCore object.

Deprecated:
  use linphone_chat_room_get_core()

LinphoneCore * linphone_chat_room_get_core | ( | LinphoneChatRoom * | cr | ) |

Returns back pointer to LinphoneCore object.

const LinphoneAddress * linphone_chat_room_get_peer_address | ( | LinphoneChatRoom * | cr | ) |

get peer address associated to this LinphoneChatRoom

Parameters

  cr | LinphoneChatRoom object

Returns
  LinphoneAddress peer address

LinphoneChatMessage * linphone_chat_room_create_message | ( | LinphoneChatRoom * | cr,
|  | const char * | 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

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
| ) |  |

Create a message attached to a dedicated chat room;

Parameters

  cr | the chat room.
  message | text message, NULL if absent.
  external_body_url | the URL given in external body or NULL.
  state | the LinphoneChatMessage.State of the message.
  time | the time_t at which the message has been received/sent.
  is_read | TRUE if the message should be flagged as read, FALSE otherwise.
  is_incoming | TRUE if the message has been received, FALSE otherwise.

Returns
  a new LinphoneChatMessage

void linphone_chat_room_send_message2 | ( | LinphoneChatRoom * | cr,
|  | LinphoneChatMessage * | msg,
|  | LinphoneChatMessageStateChangedCb | status_cb,
|  | void * | ud
| ) |  |

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.

Deprecated:
  Use linphone_chat_room_send_chat_message() instead.
  Note
    The LinphoneChatMessage must not be destroyed until the the callback is called.

void linphone_chat_room_send_chat_message | ( | LinphoneChatRoom * | cr,
|  | LinphoneChatMessage * | msg
| ) |  |

Send a message to peer member of this chat room.

Parameters

  [in] | cr | LinphoneChatRoom object
  [in] | msg | LinphoneChatMessage object The state of the message sending will be notified via the callbacks defined in the LinphoneChatMessageCbs object that can be obtained by calling linphone_chat_message_get_callbacks().

void linphone_chat_room_compose | ( | LinphoneChatRoom * | cr | ) |

Notifies the destination of the chat message being composed that the user is typing a new message.

Parameters

  [in] | cr | The LinphoneChatRoom object corresponding to the conversation for which a new message is being typed.

const char * linphone_chat_message_state_to_string | ( | const LinphoneChatMessageState | state | ) |

Returns a LinphoneChatMessageState as a string.

LinphoneChatRoom * linphone_chat_message_get_chat_room | ( | LinphoneChatMessage * | msg | ) |

Returns the chatroom this message belongs to.

const LinphoneAddress * linphone_chat_message_get_peer_address | ( | LinphoneChatMessage * | msg | ) |

Returns the peer (remote) address for the message.

void linphone_chat_message_set_user_data | ( | LinphoneChatMessage * | message,
|  | void * | ud
| ) |  |

User pointer set function

void * linphone_chat_message_get_user_data | ( | const LinphoneChatMessage * | message | ) |

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

  message | LinphoneChatMessage

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"

const char * linphone_chat_message_get_appdata | ( | const LinphoneChatMessage * | message | ) |

Linphone message has an app-specific field that can store a text. The application might want to use it for keeping data over restarts, like thumbnail image path.

Parameters

  message | LinphoneChatMessage

Returns
  the application-specific data or NULL if none has been stored.

void linphone_chat_message_set_appdata | ( | LinphoneChatMessage * | message,
|  | const char * | data
| ) |  |

Linphone message has an app-specific field that can store a text. The application might want to use it for keeping data over restarts, like thumbnail image path.

Invoking this function will attempt to update the message storage to reflect the changeif it is enabled.

Parameters

  message | LinphoneChatMessage
  data | the data to store into the message

const LinphoneContent * linphone_chat_message_get_file_transfer_information | ( | const LinphoneChatMessage * | message | ) |

Get the file_transfer_information (used by call backs to recover informations during a rcs file transfer)

Parameters

  message | LinphoneChatMessage

Returns
  a pointer to the LinphoneContent structure or NULL if not present.

void linphone_chat_message_download_file | ( | LinphoneChatMessage * | message | ) |

Start the download of the file referenced in a LinphoneChatMessage from remote server.

Parameters

  [in] | message | LinphoneChatMessage object.

void linphone_chat_message_start_file_download | ( | LinphoneChatMessage * | message,
|  | LinphoneChatMessageStateChangedCb | status_cb,
|  | void * | ud
| ) |  |

Start the download of the file from remote server

Parameters

  message | LinphoneChatMessage
  status_cb | LinphoneChatMessageStateChangeCb status callback invoked when file is downloaded or could not be downloaded

Deprecated:
  Use linphone_chat_message_download_file() instead.

void linphone_chat_message_cancel_file_transfer | ( | LinphoneChatMessage * | msg | ) |

Cancel an ongoing file transfer attached to this message.(upload or download)

Parameters

  msg | LinphoneChatMessage

void linphone_chat_message_set_from_address | ( | LinphoneChatMessage * | message,
|  | const LinphoneAddress * | from
| ) |  |

Set origin of the message

Parameters

  [in] | message | LinphoneChatMessage obj
  [in] | from | LinphoneAddress origin of this message (copied)

const LinphoneAddress * linphone_chat_message_get_from_address | ( | const LinphoneChatMessage * | message | ) |

Get origin of the message

Parameters

  [in] | message | LinphoneChatMessage obj

Returns
  LinphoneAddress

void linphone_chat_message_set_to_address | ( | LinphoneChatMessage * | message,
|  | const LinphoneAddress * | to
| ) |  |

Set destination of the message

Parameters

  [in] | message | LinphoneChatMessage obj
  [in] | to | LinphoneAddress destination of this message (copied)

const LinphoneAddress * linphone_chat_message_get_to_address | ( | const LinphoneChatMessage * | message | ) |

Get destination of the message

Parameters

  [in] | message | LinphoneChatMessage obj

Returns
  LinphoneAddress

LinphoneAddress * linphone_chat_message_get_local_address | ( | const LinphoneChatMessage * | message | ) |

Returns the origin address of a message if it was a outgoing message, or the destination address if it was an incoming message.

Parameters

  message | LinphoneChatMessage obj

Returns
  LinphoneAddress

time_t linphone_chat_message_get_time | ( | const LinphoneChatMessage * | message | ) |

Get the time the message was sent.

LinphoneChatMessageState linphone_chat_message_get_state | ( | const LinphoneChatMessage * | message | ) |

Get the state of the message

Parameters

  message | LinphoneChatMessage obj

Returns
  LinphoneChatMessageState

const char * linphone_chat_message_get_text | ( | const LinphoneChatMessage * | message | ) |

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

bool_t linphone_chat_message_is_read | ( | LinphoneChatMessage * | message | ) |

Returns TRUE if the message has been read, otherwise returns FALSE.

Parameters

  message | the message

bool_t linphone_chat_message_is_outgoing | ( | LinphoneChatMessage * | message | ) |

Returns TRUE if the message has been sent, returns FALSE if the message has been received.

Parameters

  message | the message

unsigned int linphone_chat_message_get_storage_id | ( | LinphoneChatMessage * | message | ) |

Returns the id used to identify this message in the storage database

Parameters

  message | the message

Returns
  the id

LinphoneChatMessage * linphone_chat_message_clone | ( | const LinphoneChatMessage * | msg | ) |

Duplicate a LinphoneChatMessage

void linphone_chat_message_destroy | ( | LinphoneChatMessage * | msg | ) |

Destroys a LinphoneChatMessage.

LinphoneChatMessage * linphone_chat_message_ref | ( | LinphoneChatMessage * | msg | ) |

Acquire a reference to the chat message.

Parameters

  msg | the chat message

Returns
  the same chat message

void linphone_chat_message_unref | ( | LinphoneChatMessage * | msg | ) |

Release reference to the chat message.

Parameters

  msg | the chat message.

const LinphoneErrorInfo * linphone_chat_message_get_error_info | ( | const LinphoneChatMessage * | msg | ) |

Get full details about delivery error of a chat message.

Parameters

  msg | a LinphoneChatMessage

Returns
  a LinphoneErrorInfo describing the details.

void linphone_chat_message_set_file_transfer_filepath | ( | LinphoneChatMessage * | msg,
|  | const char * | filepath
| ) |  |

Set the path to the file to read from or write to during the file transfer.

Parameters

  [in] | msg | LinphoneChatMessage object
  [in] | filepath | The path to the file to use for the file transfer.

const char * linphone_chat_message_get_file_transfer_filepath | ( | LinphoneChatMessage * | msg | ) |

Get the path to the file to read from or write to during the file transfer.

Parameters

  [in] | msg | LinphoneChatMessage object

Returns
  The path to the file to use for the file transfer.

LinphoneChatMessageCbs * linphone_chat_message_get_callbacks | ( | const LinphoneChatMessage * | msg | ) |

Get the LinphoneChatMessageCbs object associated with the LinphoneChatMessage.

Parameters

  [in] | msg | LinphoneChatMessage object

Returns
  The LinphoneChatMessageCbs object associated with the LinphoneChatMessage.

LinphoneChatMessage * linphone_chat_room_create_file_transfer_message | ( | LinphoneChatRoom * | cr,
|  | LinphoneContent * | initial_content
| ) |  |

Create a message attached to a dedicated chat room with a particular content. Use linphone_chat_room_send_message2 to initiate the transfer

Parameters

  cr | the chat room.
  initial_content | LinphoneContent initial content. LinphoneCoreVTable.file_transfer_send is invoked later to notify file transfer progress and collect next chunk of the message if #LinphoneContent.data is NULL.

Returns
  a new LinphoneChatMessage

Create a message attached to a dedicated chat room with a particular content. Use #linphone_chat_room_file_transfer_send to initiate the transfer

Parameters

  [in] | cr | the chat room.
  [in] | initial_content | LinphoneContent initial content. LinphoneCoreVTable.file_transfer_send is invoked later to notify file transfer progress and collect next chunk of the message if #LinphoneContentSourceType.src_type is set to LINPHONE_CONTENT_SOURCE_CHUNKED_BUFFER.

Returns
  a new 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

void linphone_chat_room_mark_as_read | ( | LinphoneChatRoom * | cr | ) |

Mark all messages of the conversation as read

Parameters

  [in] | cr | The LinphoneChatRoom object corresponding to the conversation.

void linphone_chat_room_delete_message | ( | LinphoneChatRoom * | cr,
|  | LinphoneChatMessage * | msg
| ) |  |

Delete a message from the chat room history.

Parameters

  [in] | cr | The LinphoneChatRoom object corresponding to the conversation.
  [in] | msg | The LinphoneChatMessage object to remove.

void linphone_chat_room_delete_history | ( | LinphoneChatRoom * | cr | ) |

Delete all messages from the history

Parameters

  [in] | cr | The LinphoneChatRoom object corresponding to the conversation.

int linphone_chat_room_get_history_size | ( | LinphoneChatRoom * | cr | ) |

Gets the number of messages in a chat room.

Parameters

  [in] | cr | The LinphoneChatRoom object corresponding to the conversation for which size has to be computed

Returns
  the number of messages.

MSList* linphone_chat_room_get_history_range | ( | LinphoneChatRoom * | cr,
|  | int | begin,
|  | int | end
| ) |  |

Gets the partial list of messages in the given range, sorted from oldest to most recent.

Parameters

  [in] | cr | The LinphoneChatRoom object corresponding to the conversation for which messages should be retrieved
  [in] | begin | The first message of the range to be retrieved. History most recent message has index 0.
  [in] | end | The last message of the range to be retrieved. History oldest message has index of history size - 1 (use linphone_chat_room_get_history_size to retrieve history size)

Returns
  A list of LinphoneChatMessage objects.

int linphone_chat_room_get_unread_messages_count | ( | LinphoneChatRoom * | cr | ) |

Gets the number of unread messages in the chatroom.

Parameters

  [in] | cr | The "LinphoneChatRoom object corresponding to the conversation.

Returns
  the number of unread messages.