# 
# $Id: README,v 1.1 2002/09/20 12:03:23 bogdan Rel $
#

From: Bogdan Andrei Iancu <iancu@fokus.gmd.de>



                           Instant Messaging (IM) Module


1.Description

The IM module is more a library than a module. It includes a set of functions 
related to Instant Messaging processing, functions that are used by several
modules like sms (SIP<->SMS gateway), jabber (SIP_JABBER gateway) and msilo
 (message storing module).
To use the library functions offered by this module, there is nothing
peculiarity to set on runtime - there is no need to load the module from
ser script. The only thing to do is, at compile-time, to add in the Makefile
(for the module that wants to use im functions) as LIBS the path to the
im.so library (Ex: LIBS=`pwd`/../im/im.so ).


2.Module parameters

None.


3.Exported functions

None.


4.Library functions

 - int im_get_body_len( struct sip_msg* msg)
Returns the body length as found in the Content-Length header. If this header
is missing or its body is invalid (cannot be converted to a positive number)
an error code (-1) will be returned.

 - int im_check_content_type(struct sip_msg *msg)
Checks if the Content-Type of the given message designates an instant messaging
format. For the moment only the "text/plain" and "message/cpim" formats are
recognized. In case of an error -parse error or unsupported format - (-1) error
code is returned.
NOTE that if the Content-Type header is missing, a success code will be
returned by this function.

 - int im_extract_body(struct sip_msg *msg, str *body )
This functions combines also the functionality of the previous functions. It
returns in "body" param the message body as text. The content-type is checked
to respect the IM formats, and the body's length is given from content-length
header.


4.Modules dependency

None.

