sst_mi.c
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
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
00043
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 }