Data Structures | Typedefs | Enumerations | Functions

sst_handlers.h File Reference

Session timer handlingModule: SIP Session Timers module. More...

#include "../../pvar.h"
#include "../../parser/msg_parser.h"
#include "../dialog/dlg_load.h"
Include dependency graph for sst_handlers.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

Typedefs

Enumerations

Functions


Detailed Description

Definition in file sst_handlers.h.


Function Documentation

int sst_check_min ( struct sip_msg msg,
char *  flag,
char *  str2 
)

The script function.

Return 1 (true) if the MIN-SE: of the message is too small compared to the sst_min_se value. This will allow the script to reply to this INVITE with a "422 Session Timer Too Small" response. if sst_min_se was never set the recommended value of 1800 seconds will be used.

If the flag (str1) is set to 1, the 422 reply will be sent with the sst MIN_SE value in the header. If the flag is not set or is NULL, no reply is sent.

Parameters:
msg - The sip message from the script (INVITE only)
flag - Reply mode Flag. 0/NULL do not send reply, 1 send 422 reply if Session-Expires is to small with the MIN-SE header in the reply
str2 - Not used.
Returns:
1 if the MIN-SE is too small, -1 if it is OK, or It could not be checked.

NOTE: returning 0 == drop message, 1 == true, -1 == false in the script.

Definition at line 611 of file sst_handlers.c.

References sip_msg::first_line, _str::len, METHOD_INVITE, parse_min_se(), parse_session_expires(), _str::s, send_response(), and sst_min_se.

Here is the call graph for this function:

void sst_dialog_created_CB ( struct dlg_cell did,
int  type,
struct dlg_cb_params *  params 
)

The static (opening) callback function for all dialog creations.

We need to track the dialogs lifespan from this point forward until it is terminated with a BYE, CANCEL, etc. In the process, we will see if either or both ends of the conversation supports SIP Session Timers and setup the dialog timeout to expire at the session timer expire time. Each time the new re-INVITE is seen to update the SST, we will reset the life span of the dialog to match it.

This function will setup the other types of dialog callbacks required to track the lifespan of the dialog. It will also start the state tracking to figure out if and who supports SST.

As per RFC4028: Request handling:

  • The proxy may insert a SE header if none found.
  • The SE value can be anything >= Min-SE (if found)
  • The proxy MUST NOT add a refresher parameter to the SE.
  • If SE is already there, the Proxy can reduce its value but no lower then the Min-SE value if present.
  • If the SE value is >= Min-SE the proxy MUST NOT increase it!
  • If the SE value is < Min-SE (settable by the proxy) the proxy MUST increase the SE value to >= the new Min-SE.
  • The proxy MUST NOT insert or change the refresher parameter.
  • If the supported=timer is found, the proxy may reject the request with a 422 if the SE value is smaller then the local policy. The 422 MUST hold the proxies Min-SE value >= 90.
  • If support=timer is NOT indecated, the proxy can't reject with a 422 but can include/increase the MIN-SE: to be = to local policy. and increase the SE to match the new Min-SE value.
  • the proxy MUST NOT insert/change the Min-SE header if supported=timer is present. (DoS attacks)
Parameters:
did - The dialog ID
type - The trigger event type (CREATED)
params - The pointer to nothing. As we did not attach anything to this callback in the dialog module.

Definition at line 249 of file sst_handlers.c.

References append_header(), sip_msg::first_line, METHOD_INVITE, parse_msg_for_sst_info(), remove_header(), _str::s, send_reject(), set_timeout_avp(), setup_dialog_callbacks(), sst_flag, sst_min_se, and sst_reject.

Referenced by mod_init().

Here is the call graph for this function:

Here is the caller graph for this function:

void sst_handler_init ( pv_spec_t *  timeout_avp_p,
unsigned int  min_se,
int  flag,
unsigned int  reject 
)

The handlers initializer function.

This function is called when the module is loaded from the mod_init() function in sst.c to initialize the callback handlers and local variables.

Parameters:
timeout_avp_p - The pointer to the dialog modules timeout AVP.
min_se - The minimum session expire value allowed by this PROXY.
flag - sst flag
reject - reject state

Definition at line 199 of file sst_handlers.c.

References sst_flag, sst_min_se, sst_reject, and timeout_avp.

Referenced by mod_init().

Here is the caller graph for this function: