ERROR:core:pv_parse_spec: bad parameters after upgrading to 1.5

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

ERROR:core:pv_parse_spec: bad parameters after upgrading to 1.5

Carlo Dimaggio
Hi all,

After the upgrading to 1.5 I see these errors in my log:


Mar 25 10:25:48 sip /sbin/opensips[7908]: ERROR:core:pv_parse_spec:  
bad parameters
Mar 25 10:25:48 sip /sbin/opensips[7908]: ERROR:group:get_hf:  
unsupported User Field identifier
Mar 25 10:25:48 sip /sbin/opensips[7908]: ERROR:group:is_user_in:  
unable to get user/dom source


These errors appear after few calls (for example I have no errors for  
the first 2-3 calls), but I'm able to make calls.

I don't know what can be the reason because in 1.4.3 there was no  
problem.
The only thing I have added to configuration is create_dialog() before  
using set_dlg_profile().


Can you help me understanding these errors?


Thank you,
Carlo Dimaggio



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: ERROR:core:pv_parse_spec: bad parameters after upgrading to 1.5

Carlo Dimaggio

Il giorno 25/mar/09, alle ore 10:40, Carlo Dimaggio ha scritto:

> Hi all,
>
> After the upgrading to 1.5 I see these errors in my log:
>
> Mar 25 10:25:48 sip /sbin/opensips[7908]: ERROR:core:pv_parse_spec:
> bad parameters
> Mar 25 10:25:48 sip /sbin/opensips[7908]: ERROR:group:get_hf:
> unsupported User Field identifier
> Mar 25 10:25:48 sip /sbin/opensips[7908]: ERROR:group:is_user_in:
> unable to get user/dom source


I think this problem is the same in the emails with subject "opensips  
1.5.0 crashes when using is_user_in()".
I have no crashes but I can't use is_user_in() function...


Thanks and regards,
Carlo Dimaggio

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: ERROR:core:pv_parse_spec: bad parameters after upgrading to 1.5

Sergio Gutierrez
Hi Carlo.

Could you paste the config block where you are calling is_user_in()?

Regards

S.

On Wed, Mar 25, 2009 at 11:52 AM, Carlo Dimaggio <[hidden email]> wrote:

Il giorno 25/mar/09, alle ore 10:40, Carlo Dimaggio ha scritto:

> Hi all,
>
> After the upgrading to 1.5 I see these errors in my log:
>
> Mar 25 10:25:48 sip /sbin/opensips[7908]: ERROR:core:pv_parse_spec:
> bad parameters
> Mar 25 10:25:48 sip /sbin/opensips[7908]: ERROR:group:get_hf:
> unsupported User Field identifier
> Mar 25 10:25:48 sip /sbin/opensips[7908]: ERROR:group:is_user_in:
> unable to get user/dom source


I think this problem is the same in the emails with subject "opensips
1.5.0 crashes when using is_user_in()".
I have no crashes but I can't use is_user_in() function...


Thanks and regards,
Carlo Dimaggio

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



--
Sergio Gutiérrez

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: ERROR:core:pv_parse_spec: bad parameters after upgrading to 1.5

Carlo Dimaggio

Il giorno 25/mar/09, alle ore 17:55, Sergio Gutierrez ha scritto:

> Hi Carlo.
>
> Could you paste the config block where you are calling is_user_in()?

Hi Sergio,

