qos_handlers.c File Reference

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "../../parser/parser_f.h"
#include "../../parser/sdp/sdp.h"
#include "../../ut.h"
#include "../../dprint.h"
#include "../dialog/dlg_hash.h"
#include "qos_mi.h"
#include "qos_handlers.h"
#include "qos_ctx_helpers.h"

Include dependency graph for qos_handlers.c:

Go to the source code of this file.

Functions

void qos_dialog_created_CB (struct dlg_cell *did, int type, struct dlg_cb_params *params)
static void qos_dialog_destroy_CB (struct dlg_cell *did, int type, struct dlg_cb_params *params)
static void qos_dialog_request_CB (struct dlg_cell *did, int type, struct dlg_cb_params *params)
static void qos_dialog_response_CB (struct dlg_cell *did, int type, struct dlg_cb_params *params)
static void setup_dialog_callbacks (struct dlg_cell *did, qos_ctx_t *ctx)

Variables

struct dlg_bindsdlg_binds


Function Documentation

void qos_dialog_created_CB ( struct dlg_cell did,
int  type,
struct dlg_cb_params params 
)

Every time a new dialog is created (from a new INVITE) the dialog module will call this callback function. 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 are trying to re-negotiate the media.

This function will setup the other types of dialog callbacks required to track the lifespan of the dialog.

Parameters:
did - The dialog ID
type - The trigger event type (CREATED)
msg - The SIP message that triggered the callback (INVITE)
param - The pointer to nothing. As we did not attach anything to this callback in the dialog module.

Definition at line 113 of file qos_handlers.c.

References add_sdp(), build_new_qos_ctx(), dlg_cb_params::direction, DLG_DIR_DOWNSTREAM, DLG_DIR_UPSTREAM, FAKED_REPLY, sip_msg::first_line, LM_DBG, LM_ERR, LM_WARN, qos_ctx_st::lock, METHOD_INVITE, dlg_cb_params::msg, NULL, QOS_CALLEE, QOS_CALLER, msg_start::request, run_create_cbs(), setup_dialog_callbacks(), SIP_REQUEST, msg_start::type, and msg_start::u.

Referenced by mod_init().

static void qos_dialog_destroy_CB ( struct dlg_cell did,
int  type,
struct dlg_cb_params params 
) [static]

This callback is called when ever a dialog isdestroyed.

Parameters:
did - The Dialog ID / structure pointer. Used as an ID only.
type - The termination cause/reason.
params - pointer to the dlg_cb params

Definition at line 171 of file qos_handlers.c.

References destroy_qos_ctx(), dlg_cb_params::msg, NULL, dlg_cb_params::param, QOSCB_TERMINATED, and run_qos_callbacks().

Referenced by setup_dialog_callbacks().

static void qos_dialog_request_CB ( struct dlg_cell did,
int  type,
struct dlg_cb_params params 
) [static]

Parameters:
did - The dialog structure. The pointer is used as an ID.
type - The reason for the callback. DLGCB_REQ_WITHIN
msg - The SIP message that causes the callback.
param - The qos information

Definition at line 194 of file qos_handlers.c.

References add_sdp(), dlg_cb_params::direction, DLG_DIR_DOWNSTREAM, DLG_DIR_UPSTREAM, sip_msg::first_line, LM_DBG, LM_ERR, qos_ctx_st::lock, METHOD_ACK, METHOD_INVITE, METHOD_PRACK, METHOD_UPDATE, dlg_cb_params::msg, dlg_cb_params::param, QOS_CALLEE, QOS_CALLER, msg_start::request, SIP_REQUEST, msg_start::type, and msg_start::u.

Referenced by setup_dialog_callbacks().

static void qos_dialog_response_CB ( struct dlg_cell did,
int  type,
struct dlg_cb_params params 
) [static]

This callback is called on any response message in the lifespan of the dialog. The callback is called just before the message is copied to pkg memory so it is still mutable.

Parameters:
did - The dialog structure. The pointer is used as an ID.
type - The reason for the callback. DLGCB_CONFIRMED
msg - The SIP message that causes the callback.
param - The qos information

Definition at line 243 of file qos_handlers.c.

References add_sdp(), dlg_cb_params::direction, DLG_DIR_DOWNSTREAM, DLG_DIR_UPSTREAM, sip_msg::first_line, LM_ERR, qos_ctx_st::lock, dlg_cb_params::msg, dlg_cb_params::param, QOS_CALLEE, QOS_CALLER, remove_sdp(), msg_start::reply, SIP_REPLY, msg_start::type, and msg_start::u.

Referenced by setup_dialog_callbacks().

static void setup_dialog_callbacks ( struct dlg_cell did,
qos_ctx_t ctx 
) [static]

Local function prototypes. See function definition for documentation.

The value of the message flag to flag an INVITE we want to process through the QoS module. A helper function to setup all the callbacks from the dialog module after we find intrest in the dialog.

Parameters:
did The Dialog ID.
info The qos information.

Definition at line 79 of file qos_handlers.c.

References DLGCB_DESTROY, DLGCB_MI_CONTEXT, DLGCB_REQ_WITHIN, DLGCB_RESPONSE_FWDED, DLGCB_RESPONSE_WITHIN, NULL, qos_dialog_destroy_CB(), qos_dialog_mi_context_CB(), qos_dialog_request_CB(), qos_dialog_response_CB(), and dlg_binds::register_dlgcb.

Referenced by qos_dialog_created_CB(), and sst_dialog_created_CB().


Variable Documentation

The binding to the dialog module functions. Most importantly the register_dlgcb function.

Definition at line 53 of file qos.c.


Generated on Thu May 24 08:01:16 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6