Re: [OpenSIPS-Users] Migrating form 1.11.5 to 1.11.9

2016-11-09 Thread Alain Bieuzent
Hi Răzvan, 

 

I will test that, many thanks

 

Regards

 

De : <users-boun...@lists.opensips.org> au nom de Răzvan Crainea 
<raz...@opensips.org>
Répondre à : OpenSIPS users mailling list <users@lists.opensips.org>
Date : mercredi 9 novembre 2016 à 16:39
À : <users@lists.opensips.org>
Objet : Re: [OpenSIPS-Users] Migrating form 1.11.5 to 1.11.9

 

Hi, Alain!

Somewhere between 1.11.5 and 1.11.9 we figured out a problem related to mysql 
queries: if your database entry is NULL, we can't just simply set a NULL value 
to an AVP, because that just deletes the previous value. So you end up in a 
very inconsistent state. That's why we decided to set the value "" to all 
the fields that are NULL in the database (this token is used in serveral other 
scenarios, that's why we picked this name).

Therefore, in order to properly test if a column is provisioned NULL in the 
database is:
if ($avp(redirect) != "") {
}

Let us know how this goes.

Best regards,

Răzvan Crainea
OpenSIPS Solutions
www.opensips-solutions.com
On 11/09/2016 05:06 PM, Alain Bieuzent wrote:

Hi All,

 

I’m trying to migrate form 1.11.5 to 1.11.9 and i have a problem to test the 
value of a mysql query when the reseult is null.

 

In 1.11.5 this test « if (!$avp(redirect) == NULL) » works, but doesn’t work in 
1.11.9.

 

Is there a change in code ?

What is the corect way to test a null value from avp ?

 

Regards

 

Alain.




___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

___ Users mailing list 
Users@lists.opensips.org 
http://lists.opensips.org/cgi-bin/mailman/listinfo/users 

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Migrating form 1.11.5 to 1.11.9

2016-11-09 Thread Răzvan Crainea

Hi, Alain!

Somewhere between 1.11.5 and 1.11.9 we figured out a problem related to 
mysql queries: if your database entry is NULL, we can't just simply set 
a NULL value to an AVP, because that just deletes the previous value. So 
you end up in a very inconsistent state. That's why we decided to set 
the value "" to all the fields that are NULL in the database (this 
token is used in serveral other scenarios, that's why we picked this name).


Therefore, in order to properly test if a column is provisioned NULL in 
the database is:

if ($avp(redirect) != "") {
}

Let us know how this goes.

Best regards,

Răzvan Crainea
OpenSIPS Solutions
www.opensips-solutions.com

On 11/09/2016 05:06 PM, Alain Bieuzent wrote:


Hi All,

I’m trying to migrate form 1.11.5 to 1.11.9 and i have a problem to 
test the value of a mysql query when the reseult is null.


In 1.11.5 this test « if (!$avp(redirect) == NULL) » works, but 
doesn’t work in 1.11.9.


Is there a change in code ?

What is the corect way to test a null value from avp ?

Regards

Alain.



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Migrating form 1.11.5 to 1.11.9

2016-11-09 Thread Bogdan-Andrei Iancu

Hi Alain,

yes, it was a fix in avp_db_query() - if you query for multiple columns 
in a row, and if one of these columns returns NULL, it will not be 
reported as empty AVP , but as an AVP holding "" value :

https://github.com/OpenSIPS/opensips/commit/e1257269bcc30df56dd9b6bc90a243c5839d5922

Is was a must to properly handle multi row results with multiple columns.

Best regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com

On 09.11.2016 17:06, Alain Bieuzent wrote:


Hi All,

I’m trying to migrate form 1.11.5 to 1.11.9 and i have a problem to 
test the value of a mysql query when the reseult is null.


In 1.11.5 this test « if (!$avp(redirect) == NULL) » works, but 
doesn’t work in 1.11.9.


Is there a change in code ?

What is the corect way to test a null value from avp ?

Regards

Alain.



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] Migrating form 1.11.5 to 1.11.9

2016-11-09 Thread Alain Bieuzent
Hi All,

 

I’m trying to migrate form 1.11.5 to 1.11.9 and i have a problem to test the 
value of a mysql query when the reseult is null.

 

In 1.11.5 this test « if (!$avp(redirect) == NULL) » works, but doesn’t work in 
1.11.9.

 

Is there a change in code ?

What is the corect way to test a null value from avp ?

 

Regards

 

Alain.

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users