I use the function is_user_in() in different blocks (dipends of the  
destination, but the problem is for all targets...). For example:

            if (uri=~"^sip:\+393[1-9][0-9]{8}@") {
                 xlog ("L_INFO", "ITALY_MOBILE call - M=$rm RURI=$ru F=
$fu T=$tu IP=$si ID=$ci\n");
                 if (is_user_in("credentials","ITALY_MOBILE")) {


It is strange because I didn't have any problem with 1.4.3 version.


Thank you,
Carlo Dimaggio

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: ERROR:core:pv_parse_spec: bad parameters after upgrading to 1.5

Sergio Gutierrez

Hi Carlo.

Just for testing, could you try this:

...
$avp(s:group)="ITALY_MOBILE";
if(is_user_in("credentials", "$avp(s:group)"))
...


Best regards.

Sergio.


On Wed, Mar 25, 2009 at 12:30 PM, Carlo Dimaggio <[hidden email]> wrote:

Il giorno 25/mar/09, alle ore 17:55, Sergio Gutierrez ha scritto:


Hi Carlo.

Could you paste the config block where you are calling is_user_in()?

Hi Sergio,

I use the function is_user_in() in different blocks (dipends of the destination, but the problem is for all targets...). For example:

          if (uri=~"^sip:\+393[1-9][0-9]{8}@") {
               xlog ("L_INFO", "ITALY_MOBILE call - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
               if (is_user_in("credentials","ITALY_MOBILE")) {


It is strange because I didn't have any problem with 1.4.3 version.


Thank you,
Carlo Dimaggio



--
Sergio Gutiérrez

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: ERROR:core:pv_parse_spec: bad parameters after upgrading to 1.5

Carlo Dimaggio

Il giorno 25/mar/09, alle ore 18:35, Sergio Gutierrez ha scritto:

>
> Hi Carlo.
>
> Just for testing, could you try this:
>
> ...
> $avp(s:group)="ITALY_MOBILE";
> if(is_user_in("credentials", "$avp(s:group)"))
> ...


Hi Sergio,

I've tried but nothing... same problem (and same errors)


Regards,
Carlo

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: ERROR:core:pv_parse_spec: bad parameters after upgrading to 1.5

Bogdan-Andrei Iancu
In reply to this post by Carlo Dimaggio
HI Carlo,

I think the correct format should be :

if (is_user_in("Credentials","ITALY_MOBILE")) {
                ^

See the capital "C" in "Credentials"

Regards,
Bogdan

Carlo Dimaggio wrote:

> Il giorno 25/mar/09, alle ore 17:55, Sergio Gutierrez ha scritto:
>
>  
>> Hi Carlo.
>>
>> Could you paste the config block where you are calling is_user_in()?
>>    
>
> Hi Sergio,
>
> I use the function is_user_in() in different blocks (dipends of the  
> destination, but the problem is for all targets...). For example:
>
>             if (uri=~"^sip:\+393[1-9][0-9]{8}@") {
>                  xlog ("L_INFO", "ITALY_MOBILE call - M=$rm RURI=$ru F=
> $fu T=$tu IP=$si ID=$ci\n");
>                  if (is_user_in("credentials","ITALY_MOBILE")) {
>
>
> It is strange because I didn't have any problem with 1.4.3 version.
>
>
> Thank you,
> Carlo Dimaggio
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>  


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: ERROR:core:pv_parse_spec: bad parameters after upgrading to 1.5

Carlo Dimaggio

Il giorno 25/mar/09, alle ore 19:04, Bogdan-Andrei Iancu ha scritto:

> HI Carlo,
>
> I think the correct format should be :
>
> if (is_user_in("Credentials","ITALY_MOBILE")) {
>               ^
> See the capital "C" in "Credentials"

Hi Bogdan,

Same errors (see below). I don't think this is the problem because  
there is before an error "pv_parse_spec: bad parameters" (that appears  
on the 2-3th call...)
What does these errors mean?

Mar 26 09:46:25 sip /sbin/opensips[10170]: ERROR:core:pv_parse_spec:  
bad parameters
Mar 26 09:46:25 sip /sbin/opensips[10170]: ERROR:group:get_hf:  
unsupported User Field identifier
Mar 26 09:46:25 sip /sbin/opensips[10170]: ERROR:group:is_user_in:  
unable to get user/dom source

Thanks,
Carlo

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: ERROR:core:pv_parse_spec: bad parameters after upgrading to 1.5

Bogdan-Andrei Iancu
Hi Carlo,

I just checked with 1.5  the

    if (is_user_in("Credentials","ITALY_MOBILE")) {

and it is ok. no error.

Are you sure this is the line that generates the error? I suspect you
might have a typo in one of the "is_user_in()" functions, for the first
param. Because if this value is not recognized as a default one (see
http://www.opensips.org/html/docs/modules/devel/group.html#id228395), it
is assumed   to be a pseudo-variable. And the error you get is about an
invalid PV....

So,please check your script.

Regards,
Bogdan



Carlo Dimaggio wrote:

> Il giorno 25/mar/09, alle ore 19:04, Bogdan-Andrei Iancu ha scritto:
>
>  
>> HI Carlo,
>>
>> I think the correct format should be :
>>
>> if (is_user_in("Credentials","ITALY_MOBILE")) {
>>               ^
>> See the capital "C" in "Credentials"
>>    
>
> Hi Bogdan,
>
> Same errors (see below). I don't think this is the problem because  
> there is before an error "pv_parse_spec: bad parameters" (that appears  
> on the 2-3th call...)
> What does these errors mean?
>
> Mar 26 09:46:25 sip /sbin/opensips[10170]: ERROR:core:pv_parse_spec:  
> bad parameters
> Mar 26 09:46:25 sip /sbin/opensips[10170]: ERROR:group:get_hf:  
> unsupported User Field identifier
> Mar 26 09:46:25 sip /sbin/opensips[10170]: ERROR:group:is_user_in:  
> unable to get user/dom source
>
> Thanks,
> Carlo
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>  


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: ERROR:core:pv_parse_spec: bad parameters after upgrading to 1.5

Carlo Dimaggio

Il giorno 26/mar/09, alle ore 17:13, Bogdan-Andrei Iancu ha scritto:

> Hi Carlo,
>
> I just checked with 1.5  the
>    if (is_user_in("Credentials","ITALY_MOBILE")) {
> and it is ok. no error.
>
> Are you sure this is the line that generates the error? I suspect  
> you might have a typo in one of the "is_user_in()" functions, for  
> the first param. Because if this value is not recognized as a  
> default one (see http://www.opensips.org/html/docs/modules/devel/group.html#id228395)
> , it is assumed   to be a pseudo-variable. And the error you get is  
> about an invalid PV....
> So,please check your script.


Hi Bogdan,

I have 5 blocks in which I use the function is_user_in():

         if (is_user_in("Credentials", "quota")) {

         if (!is_user_in("Credentials", "ITALY_NATIONAL")) {

         if (is_user_in("Credentials", "ITALY_NATIONAL")) {

         if (is_user_in("Credentials", "ITALY_MOBILE")) {

         if (is_user_in("Credentials", "INTERNATIONAL")) {

In all functions I use "Credentials" as first parameter. Do you see  
something wrong?
If I comment these lines I don't have errors...


Thanks and regards,
Carlo

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: ERROR:core:pv_parse_spec: bad parameters after upgrading to 1.5

Carlo Dimaggio

Il giorno 26/mar/09, alle ore 17:38, Carlo Dimaggio ha scritto:

> Hi Bogdan,
> I have 5 blocks in which I use the function is_user_in():
>          if (is_user_in("Credentials", "quota")) {
>          if (!is_user_in("Credentials", "ITALY_NATIONAL")) {
>          if (is_user_in("Credentials", "ITALY_NATIONAL")) {
>          if (is_user_in("Credentials", "ITALY_MOBILE")) {
>          if (is_user_in("Credentials", "INTERNATIONAL")) {
> In all functions I use "Credentials" as first parameter. Do you see
> something wrong?
> If I comment these lines I don't have errors...

Hi Bogdan,

I've added in group.c a line in order to print the User Filed  
Identifier. I see that when I have the errors the output is like this:

Mar 30 10:35:33 sip /sbin/opensips[14789]: ERROR:group:get_hf: DEBUG:  
User Field identifier = ###0^H#m^]^H^C

Mar 30 10:35:33 sip /sbin/opensips[14789]: ERROR:core:pv_parse_spec:  
bad parameters
Mar 30 10:35:33 sip /sbin/opensips[14789]: ERROR:group:get_hf:  
unsupported User Field identifier
Mar 30 10:35:33 sip /sbin/opensips[14789]: ERROR:group:is_user_in:  
unable to get user/dom source

When I have no errors, the output is:

Mar 30 10:35:29 sip /sbin/opensips[14789]: ERROR:group:get_hf: DEBUG:  
User Field identifier = Credentials


Is it possible that in my script there is a fault that changes the  
user field identifier of is_user_in()?


Thanks and regards,
Carlo Dimaggio



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: ERROR:core:pv_parse_spec: bad parameters after upgrading to 1.5

Bogdan-Andrei Iancu
Hi Carlo,

I found the bug...right now I'm testing the fix. I will shortly send you
a patch to test before backporting to 1.5.

Thanks and regards,
Bogdan

Carlo Dimaggio wrote:

> Il giorno 26/mar/09, alle ore 17:38, Carlo Dimaggio ha scritto:
>
>  
>> Hi Bogdan,
>> I have 5 blocks in which I use the function is_user_in():
>>          if (is_user_in("Credentials", "quota")) {
>>          if (!is_user_in("Credentials", "ITALY_NATIONAL")) {
>>          if (is_user_in("Credentials", "ITALY_NATIONAL")) {
>>          if (is_user_in("Credentials", "ITALY_MOBILE")) {
>>          if (is_user_in("Credentials", "INTERNATIONAL")) {
>> In all functions I use "Credentials" as first parameter. Do you see
>> something wrong?
>> If I comment these lines I don't have errors...
>>    
>
> Hi Bogdan,
>
> I've added in group.c a line in order to print the User Filed  
> Identifier. I see that when I have the errors the output is like this:
>
> Mar 30 10:35:33 sip /sbin/opensips[14789]: ERROR:group:get_hf: DEBUG:  
> User Field identifier = ###0^H#m^]^H^C
>
> Mar 30 10:35:33 sip /sbin/opensips[14789]: ERROR:core:pv_parse_spec:  
> bad parameters
> Mar 30 10:35:33 sip /sbin/opensips[14789]: ERROR:group:get_hf:  
> unsupported User Field identifier
> Mar 30 10:35:33 sip /sbin/opensips[14789]: ERROR:group:is_user_in:  
> unable to get user/dom source
>
> When I have no errors, the output is:
>
> Mar 30 10:35:29 sip /sbin/opensips[14789]: ERROR:group:get_hf: DEBUG:  
> User Field identifier = Credentials
>
>
> Is it possible that in my script there is a fault that changes the  
> user field identifier of is_user_in()?
>
>
> Thanks and regards,
> Carlo Dimaggio
>
>
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>  


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: ERROR:core:pv_parse_spec: bad parameters after upgrading to 1.5

Bogdan-Andrei Iancu
Please apply this patch, recompile the module and let me know if the
problem was solved.

Thanks and regards,
Bogdan

Bogdan-Andrei Iancu wrote:

> Hi Carlo,
>
> I found the bug...right now I'm testing the fix. I will shortly send
> you a patch to test before backporting to 1.5.
>
> Thanks and regards,
> Bogdan
>
> Carlo Dimaggio wrote:
>> Il giorno 26/mar/09, alle ore 17:38, Carlo Dimaggio ha scritto:
>>
>>  
>>> Hi Bogdan,
>>> I have 5 blocks in which I use the function is_user_in():
>>>          if (is_user_in("Credentials", "quota")) {
>>>          if (!is_user_in("Credentials", "ITALY_NATIONAL")) {
>>>          if (is_user_in("Credentials", "ITALY_NATIONAL")) {
>>>          if (is_user_in("Credentials", "ITALY_MOBILE")) {
>>>          if (is_user_in("Credentials", "INTERNATIONAL")) {
>>> In all functions I use "Credentials" as first parameter. Do you see
>>> something wrong?
>>> If I comment these lines I don't have errors...
>>>    
>>
>> Hi Bogdan,
>>
>> I've added in group.c a line in order to print the User Filed  
>> Identifier. I see that when I have the errors the output is like this:
>>
>> Mar 30 10:35:33 sip /sbin/opensips[14789]: ERROR:group:get_hf:
>> DEBUG:  User Field identifier = ###0^H#m^]^H^C
>>
>> Mar 30 10:35:33 sip /sbin/opensips[14789]: ERROR:core:pv_parse_spec:  
>> bad parameters
>> Mar 30 10:35:33 sip /sbin/opensips[14789]: ERROR:group:get_hf:  
>> unsupported User Field identifier
>> Mar 30 10:35:33 sip /sbin/opensips[14789]: ERROR:group:is_user_in:  
>> unable to get user/dom source
>>
>> When I have no errors, the output is:
>>
>> Mar 30 10:35:29 sip /sbin/opensips[14789]: ERROR:group:get_hf:
>> DEBUG:  User Field identifier = Credentials
>>
>>
>> Is it possible that in my script there is a fault that changes the  
>> user field identifier of is_user_in()?
>>
>>
>> Thanks and regards,
>> Carlo Dimaggio
>>
>>
>>
>> _______________________________________________
>> Users mailing list
>> [hidden email]
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>  
>
>

Index: modules/group/group.h
===================================================================
--- modules/group/group.h (revision 5560)
+++ modules/group/group.h (working copy)
@@ -46,8 +46,8 @@
 /*
  * extracts username and domain from MSG
  */
-int get_username_domain(struct sip_msg *msg, group_check_p gcp,
- str *username, str *domain);
+int get_username_domain(struct sip_msg *msg, str *hf_s,
+ str *username, str *domain);
 
 
 /*
Index: modules/group/re_group.c
===================================================================
--- modules/group/re_group.c (revision 5560)
+++ modules/group/re_group.c (working copy)
@@ -27,6 +27,7 @@
 #include <sys/types.h>
 #include <regex.h>
 
+#include "../../mod_fix.h"
 #include "../../str.h"
 #include "../../mem/mem.h"
 #include "../../route_struct.h"
@@ -131,6 +132,7 @@
 int get_user_group(struct sip_msg *req, char *user, char *avp)
 {
  static char uri_buf[MAX_URI_SIZE];
+ str user_str;
  str  username;
  str  domain;
  pv_spec_t *pvs;
@@ -140,7 +142,12 @@
  char *c;
  int n;
 
- if (get_username_domain( req, (group_check_p)user, &username, &domain)!=0){
+ if(user ==  NULL || fixup_get_svalue(req, (gparam_p)user, &user_str) != 0){
+ LM_ERR("Invalid parameter URI\n");
+ return -1;
+ }
+
+ if (get_username_domain( req, &user_str, &username, &domain)!=0){
  LM_ERR("failed to get username@domain\n");
  goto error;
  }
Index: modules/group/group_mod.c
===================================================================
--- modules/group/group_mod.c (revision 5560)
+++ modules/group/group_mod.c (working copy)
@@ -230,13 +230,10 @@
 static int get_gid_fixup(void** param, int param_no)
 {
  pv_spec_t *sp;
- void *ptr;
  str  name;
 
  if (param_no == 1) {
- ptr = *param;
- if ( (*param = (void*)get_hf( ptr ))==0 )
- return E_UNSPEC;
+ return fixup_spve_spve(param, param_no);
  } else if (param_no == 2) {
  name.s = (char*)*param;
  name.len = strlen(name.s);
Index: modules/group/group.c
===================================================================
--- modules/group/group.c (revision 5560)
+++ modules/group/group.c (working copy)
@@ -43,20 +43,19 @@
 #include "group.h"
 #include "group_mod.h"                   /* Module parameters */
 
-static group_check_p get_hf( char *str1);
+static unsigned int hf_type( str *str1);
 
-int get_username_domain(struct sip_msg *msg, group_check_p gcp,
+int get_username_domain(struct sip_msg *msg, str *hf_s,
  str *username, str *domain)
 {
  struct sip_uri puri;
  struct sip_uri *turi;
  struct hdr_field* h;
  struct auth_body* c = 0; /* Makes gcc happy */
- pv_value_t value;
 
  turi = NULL;
 
- switch(gcp->id) {
+ switch( hf_type(hf_s) ) {
  case 1: /* Request-URI */
  if(parse_sip_msg_uri(msg)<0) {
  LM_ERR("failed to get Request-URI\n");
@@ -92,22 +91,16 @@
  c = (auth_body_t*)(h->parsed);
  break;
 
- case 5: /* AVP spec */
- if(pv_get_spec_value( msg, &gcp->sp, &value)!=0
- || value.flags&PV_VAL_NULL || value.rs.len<=0)
- {
- LM_ERR("no AVP found (error in scripts)\n");
+ default: /* string */
+ if (parse_uri(hf_s->s, hf_s->len, &puri) < 0) {
+ LM_ERR("failed to parse URI <%.*s>\n",hf_s->len, hf_s->s);
  return -1;
  }
- if (parse_uri(value.rs.s, value.rs.len, &puri) < 0) {
- LM_ERR("failed to parse URI <%.*s>\n",value.rs.len, value.rs.s);
- return -1;
- }
  turi = &puri;
  break;
  }
 
- if (gcp->id != 4) {
+ if ( c==NULL ) {
  *username = turi->user;
  *domain = turi->host;
  } else {
@@ -148,13 +141,7 @@
  return -1;
  }
 
- group_check_p hfPtr = get_hf(hf_s.s);
- if (hfPtr==NULL) {
- LM_ERR("unable to get user/dom source\n");
- return -1;
- }
-
- if ( get_username_domain( _msg, hfPtr, &(VAL_STR(vals)),
+ if ( get_username_domain( _msg, &hf_s, &(VAL_STR(vals)),
  &(VAL_STR(vals+2)))!=0) {
  LM_ERR("failed to get username@domain\n");
  return -1;
@@ -235,46 +222,20 @@
 }
 
 /*
- *  * Convert HF description string to hdr_field pointer
- *  *                                                  
- *  * Supported strings:                                
  *  * "Request-URI", "To", "From", "Credentials"        
- *  * It is a copy from get_hf at group_mod.c    
 */
-static group_check_p get_hf( char *str1)
+static unsigned int hf_type( str *str1)
 {
- group_check_p gcp=NULL;
- str s;
-
- gcp = (group_check_p)pkg_malloc(sizeof(group_check_t));
- if(gcp == NULL) {
- LM_ERR("no pkg more memory\n");
- return NULL;
- }
- memset(gcp, 0, sizeof(group_check_t));
-
- if (!strcasecmp( str1, "Request-URI")) {
- gcp->id = 1;
- } else if (!strcasecmp( str1, "To")) {
- gcp->id = 2;
- } else if (!strcasecmp( str1, "From")) {
- gcp->id = 3;
- } else if (!strcasecmp( str1, "Credentials")) {
- gcp->id = 4;
+ if (str1->len==11 && !strncasecmp( str1->s, "Request-URI",11)) {
+ return 1;
+ } else if (str1->len==2 && !strncasecmp( str1->s, "To", 2)) {
+ return 2;
+ } else if (str1->len==4 && !strncasecmp( str1->s, "From", 4)) {
+ return 3;
+ } else if (str1->len==11 && !strncasecmp( str1->s, "Credentials",11)) {
+ return 4;
  } else {
- s.s = str1; s.len = strlen(s.s);
- if(pv_parse_spec( &s, &gcp->sp)==NULL || gcp->sp.type!=PVT_AVP)
- {
- LM_ERR("unsupported User Field identifier\n");
- pkg_free( gcp );
- return NULL;
- }
- gcp->id = 5;
+ return 0;
  }
 
- /* do not free all the time, needed by pseudo-variable spec */
- if(gcp->id!=5)
- pkg_free(str1);
-
- return gcp;
 }

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: ERROR:core:pv_parse_spec: bad parameters after upgrading to 1.5

Carlo Dimaggio

Il giorno 31/mar/09, alle ore 16:23, Bogdan-Andrei Iancu ha scritto:

> Please apply this patch, recompile the module and let me know if the  
> problem was solved.

Hi Bogdan,

I have applied this patch and now all works fine!!! I have tested it  
with different calls and I haven't seen any errors.
Many thanks for your quick patch!


Best regards,
Carlo Dimaggio


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: ERROR:core:pv_parse_spec: bad parameters after upgrading to 1.5

Bogdan-Andrei Iancu
Hi Carlo,

Perfect - I will officially include the patch in 1.5.

Thanks and best regards,
Bogdan

Carlo Dimaggio wrote:

>
> Il giorno 31/mar/09, alle ore 16:23, Bogdan-Andrei Iancu ha scritto:
>
>> Please apply this patch, recompile the module and let me know if the
>> problem was solved.
>
> Hi Bogdan,
>
> I have applied this patch and now all works fine!!! I have tested it
> with different calls and I haven't seen any errors.
> Many thanks for your quick patch!
>
>
> Best regards,
> Carlo Dimaggio
>
>


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users