|
@@ -57,6 +57,7 @@
|
|
#include "route_struct.h"
|
|
#include "route_struct.h"
|
|
#include "flags.h"
|
|
#include "flags.h"
|
|
#include "trim.h"
|
|
#include "trim.h"
|
|
|
|
+#include "pvapi.h"
|
|
#include "globals.h"
|
|
#include "globals.h"
|
|
#include "rpc_lookup.h"
|
|
#include "rpc_lookup.h"
|
|
#include "sr_compat.h"
|
|
#include "sr_compat.h"
|
|
@@ -1501,8 +1502,6 @@ int fixup_str_2(void** param, int param_no)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-#define PV_PRINT_BUF_SIZE 1024
|
|
|
|
-#define PV_PRINT_BUF_NO 6
|
|
|
|
/** Get the function parameter value as string.
|
|
/** Get the function parameter value as string.
|
|
* @return 0 - Success
|
|
* @return 0 - Success
|
|
* -1 - Cannot get value
|
|
* -1 - Cannot get value
|
|
@@ -1513,8 +1512,6 @@ int get_str_fparam(str* dst, struct sip_msg* msg, fparam_t* param)
|
|
int ret;
|
|
int ret;
|
|
avp_t* avp;
|
|
avp_t* avp;
|
|
pv_value_t pv_val;
|
|
pv_value_t pv_val;
|
|
- static int buf_itr = 0; /* ugly hack needed for PVE */
|
|
|
|
- static char pve_buf[PV_PRINT_BUF_NO][PV_PRINT_BUF_SIZE];
|
|
|
|
|
|
|
|
switch(param->type) {
|
|
switch(param->type) {
|
|
case FPARAM_REGEX:
|
|
case FPARAM_REGEX:
|
|
@@ -1559,9 +1556,8 @@ int get_str_fparam(str* dst, struct sip_msg* msg, fparam_t* param)
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case FPARAM_PVE:
|
|
case FPARAM_PVE:
|
|
- dst->s=pve_buf[buf_itr];
|
|
|
|
- dst->len=PV_PRINT_BUF_SIZE;
|
|
|
|
- buf_itr = (buf_itr+1)%PV_PRINT_BUF_NO;
|
|
|
|
|
|
+ dst->s=pv_get_buffer();
|
|
|
|
+ dst->len=pv_get_buffer_size();
|
|
if (unlikely(pv_printf(msg, param->v.pve, dst->s, &dst->len)!=0)){
|
|
if (unlikely(pv_printf(msg, param->v.pve, dst->s, &dst->len)!=0)){
|
|
ERR("Could not convert the PV-formated string to str\n");
|
|
ERR("Could not convert the PV-formated string to str\n");
|
|
dst->len=0;
|
|
dst->len=0;
|