|
@@ -42,6 +42,7 @@ MODULE_VERSION
|
|
static int sipt_destination(struct sip_msg *msg, char *_destination, char *_hops, char * _nai);
|
|
static int sipt_destination(struct sip_msg *msg, char *_destination, char *_hops, char * _nai);
|
|
static int sipt_set_calling(struct sip_msg *msg, char *_origin, char *_nai, char *_pres, char * _screen);
|
|
static int sipt_set_calling(struct sip_msg *msg, char *_origin, char *_nai, char *_pres, char * _screen);
|
|
static int sipt_get_hop_counter(struct sip_msg *msg, pv_param_t *param, pv_value_t *res);
|
|
static int sipt_get_hop_counter(struct sip_msg *msg, pv_param_t *param, pv_value_t *res);
|
|
|
|
+static int sipt_get_event_info(struct sip_msg *msg, pv_param_t *param, pv_value_t *res);
|
|
static int sipt_get_cpc(struct sip_msg *msg, pv_param_t *param, pv_value_t *res);
|
|
static int sipt_get_cpc(struct sip_msg *msg, pv_param_t *param, pv_value_t *res);
|
|
static int sipt_get_calling_party_nai(struct sip_msg *msg, pv_param_t *param, pv_value_t *res);
|
|
static int sipt_get_calling_party_nai(struct sip_msg *msg, pv_param_t *param, pv_value_t *res);
|
|
static int sipt_get_presentation(struct sip_msg *msg, pv_param_t *param, pv_value_t *res);
|
|
static int sipt_get_presentation(struct sip_msg *msg, pv_param_t *param, pv_value_t *res);
|
|
@@ -103,6 +104,8 @@ static pv_export_t mod_items[] = {
|
|
0, 0, 0, 0 },
|
|
0, 0, 0, 0 },
|
|
{ {"sipt_hop_counter", sizeof("sipt_hop_counter")-1}, PVT_OTHER, sipt_get_hop_counter, 0,
|
|
{ {"sipt_hop_counter", sizeof("sipt_hop_counter")-1}, PVT_OTHER, sipt_get_hop_counter, 0,
|
|
0, 0, 0, 0 },
|
|
0, 0, 0, 0 },
|
|
|
|
+ { {"sipt_event_info", sizeof("sipt_cpc")-1}, PVT_OTHER, sipt_get_event_info, 0,
|
|
|
|
+ 0, 0, 0, 0 },
|
|
{ {"sipt_cpc", sizeof("sipt_cpc")-1}, PVT_OTHER, sipt_get_cpc, 0,
|
|
{ {"sipt_cpc", sizeof("sipt_cpc")-1}, PVT_OTHER, sipt_get_cpc, 0,
|
|
0, 0, 0, 0 },
|
|
0, 0, 0, 0 },
|
|
{ {"sipt_calling_party_nai", sizeof("sipt_calling_party_nai")-1}, PVT_OTHER, sipt_get_calling_party_nai, 0,
|
|
{ {"sipt_calling_party_nai", sizeof("sipt_calling_party_nai")-1}, PVT_OTHER, sipt_get_calling_party_nai, 0,
|
|
@@ -148,6 +151,27 @@ static int sipt_get_hop_counter(struct sip_msg *msg, pv_param_t *param, pv_value
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static int sipt_get_event_info(struct sip_msg *msg, pv_param_t *param, pv_value_t *res)
|
|
|
|
+{
|
|
|
|
+ str body;
|
|
|
|
+ body.s = get_body_part(msg, TYPE_APPLICATION,SUBTYPE_ISUP,&body.len);
|
|
|
|
+
|
|
|
|
+ if(body.s == NULL)
|
|
|
|
+ {
|
|
|
|
+ LM_INFO("No ISUP Message Found");
|
|
|
|
+ return -1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(body.s[0] != ISUP_CPG)
|
|
|
|
+ {
|
|
|
|
+ LM_DBG("message not an CPG\n");
|
|
|
|
+ return -1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ pv_get_sintval(msg, param, res, isup_get_event_info((unsigned char*)body.s, body.len));
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+
|
|
static int sipt_get_cpc(struct sip_msg *msg, pv_param_t *param, pv_value_t *res)
|
|
static int sipt_get_cpc(struct sip_msg *msg, pv_param_t *param, pv_value_t *res)
|
|
{
|
|
{
|
|
str body;
|
|
str body;
|