sst_mi.c

Go to the documentation of this file.
00001 /*
00002  * $Id: sst_mi.c 5776 2009-03-30 19:28:47Z henningw $
00003  *
00004  * Copyright (C) 2008 SOMA Networks, Inc.
00005  * Written By Ovidiu Sas (osas)
00006  *
00007  * This file is part of Kamailio, a free SIP server.
00008  *
00009  * Kamailio is free software; you can redistribute it and/or modify it
00010  * under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * (at your option) any later version
00013  *
00014  * Kamailio is distributed in the hope that it will be useful, but
00015  * WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017  * General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00022  * USA
00023  *
00024  * History:
00025  * --------
00026  * 2008-04-11 initial version (osas)
00027  */
00028 
00029 /*! 
00030  *\file  sst/sst_mi.c
00031  *\brief Manager functions for the SST module
00032  * \ingroup sst
00033  * Module: \ref sst
00034  */
00035 
00036 
00037 #include "../../ut.h"
00038 #include "../../mi/mi.h"
00039 #include "../dialog/dlg_load.h"
00040 #include "sst_handlers.h"
00041 
00042 /*! \brief
00043  * The dialog mi helper function.
00044  */
00045 void sst_dialog_mi_context_CB(struct dlg_cell* did, int type, struct dlg_cb_params * params)
00046 {
00047    struct mi_node* parent_node = (struct mi_node*)(params->dlg_data);
00048    struct mi_node* node;
00049    struct mi_attr* attr;
00050    sst_info_t* sst_info = (sst_info_t*)*(params->param);
00051    char* p;
00052    int len;
00053 
00054    node = add_mi_node_child(parent_node, 0, "sst", 3, NULL, 0);
00055    if (node==NULL) {
00056       LM_ERR("oom\n");
00057       return;
00058    }
00059 
00060    p = int2str((unsigned long)(sst_info->requester), &len);
00061    attr = add_mi_attr(node, MI_DUP_VALUE, "requester_flags", 15, p, len);
00062    if(attr == NULL) {
00063       LM_ERR("oom requester_flags\n");
00064       return;
00065    }
00066 
00067    p = int2str((unsigned long)(sst_info->supported), &len);
00068    attr = add_mi_attr(node, MI_DUP_VALUE, "supported_flags", 15, p, len);
00069    if(attr == NULL) {
00070       LM_ERR("oom supported_flags\n");
00071       return;
00072    }
00073 
00074    p = int2str((unsigned long)(sst_info->interval), &len);
00075    attr = add_mi_attr(node, MI_DUP_VALUE, "interval", 8, p, len);
00076    if(attr == NULL) {
00077       LM_ERR("oom interval\n");
00078       return;
00079    }
00080 
00081    return;
00082 }

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