seas_action.h File Reference

#include "seas.h"

Include dependency graph for seas_action.h:

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

Go to the source code of this file.

Data Structures

struct  as_uac_param

Defines

#define AC_CANCEL   7
#define AC_FAIL_UNKNOWN   0x01
#define AC_RES_FAIL   5
#define FAKED_REPLY_FLAG   0x02
#define JAIN_PONG   8
#define REPLY_FIN   2
#define REPLY_FIN_DLG   3
#define REPLY_PROV   1
#define SL_MSG   6
#define UAC_REQ   4

Functions

int ac_cancel (as_p the_as, char *action, int len)
int ac_encode_msg (as_p the_as, char *action, int len)
int ac_reply (as_p the_as, char *action, int len)
int ac_sl_msg (as_p the_as, char *action, int len)
int ac_uac_req (as_p the_as, char *action, int len)
int as_action_fail_resp (int uac_id, int sip_error, char *err_buf, int err_len)
char * create_as_action_reply (struct cell *c, struct tmcb_params *params, int uac_id, char processor_id, int *evt_len)
int dispatch_actions (void)
int extract_allowed_headers (struct sip_msg *my_msg, int allow_vias, int allow_Rroutes, hdr_flags_t forbidden_hdrs, char *headers, int headers_len)
int forward_sl_request (struct sip_msg *msg, struct proxy_l *proxy, int proto)
int process_action (as_p my_as)
void uac_cb (struct cell *t, int type, struct tmcb_params *)
void uac_cleanup_cb (struct cell *t, int type, struct tmcb_params *)


Define Documentation

#define AC_CANCEL   7

Definition at line 31 of file seas_action.h.

Referenced by process_action().

#define AC_FAIL_UNKNOWN   0x01

Definition at line 35 of file seas_action.h.

#define AC_RES_FAIL   5

Definition at line 29 of file seas_action.h.

Referenced by as_action_fail_resp().

#define FAKED_REPLY_FLAG   0x02

Definition at line 37 of file seas_action.h.

Referenced by create_as_action_reply().

#define JAIN_PONG   8

Definition at line 32 of file seas_action.h.

Referenced by process_action().

#define REPLY_FIN   2

Definition at line 26 of file seas_action.h.

Referenced by process_action().

#define REPLY_FIN_DLG   3

Definition at line 27 of file seas_action.h.

#define REPLY_PROV   1

Definition at line 25 of file seas_action.h.

Referenced by process_action().

#define SL_MSG   6

Definition at line 30 of file seas_action.h.

Referenced by process_action().

#define UAC_REQ   4

Definition at line 28 of file seas_action.h.

Referenced by process_action().


Function Documentation

int ac_cancel ( as_p  the_as,
char *  action,
int  len 
)

ac_cancel:

Parameters:
the_as Application Server structure which sent this action
action action payload
len the length of the payload
This function cancels a previously initiated UAC Transaction. it receives the HashIndex and Label of the cell being cancelled and invokes t_cancel_uac from the transactionModule API which cancels the transaction.

Returns:

Definition at line 393 of file seas_action.c.

References as_action_fail_resp(), sip_msg::buf, CRLF, CRLF_LEN, as_uac_param::destroy_cb_set, extract_allowed_headers(), sip_msg::first_line, free_hdr_field_lst(), get_body(), get_content_length, HDR_CALLID_F, HDR_CONTENTLENGTH_F, HDR_CSEQ_F, HDR_EOH_F, HDR_FROM_F, HDR_ROUTE_F, HDR_TO_F, sip_msg::headers, sip_msg::len, _str::len, LM_DBG, LM_ERR, MAX_HEADER, my_as, net2hostL, NULL, parse_headers(), parse_msg(), pkg_free, pkg_malloc, as_uac_param::processor_id, _str::s, SE_CANCEL, SE_CANCEL_MSG, SE_CANCEL_MSG_LEN, seas_f, shm_free, shm_malloc(), SIP_REPLY, SPIRAL_FLAG, SPIRAL_HDR, SPIRAL_HDR_LEN, tm_binds::t_cancel_uac, tm_binds::t_lookup_ident, seas_functions::tmb, msg_start::type, uac_cb(), as_uac_param::uac_id, tm_binds::unref_cell, and as_uac_param::who.

Referenced by process_action().

int ac_encode_msg ( as_p  the_as,
char *  action,
int  len 
)

int ac_reply ( as_p  the_as,
char *  action,
int  len 
)

int ac_sl_msg ( as_p  the_as,
char *  action,
int  len 
)

int ac_uac_req ( as_p  the_as,
char *  action,
int  len 
)

we trick req_within

