tm/uac.c File Reference

TM :: Simple user agent support. More...

#include <string.h>
#include "../../mem/shm_mem.h"
#include "../../dprint.h"
#include "../../md5.h"
#include "../../socket_info.h"
#include "ut.h"
#include "h_table.h"
#include "t_hooks.h"
#include "t_funcs.h"
#include "t_msgbuilder.h"
#include "callid.h"
#include "uac.h"

Include dependency graph for tm/uac.c:

Go to the source code of this file.

Defines

#define FROM_TAG_LEN   (MD5_LEN + 1 /* - */ + CRC16_LEN)

Functions

static int check_params (str *method, str *to, str *from, dlg_t **dialog)
 Check value of parameters.
static unsigned int dlg2hash (dlg_t *dlg)
 Generate a hash from a dialog state.
void generate_fromtag (str *tag, str *callid)
 Generate a From tag from the callid.
int req_outside (str *method, str *to, str *from, str *headers, str *body, dlg_t **dialog, transaction_cb cb, void *cbp)
 Send an initial request that will start a dialog.
int req_within (str *method, str *headers, str *body, dlg_t *dialog, transaction_cb completion_cb, void *cbp)
 Send a message within a dialog.
int request (str *m, str *ruri, str *to, str *from, str *h, str *b, str *oburi, transaction_cb cb, void *cbp)
 Send a transactional request, no dialogs involved.
int t_uac (str *method, str *headers, str *body, dlg_t *dialog, transaction_cb cb, void *cbp)
 Send a request using data from the dialog structure.
int uac_init (void)
 Initialize UAC.

Variables

static char from_tag [FROM_TAG_LEN+1]
int pass_provisional_replies = 0


Detailed Description

TM :: Simple user agent support.

Simple UAC for things such as SUBSCRIBE or SMS gateway; no authentication and other UAC features -- just send a message, retransmit and await a reply; forking is not supported during client generation, in all other places it is -- adding it should be simple

Definition in file tm/uac.c.


Define Documentation

#define FROM_TAG_LEN   (MD5_LEN + 1 /* - */ + CRC16_LEN)

from tag length, MD5 + '-' + CRC16

Definition at line 80 of file tm/uac.c.

Referenced by generate_fromtag().


Function Documentation

static int check_params ( str method,
str to,
str from,
dlg_t **  dialog 
) [inline, static]

Check value of parameters.

Parameters:
method SIP method
to To URI
from From URI
dialog dialog state
Returns:
0 if parameter are ok, negative on error

Definition at line 145 of file tm/uac.c.

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

Referenced by req_outside(), and request().

static unsigned int dlg2hash ( dlg_t dlg  )  [inline, static]

Generate a hash from a dialog state.

Parameters:
dlg dialog state
Returns:
generated hash

Definition at line 175 of file tm/uac.c.

References dlg_id::call_id, dlg::id, int2str(), _str::len, LM_DBG, dlg::loc_seq, _str::s, tm_hash, and dlg_seq::value.

Referenced by t_uac().

void generate_fromtag ( str tag,
str callid 
)

Generate a From tag from the callid.

Note:
update the global from tag value
Parameters:
tag tag generated tag
callid source callid

Definition at line 128 of file tm/uac.c.

References crcitt_string_array(), from_tag, FROM_TAG_LEN, _str::len, MD5_LEN, and _str::s.

Referenced by mi_tm_uac_dlg(), req_outside(), and request().

int req_outside ( str method,
str to,
str from,
str headers,
str body,
dlg_t **  dialog,
transaction_cb  cb,
void *  cbp 
)

Send an initial request that will start a dialog.

Parameters:
method SIP method
to To URI
from From URI
headers SIP headers
body SIP body
dialog dialog state
cb transaction callback
cbp transaction callback parameter
Returns:
1 on success, negative on error

Definition at line 442 of file tm/uac.c.

References check_params(), DEFAULT_CSEQ, generate_callid(), generate_fromtag(), LM_ERR, new_dlg_uac(), and t_uac().

Referenced by load_tm().

int req_within ( str method,
str headers,
str body,
dlg_t dialog,
transaction_cb  completion_cb,
void *  cbp 
)

Send a message within a dialog.

Parameters:
method SIP method
headers SIP header
body SIP body
dialog dialog state
completion_cb transaction callback
cbp transaction callback parameter
Returns:
1 on success, negative on error

Definition at line 406 of file tm/uac.c.

References DLG_CONFIRMED, _str::len, LM_ERR, dlg::loc_seq, _str::s, dlg::state, t_uac(), and dlg_seq::value.

Referenced by load_tm().

int request ( str m,
str ruri,
str to,
str from,
str h,
str b,
str oburi,
transaction_cb  cb,
void *  cbp 
)

Send a transactional request, no dialogs involved.

Parameters:
m SIP method
ruri Request URI
to To URI
from From URI
h SIP headers
b SIP body
oburi outbound URI
cb transaction callback
cbp transaction callback parameter
Returns:
1 on success, negative on error

Definition at line 476 of file tm/uac.c.

References check_params(), DEFAULT_CSEQ, free_dlg(), generate_callid(), generate_fromtag(), dlg::hooks, _str::len, LM_ERR, new_dlg_uac(), dlg_hooks::next_hop, dlg::rem_target, dlg_hooks::request_uri, _str::s, t_uac(), and w_calculate_hooks().

Referenced by __dialog_created(), encode_msg(), end_media_session(), load_tm(), t_uac(), and use_media_proxy().

int t_uac ( str method,
str headers,
str body,
dlg_t dialog,
transaction_cb  cb,
void *  cbp 
)

int uac_init ( void   ) 


Variable Documentation

char from_tag[FROM_TAG_LEN+1] [static]

Enable/disable passing of provisional replies to FIFO applications

Definition at line 86 of file tm/uac.c.

Referenced by t_uac().


Generated on Thu May 24 20:00:45 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6