#include "msfuncs.h"#include <stdio.h>#include <stdlib.h>#include <sys/types.h>#include <unistd.h>#include <time.h>#include "../../dprint.h"#include "../../config.h"#include "../../ut.h"#include "../../forward.h"#include "../../resolve.h"#include "../../globals.h"#include "../../udp_server.h"#include "../../pt.h"

Go to the source code of this file.
Defines | |
| #define | CONTACT_PREFIX "Contact: <" |
| #define | CONTACT_PREFIX_LEN (sizeof(CONTACT_PREFIX)-1) |
| #define | CONTACT_SUFFIX ">;msilo=yes"CRLF |
| #define | CONTACT_SUFFIX_LEN (sizeof(CONTACT_SUFFIX)-1) |
Functions | |
| int | m_apo_escape (char *src, int slen, char *dst, int dlen) |
| 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 *src, int len, content_type_t *ctype, int flag) |
| int | ms_extract_time (str *time_str, int *time_val) |
| int | timetToSipDateStr (time_t date, char *buf, int bufLen) |
Variables | |
| int | ms_add_date |
| #define CONTACT_PREFIX "Contact: <" |
| #define CONTACT_PREFIX_LEN (sizeof(CONTACT_PREFIX)-1) |
| #define CONTACT_SUFFIX ">;msilo=yes"CRLF |
| #define CONTACT_SUFFIX_LEN (sizeof(CONTACT_SUFFIX)-1) |
| int m_apo_escape | ( | char * | src, | |
| int | slen, | |||
| char * | dst, | |||
| int | dlen | |||
| ) |
build MESSAGE body --- add incoming time and 'from'
expects - max buf len of the resulted body in body->len
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().
build MESSAGE headers
Add Content-Type, Contact and Date headers if they exist expects - max buf len of the resulted body in body->len
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 the value of Content-Type header
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 | |||
| ) |
| int timetToSipDateStr | ( | time_t | date, | |
| char * | buf, | |||
| int | bufLen | |||
| ) |
Build a RFC 3261 compliant Date string from a time_t value
return: >0 length of data copied to buf ; <0 error occured
Definition at line 95 of file msfuncs.c.
Referenced by m_build_headers().
| int ms_add_date |
1.5.6