Awful hack: to be able to set our own CSeq, from_tag and call-ID we have to use req_within instead of req_outside (it sets it's own CSeq,Call-ID and ftag), so we have to simulate that the dialog is already in completed state so...

this SHOULD be: shm_duplicate_rr(&my_dlg->route_set,my_msg->route->parsed); but it will last more...

now undo all the fakes we have put in my_dlg

Definition at line 912 of file seas_action.c.

References as_action_fail_resp(), hdr_field::body, calculate_hooks(), sip_msg::callid, check_transaction_quadruple(), sip_msg::content_length, CRLF, CRLF_LEN, sip_msg::cseq, as_uac_param::destroy_cb_set, to_body::display, tm_binds::dlg_add_extra, DLG_CONFIRMED, E_UNSPEC, err2reason_phrase(), extract_allowed_headers(), sip_msg::first_line, tm_binds::free_dlg, free_hdr_field_lst(), sip_msg::from, get_body(), get_content_length, get_from, HDR_CALLID_F, HDR_CONTENTLENGTH_F, HDR_CSEQ_F, HDR_EOH_F, HDR_FROM_F, HDR_ROUTE_F, HDR_TO_F, sip_msg::headers, dlg::hooks, dlg::id, _str::len, LM_DBG, LM_ERR, MAX_HEADER, MAX_REASON_LEN, METHOD_ACK, METHOD_CANCEL, my_as, net2hostL, tm_binds::new_dlg_uac, dlg_hooks::next_hop, NULL, cseq_body::number, parse_ac_msg(), parse_from_header(), parse_headers(), parse_rr(), hdr_field::parsed, pkg_free, pkg_malloc, print_local_uri(), as_uac_param::processor_id, dlg_id::rem_tag, dlg::rem_target, msg_start::request, sip_msg::route, dlg::route_set, _str::s, SE_UAC, seas_f, server_signature, shm_free, shm_malloc(), shm_str_dup(), SIP_REPLY, SPIRAL_FLAG, SPIRAL_HDR, SPIRAL_HDR_LEN, dlg::state, str2int(), dlg::T_flags, T_NO_AUTOACK_FLAG, T_PASS_PROVISIONAL_FLAG, tm_binds::t_request_within, to_body::tag_value, seas_functions::tmb, sip_msg::to, msg_start::type, msg_start::u, uac_cb(), as_uac_param::uac_id, to_body::uri, and as_uac_param::who.

Referenced by process_action().

int as_action_fail_resp ( int  uac_id,
int  sip_error,
char *  err_buf,
int  i 
)

Event creating functions

ERROR action responses are composed of: 4: the length of the event 1: the event type (AC_RES_FAIL) 4: NBO of the uac-action-request identification (uac_id) 4: the sip_error code in NBO. 1: (unsigned) the length of the string. N: the string

Definition at line 1358 of file seas_action.c.

References AC_RES_FAIL, app_server::action_fd, as_entry::as, LM_ERR, MAX_REASON_LEN, my_as, and as_entry::u.

Referenced by ac_cancel(), and ac_uac_req().

char* create_as_action_reply ( struct cell c,
struct tmcb_params params,
int  uac_id,
char  processor_id,
int *  evt_len 
)

int dispatch_actions ( void   ) 

int extract_allowed_headers ( struct sip_msg my_msg,
int  strip_top_vias,
int  allow_top_Rroutes,
hdr_flags_t  forbidden_hdrs,
char *  headers,
int  headers_len 
)

Strips the "<strip_top_vias>" topmost via headers. Leaves only the topmost "<allow_top_routes>" Record-Route headers.

All vias MUST be parsed !!

skip this via header

is this dangerous ? because the rtcnt is the control variable for this conditional 'if' so if I change rtcnt value in one of the statements... what then ???

Definition at line 1250 of file seas_action.c.

References hdr_field::body, CRLF, CRLF_LEN, via_body::error, free_rr(), HDR_RECORDROUTE_T, HDR_T2F, HDR_VIA_T, sip_msg::headers, via_body::i, rr::len, hdr_field::len, _str::len, len, LM_DBG, LM_ERR, LM_WARN, name_addr::name, via_body::name, hdr_field::name, rr::nameaddr, rr::next, via_body::next, hdr_field::next, NULL, parse_rr(), hdr_field::parsed, rb, _str::s, hdr_field::type, VIA, and VIA_LEN.

Referenced by ac_cancel(), ac_reply(), and ac_uac_req().

int forward_sl_request ( struct sip_msg msg,
struct proxy_l proxy,
int  proto 
)

int process_action ( as_p  the_as  ) 

Processes the actions received from the socket. returns -1 on error 0 on success

Definition at line 276 of file seas_action.c.

References app_server::ac_buffer, ac_cancel(), AC_CANCEL, ac_jain_pong(), ac_reply(), ac_sl_msg(), ac_uac_req(), AS_BUF_SIZE, JAIN_PONG, _str::len, LM_DBG, LM_WARN, app_server::name, REPLY_FIN, REPLY_PROV, _str::s, SL_MSG, stats_reply(), UAC_REQ, and use_stats.

Referenced by process_input().

void uac_cb ( struct cell t,
int  type,
struct tmcb_params rcvd_params 
)

Callback Functions

This function will be called from a SER process when a reply is received for the transaction. The SER processes only have acces to the EventDispatcher fifo (not to the ActionDispatcher) so EventDispatcher will be the one who will send the event to the AppServer. TODO WARNING !!! there's a clear MEMORY LEAK here, see exit: at the bottom of the function... it should free ev_info !!!!!!!! I have disabled the free() because It may be that we receive a retransmitted 200 OK if the ACK gets lost, that 200 OK will make SER invoke this callback a second,third, etc time...

Definition at line 1412 of file seas_action.c.

References as_msg::as, tmcb_params::code, create_as_action_reply(), as_uac_param::destroy_cb_set, is_local, ua_client::last_received, as_msg::len, _str::len, LM_DBG, LM_ERR, as_msg::msg, as_entry::name, cell::nr_of_outgoings, NULL, tmcb_params::param, as_uac_param::processor_id, tm_binds::register_tmcb, RES_IN, tmcb_params::rpl, _str::s, seas_f, shm_free, shm_malloc(), seas_functions::tmb, TMCB_LOCAL_COMPLETED, TMCB_TRANS_DELETED, as_msg::transaction, as_msg::type, cell::uac, uac_cleanup_cb(), as_uac_param::uac_id, as_uac_param::who, and write_pipe.

Referenced by ac_cancel(), and ac_uac_req().

void uac_cleanup_cb ( struct cell t,
int  type,
struct tmcb_params  
)

Definition at line 1389 of file seas_action.c.

References NULL, tmcb_params::param, and shm_free.

Referenced by uac_cb().


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