msfuncs.h File Reference

#include <time.h>
#include "../../str.h"

Include dependency graph for msfuncs.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _content_type

Defines

#define CT_CHARSET   2
#define CT_MSGR   4
#define CT_TYPE   1
#define MSILO_TAG   "msilo-HI4U-Ah0X-bZ98-"

Typedefs

typedef struct _content_type content_type_t

Functions

int m_apo_escape (char *, int, char *, int)
int m_build_body (str *body, time_t date, str msg, time_t sdate)
int m_build_headers (str *buf, str ctype, str contact, time_t date)
int m_extract_content_type (char *, int, content_type_t *, int)
int ms_extract_time (str *time_str, int *time_val)


Define Documentation

#define CT_CHARSET   2

Definition at line 30 of file msfuncs.h.

Referenced by m_extract_content_type().

#define CT_MSGR   4

Definition at line 31 of file msfuncs.h.

Referenced by m_extract_content_type().

#define CT_TYPE   1

Definition at line 29 of file msfuncs.h.

Referenced by m_extract_content_type(), and m_store().

#define MSILO_TAG   "msilo-HI4U-Ah0X-bZ98-"

Definition at line 36 of file msfuncs.h.


Typedef Documentation

typedef struct _content_type content_type_t


Function Documentation

int m_apo_escape ( char *  src,
int  slen,
char *  dst,
int  dlen 
)

apostrophes escape - useful for MySQL strings

apostrophes escaping

  • src: source buffer
  • slen: length of source buffer
  • dst: destination buffer
  • dlen: max length of destination buffer return: destination length => OK; -1 => error

Definition at line 55 of file msfuncs.c.

int m_build_body ( str body,
time_t  date,
str  msg,
time_t  sdate 
)

build MESSAGE body

build MESSAGE body --- add incoming time and 'from'

expects - max buf len of the resulted body in body->len

  • body->s MUST be allocated return: 0 OK ; -1 error

Definition at line 243 of file msfuncs.c.

References _str::len, ms_add_date, and _str::s.

Referenced by m_dump(), and m_send_ontimer().

int m_build_headers ( str buf,
str  ctype,
str  contact,
time_t  date 
)

build MESSAGE headers

build MESSAGE headers

Add Content-Type, Contact and Date headers if they exist expects - max buf len of the resulted body in body->len

  • body->s MUST be allocated return: 0 OK ; -1 error

Definition at line 194 of file msfuncs.c.

References CONTACT_PREFIX, CONTACT_PREFIX_LEN, CONTACT_SUFFIX, CONTACT_SUFFIX_LEN, CRLF, CRLF_LEN, _str::len, _str::s, and timetToSipDateStr().

Referenced by m_dump(), and m_send_ontimer().

int m_extract_content_type ( char *  src,
int  len,
content_type_t ctype,
int  flag 
)

extract content-type value

extract the value of Content-Type header

  • src: pointer to C-T content
  • len: length of src
  • ctype: parsed C-T
  • flag: what to parse - bit mask of CT_TYPE, CT_CHARSET, CT_MSGR

return: 0 OK ; -1 error

Definition at line 131 of file msfuncs.c.

References CT_CHARSET, CT_MSGR, CT_TYPE, _str::len, LM_DBG, _str::s, and _content_type::type.

Referenced by m_store().

int ms_extract_time ( str time_str,
int *  time_val 
)

Definition at line 287 of file msfuncs.c.

References _str::len, LM_ERR, NULL, and _str::s.

Referenced by m_store().


Generated on Wed May 23 20:00:40 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6