liblinphone 3.4.3
|
Typedefs | |
typedef struct _LinphoneChatRoom | LinphoneChatRoom |
Functions | |
LinphoneChatRoom * | linphone_core_create_chat_room (LinphoneCore *lc, const char *to) |
void | linphone_chat_room_destroy (LinphoneChatRoom *cr) |
const LinphoneAddress * | linphone_chat_room_get_peer_address (LinphoneChatRoom *cr) |
void | linphone_chat_room_send_message (LinphoneChatRoom *cr, const char *msg) |
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
typedef struct _LinphoneChatRoom LinphoneChatRoom |
A chat room is the place where text messages are exchanged.
Can be created by linphone_core_create_chat_room().
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@sip.linphone.org
lc | LinphoneCore object |
to | destination address for messages |
void linphone_chat_room_destroy | ( | LinphoneChatRoom * | cr | ) |
Destructor
cr | LinphoneChatRoom object |
const LinphoneAddress* linphone_chat_room_get_peer_address | ( | LinphoneChatRoom * | cr | ) |
get peer address associated to this LinphoneChatRoom
cr | LinphoneChatRoom object |
void linphone_chat_room_send_message | ( | LinphoneChatRoom * | cr, |
const char * | msg | ||
) |
send a message to peer member of this chat room.
cr | LinphoneChatRoom object |
msg | message to be sent |