WARNING: The online documentation has moved to https://docs.pjsip.org.

Visit the new documentation at https://docs.pjsip.org:

BLOG | DOCUMENTATION | GITHUB

Home --> Documentations --> PJSIP Reference

Message Composition Indication (RFC 3994)

Support for Indication of Message Composition (RFC 3994) More...

Functions

pj_xml_nodepjsip_iscomposing_create_xml (pj_pool_t *pool, pj_bool_t is_composing, const pj_time_val *lst_actv, const pj_str_t *content_tp, int refresh)
 
pjsip_msg_bodypjsip_iscomposing_create_body (pj_pool_t *pool, pj_bool_t is_composing, const pj_time_val *lst_actv, const pj_str_t *content_tp, int refresh)
 
pj_status_t pjsip_iscomposing_parse (pj_pool_t *pool, char *msg, pj_size_t len, pj_bool_t *p_is_composing, pj_str_t **p_last_active, pj_str_t **p_content_type, int *p_refresh)
 

Detailed Description

This implements message composition indication, as described in RFC 3994.

Function Documentation

◆ pjsip_iscomposing_create_xml()

pj_xml_node * pjsip_iscomposing_create_xml ( pj_pool_t pool,
pj_bool_t  is_composing,
const pj_time_val lst_actv,
const pj_str_t content_tp,
int  refresh 
)

Create XML message with MIME type "application/im-iscomposing+xml" to indicate the message composition status.

Parameters
poolPool to allocate memory.
is_composingMessage composition indication status. Set to PJ_TRUE (or non-zero) to indicate that application is currently composing an instant message.
lst_actvOptional attribute to indicate time of last activity. If none is to be specified, the value MUST be set to NULL.
content_tpOptional attribute to indicate the content type of message being composed. If none is to be specified, the value MUST be set to NULL.
refreshOptional attribute to indicate the interval when next indication will be sent, only when is_composing is non-zero. If none is to be specified, the value MUST be set to -1.
Returns
An XML message containing the message indication. NULL will be returned when there's not enough memory to allocate the message.

◆ pjsip_iscomposing_create_body()

pjsip_msg_body * pjsip_iscomposing_create_body ( pj_pool_t pool,
pj_bool_t  is_composing,
const pj_time_val lst_actv,
const pj_str_t content_tp,
int  refresh 
)

Create message body with Content-Type "application/im-iscomposing+xml" to indicate the message composition status.

Parameters
poolPool to allocate memory.
is_composingMessage composition indication status. Set to PJ_TRUE (or non-zero) to indicate that application is currently composing an instant message.
lst_actvOptional attribute to indicate time of last activity. If none is to be specified, the value MUST be set to NULL.
content_tpOptional attribute to indicate the content type of message being composed. If none is to be specified, the value MUST be set to NULL.
refreshOptional attribute to indicate the interval when next indication will be sent, only when is_composing is non-zero. If none is to be specified, the value MUST be set to -1.
Returns
The SIP message body containing XML message indication. NULL will be returned when there's not enough memory to allocate the message.

◆ pjsip_iscomposing_parse()

pj_status_t pjsip_iscomposing_parse ( pj_pool_t pool,
char *  msg,
pj_size_t  len,
pj_bool_t p_is_composing,
pj_str_t **  p_last_active,
pj_str_t **  p_content_type,
int *  p_refresh 
)

Parse the buffer and return message composition indication in the message.

Note that the input string buffer MUST be NULL terminated and have length at least len+1 (len MUST NOT include the NULL terminator).

Parameters
poolPool to allocate memory for the parsing process.
msgThe message to be parsed, MUST be NULL terminated.
lenLength of the message, excluding NULL terminator.
p_is_composingOptional pointer to receive iscomposing status.
p_last_activeOptional pointer to receive last active attribute.
p_content_typeOptional pointer to receive content type attribute.
p_refreshOptional pointer to receive refresh time.
Returns
PJ_SUCCESS if message can be successfully parsed.

References PJ_END_DECL.

 


PJSIP Open Source, high performance, small footprint, and very very portable SIP stack
Copyright (C) 2006-2008 Teluu Inc.