Re: [OpenSIPS-Users] opensips wss support

2015-11-03 Thread Răzvan Crainea

Hi, Tito!

Yes, we have WSS support on top of our priorities, and most likely will 
be released with the next OpenSIPS 2.2.


Best regards,

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

On 10/16/2015 01:41 AM, Tito Cumpen wrote:

To opensips devs.


Are there any plans to support wss? Currently chrome will not allow 
for an unsecure websocket to be initiated when using https. They also 
threaten to remove getusermedia when using ws.


https://sites.google.com/a/chromium.org/dev/Home/chromium-security/deprecating-powerful-features-on-insecure-origins

Please advise. I am working on a project that depends on this.

Thanks,
Tito


___
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] Try to setup ENUM NRENUM support...

2015-11-03 Thread Michele Pinassi
Hi all,

i'm trying to setup enum (NRENUM) infrastructure for our university. We
have a public IP voip server, VOIP01, with a private network for voip
phones (172.20.x.x). To let RTP flow through the private and public
network, i set up a RTP Proxy:

/onreply_route[enum_answer] {//
//if(has_body("application/sdp")) {//
//rtpproxy_answer();//
//}//
//}//
//
//onreply_route[enum_offer] {//
//if(has_body("application/sdp")) {//
//rtpproxy_offer();//
//}//
//}//
//
//route[enum] {//
//xlog("L_INFO","Route to ENUM [$fd/$fu/$rd/$ru/$si/]\n");//
//   //
//if (is_method("INVITE")) {//
//if(has_body("application/sdp")) {//
//if (rtpproxy_offer()) {//
//t_on_reply("enum_answer");//
//}//
//} else {//
//t_on_reply("enum_offer");//
//}//
//}//
//if (is_method("ACK") && has_body("application/sdp")) {//
//rtpproxy_answer();//
//}//
////
//t_on_failure("pstn");//
//
//if(!t_relay()) {//
//sl_reply_error();//
//}//
//exit;//
//}/


but on establishing call, this is the tcpdump trace between VOIP01 and
VOIP02 i get this:

/IP VOIP01.5060 > VOIP02.5060: UDP, length 1170//
//
//INVITE sip:86472@VOIP02 SIP/2.0//
//Record-Route: //
//Via: SIP/2.0/UDP VOIP01:5060;branch=z9hG4bKe567.edebdee3.0//
//Via: SIP/2.0/UDP
172.20.1.47:57907;received=172.20.1.47;branch=z9hG4bK-7l3vckv00z2m;rport=57907//
//From: "Michele Pinassi" ;tag=gujliebxxu//
//To: //
//Call-ID: 313434363534333236353330393830-j09a5i32z5kd//
//CSeq: 2 INVITE//
//Max-Forwards: 69//
//User-Agent: snom760/8.7.5.17//
//Contact: ;reg-id=1//
//X-Serialnumber: 00041371928A//
//P-Key-Flags: resolution="31x13", keys="4"//
//Accept: application/sdp//
//Allow: INVITE, ACK, CANCEL, BYE, REFER, OPTIONS, NOTIFY, SUBSCRIBE,
PRACK, MESSAGE, INFO, UPDATE//
//Allow-Events: talk, hold, refer, call-info//
//Supported: timer, 100rel, replaces, from-change//
//Session-Expires: 3600//
//Min-SE: 90//
//Content-Type: application/sdp//
//Content-Length: 228//
//
//v=0//
//o=root 846474428 846474428 IN IP4 172.20.1.47//
//s=call//
//c=IN IP4 VOIP01//
//t=0 0//
//m=audio 63194 RTP/AVP 9 0 8//
//a=rtpmap:9 G722/8000//
//a=rtpmap:0 PCMU/8000//
//a=rtpmap:8 PCMA/8000//
//a=ptime:20//
//a=sendrecv//
//a=nortpproxy:yes//
//
//IP VOIP02.5060 > VOIP01.5060: UDP, length 722//
//
//SIP/2.0 100 Trying//
//Via: SIP/2.0/UDP
VOIP01:5060;branch=z9hG4bKe567.edebdee3.0;received=VOIP01;rport=5060//
//Via: SIP/2.0/UDP
172.20.1.47:57907;received=172.20.1.47;branch=z9hG4bK-7l3vckv00z2m;rport=57907//
//Record-Route: //
//From: "Michele Pinassi" ;tag=gujliebxxu//
//To: //
//Call-ID: 313434363534333236353330393830-j09a5i32z5kd//
//CSeq: 2 INVITE//
//Server: FPBX-2.11.0(11.7.0)//
//Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY,
INFO, PUBLISH//
//Supported: replaces, timer//
//Session-Expires: 1800;refresher=uas//
//Contact: //
//Content-Length: 0//
//
//
//IP VOIP02.5060 > VOIP01.5060: UDP, length 590//
//
//SIP/2.0 603 Declined//
//Via: SIP/2.0/UDP
VOIP01:5060;branch=z9hG4bKe567.edebdee3.0;received=VOIP01;rport=5060//
//Via: SIP/2.0/UDP
172.20.1.47:57907;received=172.20.1.47;branch=z9hG4bK-7l3vckv00z2m;rport=57907//
//From: "Michele Pinassi" ;tag=gujliebxxu//
//To: ;tag=as15312d47//
//Call-ID: 313434363534333236353330393830-j09a5i32z5kd//
//CSeq: 2 INVITE//
//Server: FPBX-2.11.0(11.7.0)//
//Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY,
INFO, PUBLISH//
//Supported: replaces, timer//
//Content-Length: 0//
//
//
//IP VOIP01.5060 > VOIP02.5060: UDP, length 375//
//
//ACK sip:86472@VOIP02 SIP/2.0//
//Via: SIP/2.0/UDP VOIP01:5060;branch=z9hG4bKe567.edebdee3.0//
//From: "Michele Pinassi" ;tag=gujliebxxu//
//Call-ID: 313434363534333236353330393830-j09a5i32z5kd//
//To: ;tag=as15312d47//
//CSeq: 2 ACK//
//Max-Forwards: 70//
//User-Agent: VoIP Unisi.it//
//Content-Length: 0/

The main doubt is: /a=nortpproxy:yes/ ...why ?

Thanks, Michele



-- 
Michele Pinassi
Responsabile Telefonia di Ateneo
Servizio Reti, Sistemi e Sicurezza Informatica - Università degli Studi di Siena
tel: 0577.(23)5000 - central...@unisi.it

Per trovare una soluzione rapida ai tuoi problemi tecnici consulta le FAQ di 
Ateneo, http://www.faq.unisi.it 

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


[OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?

2015-11-03 Thread Rodrigo Pimenta Carvalho
Dear OpenSIPS-users,


In the OpenSIPS database I have created some new tables, for my project. I can 
read from such tables successfully.  For example, the instruction


 avp_db_query("select Value from GeneralConfigurations where Attribute = 
'CallMaxDuration'", "$avp(CallMaxDuration)");


run and works very well. It put the right value in the apv!


However, when the following instruction is executed, it doesn't take any effect 
in the database:


 avp_db_query("update GeneralConfigurations set Value = 'yes' where Attribute = 
'Exists_Intercom_Call'", "$avp(UpdateResult)");


The log says:

---


Nov  3 11:32:52 [29114] DBG:avpops:ops_dbquery_avps: query [update 
GeneralConfigurations set Value = 'yes' where Attribute = 
'Exists_Intercom_Call']
Nov  3 11:32:52 [29114] DBG:avpops:db_query_avp: no result after query
Nov  3 11:32:52 [29114] DBG:avpops:db_close_query: close avp query
Nov  3 11:32:52 [29114] ERROR:db_sqlite:db_sqlite_free_result: invalid 
parameter value


--


But the query UPDATE is correct, because I have already tested it directly in 
the database.


So, am I doing something wrong? What exactly does mean that error "invalid 
parameter value" in this case? Can I use UPDATE in an avp_db_query?


Any hint will be very helpful!


Best regards.








RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph: +55 35 3471 9200 RAMAL 979
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] Opensips crash!!!!!!

2015-11-03 Thread Dragomir Haralambiev
Hello all,

I am upgrading opensips from v1.11 to v2.1.1.

I am having following wearings continuously after first call:

Oct 30 14:52:11 sbc  [32140]: WARNING:core:utimer_ticker: utimer task
 already schedualed for 1548180 ms (now 1548280 ms), it may
overlap..
Oct 30 14:52:11 sbc  [32140]: WARNING:core:utimer_ticker: utimer task
 already schedualed for 1548280 ms (now 1548380 ms), it may
overlap..
Oct 30 14:52:11 sbc  [32140]: WARNING:core:timer_ticker: timer task
 already schedualed for 1545910 ms (now 1548380 ms), it may
overlap..
Oct 30 14:52:11 sbc  [32140]: WARNING:core:timer_ticker: timer task
 already schedualed for 1545910 ms (now 1548380 ms), it may
overlap..
Oct 30 14:52:11 sbc  [32140]: WARNING:core:timer_ticker: timer task
 already schedualed for 1545910 ms (now 1548380 ms), it may
overlap..
Oct 30 14:52:11 sbc  [32140]: WARNING:core:timer_ticker: timer task
 already schedualed for 1545910 ms (now 1548380 ms), it may
overlap..
Oct 30 14:52:11 sbc  [32140]: WARNING:core:utimer_ticker: utimer task
 already schedualed for 1548380 ms (now 1548480 ms), it may
overlap..
Oct 30 14:52:11 sbc  [32140]: WARNING:core:utimer_ticker: utimer task
 already schedualed for 1548480 ms (now 1548580 ms), it may
overlap..


Where is problem?

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


Re: [OpenSIPS-Users] Opensips crash!!!!!!

2015-11-03 Thread Arsen
Hey Dragomir,

Do you use radius in your setup?
I had exactly same issue when i was trying to send radius acct request.

You can check this issue here in the list "opensips 2.1 custom radius
accounting error"

Regards,
Arsen

On Tuesday, 3 November 2015, Dragomir Haralambiev 
wrote:

> Hello all,
>
> I am upgrading opensips from v1.11 to v2.1.1.
>
> I am having following wearings continuously after first call:
>
> Oct 30 14:52:11 sbc  [32140]: WARNING:core:utimer_ticker: utimer task
>  already schedualed for 1548180 ms (now 1548280 ms), it may
> overlap..
> Oct 30 14:52:11 sbc  [32140]: WARNING:core:utimer_ticker: utimer task
>  already schedualed for 1548280 ms (now 1548380 ms), it may
> overlap..
> Oct 30 14:52:11 sbc  [32140]: WARNING:core:timer_ticker: timer task
>  already schedualed for 1545910 ms (now 1548380 ms), it may
> overlap..
> Oct 30 14:52:11 sbc  [32140]: WARNING:core:timer_ticker: timer task
>  already schedualed for 1545910 ms (now 1548380 ms), it may
> overlap..
> Oct 30 14:52:11 sbc  [32140]: WARNING:core:timer_ticker: timer task
>  already schedualed for 1545910 ms (now 1548380 ms), it may
> overlap..
> Oct 30 14:52:11 sbc  [32140]: WARNING:core:timer_ticker: timer task
>  already schedualed for 1545910 ms (now 1548380 ms), it may
> overlap..
> Oct 30 14:52:11 sbc  [32140]: WARNING:core:utimer_ticker: utimer task
>  already schedualed for 1548380 ms (now 1548480 ms), it may
> overlap..
> Oct 30 14:52:11 sbc  [32140]: WARNING:core:utimer_ticker: utimer task
>  already schedualed for 1548480 ms (now 1548580 ms), it may
> overlap..
>
>
> Where is problem?
>
> Regards,
> PlayMen
>


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


Re: [OpenSIPS-Users] Opensips crash!!!!!!

2015-11-03 Thread Dragomir Haralambiev
Hi,

Thanks for your replay.

Yes I use radius.

Radius not possible use from latest STABLE version?
Realy?

Regards,


2015-11-03 16:59 GMT+02:00 Arsen :

> Hey Dragomir,
>
> Do you use radius in your setup?
> I had exactly same issue when i was trying to send radius acct request.
>
> You can check this issue here in the list "opensips 2.1 custom radius
> accounting error"
>
> Regards,
> Arsen
>
>
> On Tuesday, 3 November 2015, Dragomir Haralambiev 
> wrote:
>
>> Hello all,
>>
>> I am upgrading opensips from v1.11 to v2.1.1.
>>
>> I am having following wearings continuously after first call:
>>
>> Oct 30 14:52:11 sbc  [32140]: WARNING:core:utimer_ticker: utimer task
>>  already schedualed for 1548180 ms (now 1548280 ms), it may
>> overlap..
>> Oct 30 14:52:11 sbc  [32140]: WARNING:core:utimer_ticker: utimer task
>>  already schedualed for 1548280 ms (now 1548380 ms), it may
>> overlap..
>> Oct 30 14:52:11 sbc  [32140]: WARNING:core:timer_ticker: timer task
>>  already schedualed for 1545910 ms (now 1548380 ms), it may
>> overlap..
>> Oct 30 14:52:11 sbc  [32140]: WARNING:core:timer_ticker: timer task
>>  already schedualed for 1545910 ms (now 1548380 ms), it may
>> overlap..
>> Oct 30 14:52:11 sbc  [32140]: WARNING:core:timer_ticker: timer task
>>  already schedualed for 1545910 ms (now 1548380 ms), it may
>> overlap..
>> Oct 30 14:52:11 sbc  [32140]: WARNING:core:timer_ticker: timer task
>>  already schedualed for 1545910 ms (now 1548380 ms), it may
>> overlap..
>> Oct 30 14:52:11 sbc  [32140]: WARNING:core:utimer_ticker: utimer task
>>  already schedualed for 1548380 ms (now 1548480 ms), it may
>> overlap..
>> Oct 30 14:52:11 sbc  [32140]: WARNING:core:utimer_ticker: utimer task
>>  already schedualed for 1548480 ms (now 1548580 ms), it may
>> overlap..
>>
>>
>> Where is problem?
>>
>> Regards,
>> PlayMen
>>
>
>
> --
> Regards,
> Arsen.
>
>
> ___
> 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] CRITICAL

2015-11-03 Thread Ionut Ionita

Hi,

If you look into the documentation[1], the comma is not optional. So you 
should call something like:

if (!is_contact_registered("location","$fu",,)) {


Regards,
Ionut Ionita

[1] http://www.opensips.org/html/docs/modules/2.2.x/registrar.html#id294862
On 02.11.2015 21:58, Dragomir Haralambiev wrote:

Hello,

I try to test latest version: opensips 2.2-dev.

When use:
if (!registered("location","$fu")) {

I receive follow message:
WARNING:registrar:registered: Deprecated! Use is_contact_registered() 
instead!


when use:
if (!is_contact_registered("location","$fu")) {
.

I receive :
CRITICAL:core:yyerror: parse error in config file /opensips.cfg, 
unknown command , missing loadmodule?


Regards,


___
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] OpenSIPS 2.1 - Record-Routing back to itself

2015-11-03 Thread Damien Sandras
Good evening,

I have a strange problem. I am experimenting with 2 OpenSIPS 2.1
instances : one listening on port 5060 and one on port 5050.

An external UA is SUBSCRIBING for presence, and the SUBSCRIBE is routed
from OpenSIPS:5060 to OpenSIPS:5050 to elsewhere. When a NOTIFY is
generated, it is supposed to be routed back to OpenSIPS:5050 then to
OpenSIPS:5060 then to the original UA.

On OpenSIPS:5050, logging gives me that :
Nov  3 15:08:40 golgoth05 opensips[23153]: RELAY: Relaying NOTIFY
(From: 752) to sip:754@172.26.0.46:5060;transport=tcp via
sip:172.30.3.83;transport=tcp;lr;ftag=68ca1f0d-a280-e511-8e2c-
78843c3891dd;router=yes 

=> via sip:172.30.3.83;... is the OpenSIPS running on port 5060. It is
a direct output of $du. So, $du points to the correct destination.

Nov  3 15:08:40 golgoth05 opensips[23153]: IN_DIALOG: Received NOTIFY
(752 -> 754) from 172.30.3.83:5050 (using record routing)

=> that's the same NOTIFY. OpenSIPS:5050 routed the NOTIFY to itself,
and did not route it to $du

What could cause this ?

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


[OpenSIPS-Users] Avp_db_query is not working with 'UPDATE' or 'DELETE" on SQLITE. Why?

2015-11-03 Thread Rodrigo Pimenta Carvalho
Hi.


I'm using OpenSIPS 2.2 and SQLite 3, on Ubuntu 14.04 LTI.


To run SQL queries, I'm using avp_db_query. After some tests I have concluded 
that 'Select' works well. However, 'Update' or 'Delete' is not working. It 
seems like some bug related to SQLite or OpenSIPS.  'Update' does take effect, 
neither 'Delete'.


Does someone here have already run a Update or Delete sql query with success, 
on SQLite 3, by means of avp_db_query? If yes, could I see a code example, 
please?


Any hint will be very helpful!


Best regards.




RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph: +55 35 3471 9200 RAMAL 979
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?

2015-11-03 Thread Podrigal, Aron
Try removing the second argument *"$avp(CallMaxDuration)"* from
avp_db_query() Because the database backend does not return any results.

On Tue, Nov 3, 2015 at 8:50 AM, Rodrigo Pimenta Carvalho 
wrote:

> Dear OpenSIPS-users,
>
>
> In the OpenSIPS database I have created some new tables, for my project. I
> can read from such tables successfully.  For example, the instruction
>
>
>  *avp_db_query("select Value from GeneralConfigurations where Attribute =
> 'CallMaxDuration'", "$avp(CallMaxDuration)");*
>
>
> run and works very well. It put the right value in the apv!
>
>
> However, when the following instruction is executed, it doesn't take any
> effect in the database:
>
>
> * avp_db_query("update GeneralConfigurations set Value = 'yes' where
> Attribute = 'Exists_Intercom_Call'", "$avp(UpdateResult)");*
>
>
> The log says:
>
>
> ---
>
>
> Nov  3 11:32:52 [29114] DBG:avpops:ops_dbquery_avps: query [update
> GeneralConfigurations set Value = 'yes' where Attribute =
> 'Exists_Intercom_Call']
> Nov  3 11:32:52 [29114] DBG:avpops:db_query_avp: no result after query
> Nov  3 11:32:52 [29114] DBG:avpops:db_close_query: close avp query
> Nov  3 11:32:52 [29114] ERROR:db_sqlite:db_sqlite_free_result: invalid
> parameter value
>
>
>
> --
>
>
> But the query UPDATE is correct, because I have already tested it directly
> in the database.
>
>
> So, am I doing something wrong? What exactly does mean that error "invalid
> parameter value" in this case? Can I use UPDATE in an avp_db_query?
>
>
> Any hint will be very helpful!
>
>
> Best regards.
>
>
>
>
>
>
>
>
> RODRIGO PIMENTA CARVALHO
> Inatel Competence Center
> Software
> Ph: +55 35 3471 9200 RAMAL 979
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>


-- 
Aron Podrigal
-
'101', '1110010', '110', '1101110'   '101', '110',
'1100100', '1110010', '1101001', '1100111', '111', '1101100'

P: '2b', '31', '33', '34', '37', '34', '35', '38', '36', '30', '39', '39'
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?

2015-11-03 Thread Rodrigo Pimenta Carvalho
Hi.


Yes. I have tried it too. Thanks.


But it is not the cause of the problem. In my newest message, I said that 
'Update' or 'Delete' is not working. Just 'Select' works well. Can you suspect 
about some issue?


Best regards.


RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph: +55 35 3471 9200 RAMAL 979



De: users-boun...@lists.opensips.org  em nome 
de Podrigal, Aron 
Enviado: terça-feira, 3 de novembro de 2015 15:26
Para: OpenSIPS users mailling list
Assunto: Re: [OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?

Try removing the second argument "$avp(CallMaxDuration)" from avp_db_query() 
Because the database backend does not return any results.

On Tue, Nov 3, 2015 at 8:50 AM, Rodrigo Pimenta Carvalho 
mailto:pime...@inatel.br>> wrote:

Dear OpenSIPS-users,


In the OpenSIPS database I have created some new tables, for my project. I can 
read from such tables successfully.  For example, the instruction


 avp_db_query("select Value from GeneralConfigurations where Attribute = 
'CallMaxDuration'", "$avp(CallMaxDuration)");


run and works very well. It put the right value in the apv!


However, when the following instruction is executed, it doesn't take any effect 
in the database:


 avp_db_query("update GeneralConfigurations set Value = 'yes' where Attribute = 
'Exists_Intercom_Call'", "$avp(UpdateResult)");


The log says:

---


Nov  3 11:32:52 [29114] DBG:avpops:ops_dbquery_avps: query [update 
GeneralConfigurations set Value = 'yes' where Attribute = 
'Exists_Intercom_Call']
Nov  3 11:32:52 [29114] DBG:avpops:db_query_avp: no result after query
Nov  3 11:32:52 [29114] DBG:avpops:db_close_query: close avp query
Nov  3 11:32:52 [29114] ERROR:db_sqlite:db_sqlite_free_result: invalid 
parameter value


--


But the query UPDATE is correct, because I have already tested it directly in 
the database.


So, am I doing something wrong? What exactly does mean that error "invalid 
parameter value" in this case? Can I use UPDATE in an avp_db_query?


Any hint will be very helpful!


Best regards.








RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph: +55 35 3471 9200 RAMAL 979

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




--
Aron Podrigal
-
'101', '1110010', '110', '1101110'   '101', '110', '1100100', 
'1110010', '1101001', '1100111', '111', '1101100'

P: '2b', '31', '33', '34', '37', '34', '35', '38', '36', '30', '39', '39'

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


Re: [OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?

2015-11-03 Thread Rodrigo Pimenta Carvalho
Hi Aron.


Do you know whether it is necessary to commit the modifications made by 
avp_db_query("Update") ?

Is there some kind of ' commit' command to be executed in the OpenSIPS script?


Any hint will be very helpful!


Thanks a lot.


RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph: +55 35 3471 9200 RAMAL 979



De: users-boun...@lists.opensips.org  em nome 
de Podrigal, Aron 
Enviado: terça-feira, 3 de novembro de 2015 15:26
Para: OpenSIPS users mailling list
Assunto: Re: [OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?

Try removing the second argument "$avp(CallMaxDuration)" from avp_db_query() 
Because the database backend does not return any results.

On Tue, Nov 3, 2015 at 8:50 AM, Rodrigo Pimenta Carvalho 
mailto:pime...@inatel.br>> wrote:

Dear OpenSIPS-users,


In the OpenSIPS database I have created some new tables, for my project. I can 
read from such tables successfully.  For example, the instruction


 avp_db_query("select Value from GeneralConfigurations where Attribute = 
'CallMaxDuration'", "$avp(CallMaxDuration)");


run and works very well. It put the right value in the apv!


However, when the following instruction is executed, it doesn't take any effect 
in the database:


 avp_db_query("update GeneralConfigurations set Value = 'yes' where Attribute = 
'Exists_Intercom_Call'", "$avp(UpdateResult)");


The log says:

---


Nov  3 11:32:52 [29114] DBG:avpops:ops_dbquery_avps: query [update 
GeneralConfigurations set Value = 'yes' where Attribute = 
'Exists_Intercom_Call']
Nov  3 11:32:52 [29114] DBG:avpops:db_query_avp: no result after query
Nov  3 11:32:52 [29114] DBG:avpops:db_close_query: close avp query
Nov  3 11:32:52 [29114] ERROR:db_sqlite:db_sqlite_free_result: invalid 
parameter value


--


But the query UPDATE is correct, because I have already tested it directly in 
the database.


So, am I doing something wrong? What exactly does mean that error "invalid 
parameter value" in this case? Can I use UPDATE in an avp_db_query?


Any hint will be very helpful!


Best regards.








RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph: +55 35 3471 9200 RAMAL 979

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




--
Aron Podrigal
-
'101', '1110010', '110', '1101110'   '101', '110', '1100100', 
'1110010', '1101001', '1100111', '111', '1101100'

P: '2b', '31', '33', '34', '37', '34', '35', '38', '36', '30', '39', '39'

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


Re: [OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?

2015-11-03 Thread Patrick Wakano
I think Opensips lexer is converting your 'yes' to the integer 1 when
running the SQL query in your DB.
See this thread:
http://lists.opensips.org/pipermail/users/2015-February/030946.html

Try to use something different from 'yes' to see what happens.

Patrick


On Tue, Nov 3, 2015 at 3:50 PM, Rodrigo Pimenta Carvalho 
wrote:

> Hi Aron.
>
>
> Do you know whether it is necessary to commit the modifications made by
> avp_db_query("Update") ?
>
> Is there some kind of ' commit' command to be executed in the OpenSIPS
> script?
>
>
> Any hint will be very helpful!
>
>
> Thanks a lot.
>
>
> RODRIGO PIMENTA CARVALHO
> Inatel Competence Center
> Software
> Ph: +55 35 3471 9200 RAMAL 979
>
>
> --
> *De:* users-boun...@lists.opensips.org 
> em nome de Podrigal, Aron 
> *Enviado:* terça-feira, 3 de novembro de 2015 15:26
> *Para:* OpenSIPS users mailling list
> *Assunto:* Re: [OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?
>
> Try removing the second argument *"$avp(CallMaxDuration)"* from
> avp_db_query() Because the database backend does not return any results.
>
> On Tue, Nov 3, 2015 at 8:50 AM, Rodrigo Pimenta Carvalho <
> pime...@inatel.br> wrote:
>
>> Dear OpenSIPS-users,
>>
>>
>> In the OpenSIPS database I have created some new tables, for my project.
>> I can read from such tables successfully.  For example, the instruction
>>
>>
>>  *avp_db_query("select Value from GeneralConfigurations where Attribute
>> = 'CallMaxDuration'", "$avp(CallMaxDuration)");*
>>
>>
>> run and works very well. It put the right value in the apv!
>>
>>
>> However, when the following instruction is executed, it doesn't take any
>> effect in the database:
>>
>>
>> * avp_db_query("update GeneralConfigurations set Value = 'yes' where
>> Attribute = 'Exists_Intercom_Call'", "$avp(UpdateResult)");*
>>
>>
>> The log says:
>>
>>
>> ---
>>
>>
>> Nov  3 11:32:52 [29114] DBG:avpops:ops_dbquery_avps: query [update
>> GeneralConfigurations set Value = 'yes' where Attribute =
>> 'Exists_Intercom_Call']
>> Nov  3 11:32:52 [29114] DBG:avpops:db_query_avp: no result after query
>> Nov  3 11:32:52 [29114] DBG:avpops:db_close_query: close avp query
>> Nov  3 11:32:52 [29114] ERROR:db_sqlite:db_sqlite_free_result: invalid
>> parameter value
>>
>>
>>
>> --
>>
>>
>> But the query UPDATE is correct, because I have already tested it
>> directly in the database.
>>
>>
>> So, am I doing something wrong? What exactly does mean that error
>> "invalid parameter value" in this case? Can I use UPDATE in an avp_db_query?
>>
>>
>> Any hint will be very helpful!
>>
>>
>> Best regards.
>>
>>
>>
>>
>>
>>
>>
>>
>> RODRIGO PIMENTA CARVALHO
>> Inatel Competence Center
>> Software
>> Ph: +55 35 3471 9200 RAMAL 979
>>
>> ___
>> Users mailing list
>> Users@lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>
>
> --
> Aron Podrigal
> -
> '101', '1110010', '110', '1101110'   '101', '110',
> '1100100', '1110010', '1101001', '1100111', '111', '1101100'
>
> P: '2b', '31', '33', '34', '37', '34', '35', '38', '36', '30', '39', '39'
>
>
> ___
> 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] Can I use 'UPDATE' in avp_db_query ?

2015-11-03 Thread Rodrigo Pimenta Carvalho

Hi Wakano.


Thank you for the answer!

I have tried a very simple query : "Delete from Mytable". Just it. But it fails 
too. That is why maybe there is a bug.


I will check that link now.


Regards.


RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph: +55 35 3471 9200 RAMAL 979



De: users-boun...@lists.opensips.org  em nome 
de Patrick Wakano 
Enviado: terça-feira, 3 de novembro de 2015 16:03
Para: OpenSIPS users mailling list
Assunto: Re: [OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?

I think Opensips lexer is converting your 'yes' to the integer 1 when running 
the SQL query in your DB.
See this thread:
http://lists.opensips.org/pipermail/users/2015-February/030946.html

Try to use something different from 'yes' to see what happens.

Patrick


On Tue, Nov 3, 2015 at 3:50 PM, Rodrigo Pimenta Carvalho 
mailto:pime...@inatel.br>> wrote:

Hi Aron.


Do you know whether it is necessary to commit the modifications made by 
avp_db_query("Update") ?

Is there some kind of ' commit' command to be executed in the OpenSIPS script?


Any hint will be very helpful!


Thanks a lot.


RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph: +55 35 3471 9200 RAMAL 979



De: users-boun...@lists.opensips.org 
mailto:users-boun...@lists.opensips.org>> em 
nome de Podrigal, Aron 
mailto:ar...@guaranteedplus.com>>
Enviado: terça-feira, 3 de novembro de 2015 15:26
Para: OpenSIPS users mailling list
Assunto: Re: [OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?

Try removing the second argument "$avp(CallMaxDuration)" from avp_db_query() 
Because the database backend does not return any results.

On Tue, Nov 3, 2015 at 8:50 AM, Rodrigo Pimenta Carvalho 
mailto:pime...@inatel.br>> wrote:

Dear OpenSIPS-users,


In the OpenSIPS database I have created some new tables, for my project. I can 
read from such tables successfully.  For example, the instruction


 avp_db_query("select Value from GeneralConfigurations where Attribute = 
'CallMaxDuration'", "$avp(CallMaxDuration)");


run and works very well. It put the right value in the apv!


However, when the following instruction is executed, it doesn't take any effect 
in the database:


 avp_db_query("update GeneralConfigurations set Value = 'yes' where Attribute = 
'Exists_Intercom_Call'", "$avp(UpdateResult)");


The log says:

---


Nov  3 11:32:52 [29114] DBG:avpops:ops_dbquery_avps: query [update 
GeneralConfigurations set Value = 'yes' where Attribute = 
'Exists_Intercom_Call']
Nov  3 11:32:52 [29114] DBG:avpops:db_query_avp: no result after query
Nov  3 11:32:52 [29114] DBG:avpops:db_close_query: close avp query
Nov  3 11:32:52 [29114] ERROR:db_sqlite:db_sqlite_free_result: invalid 
parameter value


--


But the query UPDATE is correct, because I have already tested it directly in 
the database.


So, am I doing something wrong? What exactly does mean that error "invalid 
parameter value" in this case? Can I use UPDATE in an avp_db_query?


Any hint will be very helpful!


Best regards.








RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph: +55 35 3471 9200 RAMAL 979

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




--
Aron Podrigal
-
'101', '1110010', '110', '1101110'   '101', '110', '1100100', 
'1110010', '1101001', '1100111', '111', '1101100'

P: '2b', '31', '33', '34', '37', '34', '35', '38', '36', '30', '39', '39'


___
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] Can I use 'UPDATE' in avp_db_query ?

2015-11-03 Thread Podrigal, Aron
Here [1] is where your issue is. That it simply executes the query but
returns no results. I guess we need to have some conditional to run the
update function for update statements instead.

[1]
https://github.com/OpenSIPS/opensips/blob/98dccc53f4c25da6edf756333ef45a93bc2f41c7/modules/db_sqlite/dbase.c#L336


On Tue, Nov 3, 2015 at 1:03 PM, Patrick Wakano  wrote:

> I think Opensips lexer is converting your 'yes' to the integer 1 when
> running the SQL query in your DB.
> See this thread:
> http://lists.opensips.org/pipermail/users/2015-February/030946.html
>
> Try to use something different from 'yes' to see what happens.
>
> Patrick
>
>
> On Tue, Nov 3, 2015 at 3:50 PM, Rodrigo Pimenta Carvalho <
> pime...@inatel.br> wrote:
>
>> Hi Aron.
>>
>>
>> Do you know whether it is necessary to commit the modifications made by
>> avp_db_query("Update") ?
>>
>> Is there some kind of ' commit' command to be executed in the OpenSIPS
>> script?
>>
>>
>> Any hint will be very helpful!
>>
>>
>> Thanks a lot.
>>
>>
>> RODRIGO PIMENTA CARVALHO
>> Inatel Competence Center
>> Software
>> Ph: +55 35 3471 9200 RAMAL 979
>>
>>
>> --
>> *De:* users-boun...@lists.opensips.org 
>> em nome de Podrigal, Aron 
>> *Enviado:* terça-feira, 3 de novembro de 2015 15:26
>> *Para:* OpenSIPS users mailling list
>> *Assunto:* Re: [OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?
>>
>> Try removing the second argument *"$avp(CallMaxDuration)"* from
>> avp_db_query() Because the database backend does not return any results.
>>
>> On Tue, Nov 3, 2015 at 8:50 AM, Rodrigo Pimenta Carvalho <
>> pime...@inatel.br> wrote:
>>
>>> Dear OpenSIPS-users,
>>>
>>>
>>> In the OpenSIPS database I have created some new tables, for my project.
>>> I can read from such tables successfully.  For example, the instruction
>>>
>>>
>>>  *avp_db_query("select Value from GeneralConfigurations where Attribute
>>> = 'CallMaxDuration'", "$avp(CallMaxDuration)");*
>>>
>>>
>>> run and works very well. It put the right value in the apv!
>>>
>>>
>>> However, when the following instruction is executed, it doesn't take any
>>> effect in the database:
>>>
>>>
>>> * avp_db_query("update GeneralConfigurations set Value = 'yes' where
>>> Attribute = 'Exists_Intercom_Call'", "$avp(UpdateResult)");*
>>>
>>>
>>> The log says:
>>>
>>>
>>> ---
>>>
>>>
>>> Nov  3 11:32:52 [29114] DBG:avpops:ops_dbquery_avps: query [update
>>> GeneralConfigurations set Value = 'yes' where Attribute =
>>> 'Exists_Intercom_Call']
>>> Nov  3 11:32:52 [29114] DBG:avpops:db_query_avp: no result after query
>>> Nov  3 11:32:52 [29114] DBG:avpops:db_close_query: close avp query
>>> Nov  3 11:32:52 [29114] ERROR:db_sqlite:db_sqlite_free_result: invalid
>>> parameter value
>>>
>>>
>>>
>>> --
>>>
>>>
>>> But the query UPDATE is correct, because I have already tested it
>>> directly in the database.
>>>
>>>
>>> So, am I doing something wrong? What exactly does mean that error
>>> "invalid parameter value" in this case? Can I use UPDATE in an avp_db_query?
>>>
>>>
>>> Any hint will be very helpful!
>>>
>>>
>>> Best regards.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> RODRIGO PIMENTA CARVALHO
>>> Inatel Competence Center
>>> Software
>>> Ph: +55 35 3471 9200 RAMAL 979
>>>
>>> ___
>>> Users mailing list
>>> Users@lists.opensips.org
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>>>
>>
>>
>> --
>> Aron Podrigal
>> -
>> '101', '1110010', '110', '1101110'   '101', '110',
>> '1100100', '1110010', '1101001', '1100111', '111', '1101100'
>>
>> P: '2b', '31', '33', '34', '37', '34', '35', '38', '36', '30', '39', '39'
>>
>>
>> ___
>> 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
>
>


-- 
Aron Podrigal
-
'101', '1110010', '110', '1101110'   '101', '110',
'1100100', '1110010', '1101001', '1100111', '111', '1101100'

P: '2b', '31', '33', '34', '37', '34', '35', '38', '36', '30', '39', '39'
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?

2015-11-03 Thread Podrigal, Aron
Try applying this patch [1]. I also created a pull request for this,
However, I did not test this in any way. Please report back how that worked.

On Tue, Nov 3, 2015 at 1:11 PM, Podrigal, Aron 
wrote:

> Here [1] is where your issue is. That it simply executes the query but
> returns no results. I guess we need to have some conditional to run the
> update function for update statements instead.
>
> [1]
> https://github.com/OpenSIPS/opensips/blob/98dccc53f4c25da6edf756333ef45a93bc2f41c7/modules/db_sqlite/dbase.c#L336
>
>
> On Tue, Nov 3, 2015 at 1:03 PM, Patrick Wakano  wrote:
>
>> I think Opensips lexer is converting your 'yes' to the integer 1 when
>> running the SQL query in your DB.
>> See this thread:
>> http://lists.opensips.org/pipermail/users/2015-February/030946.html
>>
>> Try to use something different from 'yes' to see what happens.
>>
>> Patrick
>>
>>
>> On Tue, Nov 3, 2015 at 3:50 PM, Rodrigo Pimenta Carvalho <
>> pime...@inatel.br> wrote:
>>
>>> Hi Aron.
>>>
>>>
>>> Do you know whether it is necessary to commit the modifications made by
>>> avp_db_query("Update") ?
>>>
>>> Is there some kind of ' commit' command to be executed in the OpenSIPS
>>> script?
>>>
>>>
>>> Any hint will be very helpful!
>>>
>>>
>>> Thanks a lot.
>>>
>>>
>>> RODRIGO PIMENTA CARVALHO
>>> Inatel Competence Center
>>> Software
>>> Ph: +55 35 3471 9200 RAMAL 979
>>>
>>>
>>> --
>>> *De:* users-boun...@lists.opensips.org 
>>> em nome de Podrigal, Aron 
>>> *Enviado:* terça-feira, 3 de novembro de 2015 15:26
>>> *Para:* OpenSIPS users mailling list
>>> *Assunto:* Re: [OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?
>>>
>>> Try removing the second argument *"$avp(CallMaxDuration)"* from
>>> avp_db_query() Because the database backend does not return any results.
>>>
>>> On Tue, Nov 3, 2015 at 8:50 AM, Rodrigo Pimenta Carvalho <
>>> pime...@inatel.br> wrote:
>>>
 Dear OpenSIPS-users,


 In the OpenSIPS database I have created some new tables, for my
 project. I can read from such tables successfully.  For example, the
 instruction


  *avp_db_query("select Value from GeneralConfigurations where
 Attribute = 'CallMaxDuration'", "$avp(CallMaxDuration)");*


 run and works very well. It put the right value in the apv!


 However, when the following instruction is executed, it doesn't take
 any effect in the database:


 * avp_db_query("update GeneralConfigurations set Value = 'yes' where
 Attribute = 'Exists_Intercom_Call'", "$avp(UpdateResult)");*


 The log says:


 ---


 Nov  3 11:32:52 [29114] DBG:avpops:ops_dbquery_avps: query [update
 GeneralConfigurations set Value = 'yes' where Attribute =
 'Exists_Intercom_Call']
 Nov  3 11:32:52 [29114] DBG:avpops:db_query_avp: no result after query
 Nov  3 11:32:52 [29114] DBG:avpops:db_close_query: close avp query
 Nov  3 11:32:52 [29114] ERROR:db_sqlite:db_sqlite_free_result: invalid
 parameter value



 --


 But the query UPDATE is correct, because I have already tested it
 directly in the database.


 So, am I doing something wrong? What exactly does mean that error
 "invalid parameter value" in this case? Can I use UPDATE in an 
 avp_db_query?


 Any hint will be very helpful!


 Best regards.








 RODRIGO PIMENTA CARVALHO
 Inatel Competence Center
 Software
 Ph: +55 35 3471 9200 RAMAL 979

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


>>>
>>>
>>> --
>>> Aron Podrigal
>>> -
>>> '101', '1110010', '110', '1101110'   '101', '110',
>>> '1100100', '1110010', '1101001', '1100111', '111', '1101100'
>>>
>>> P: '2b', '31', '33', '34', '37', '34', '35', '38', '36', '30', '39', '39'
>>>
>>>
>>> ___
>>> 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
>>
>>
>
>
> --
> Aron Podrigal
> -
> '101', '1110010', '110', '1101110'   '101', '110',
> '1100100', '1110010', '1101001', '1100111', '111', '1101100'
>
> P: '2b', '31', '33', '34', '37', '34', '35', '38', '36', '30', '39', '39'
>
>


-- 
Aron Podrigal
-
'101', 

Re: [OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?

2015-11-03 Thread Podrigal, Aron
Woop, I missed the link.

Try applying this patch [1]. I also created a pull request [2] for this,
However, I did not test this in any way. Please report back how that worked.

[1]
https://github.com/ar45/opensips/commit/62c638fb2d5bf795775908cf0f45be6c30df5044
[2] https://github.com/OpenSIPS/opensips/pull/689

On Tue, Nov 3, 2015 at 1:31 PM, Podrigal, Aron 
wrote:

> Try applying this patch [1]. I also created a pull request for this,
> However, I did not test this in any way. Please report back how that worked.
>
> On Tue, Nov 3, 2015 at 1:11 PM, Podrigal, Aron 
> wrote:
>
>> Here [1] is where your issue is. That it simply executes the query but
>> returns no results. I guess we need to have some conditional to run the
>> update function for update statements instead.
>>
>> [1]
>> https://github.com/OpenSIPS/opensips/blob/98dccc53f4c25da6edf756333ef45a93bc2f41c7/modules/db_sqlite/dbase.c#L336
>>
>>
>> On Tue, Nov 3, 2015 at 1:03 PM, Patrick Wakano  wrote:
>>
>>> I think Opensips lexer is converting your 'yes' to the integer 1 when
>>> running the SQL query in your DB.
>>> See this thread:
>>> http://lists.opensips.org/pipermail/users/2015-February/030946.html
>>>
>>> Try to use something different from 'yes' to see what happens.
>>>
>>> Patrick
>>>
>>>
>>> On Tue, Nov 3, 2015 at 3:50 PM, Rodrigo Pimenta Carvalho <
>>> pime...@inatel.br> wrote:
>>>
 Hi Aron.


 Do you know whether it is necessary to commit the modifications made by
 avp_db_query("Update") ?

 Is there some kind of ' commit' command to be executed in the OpenSIPS
 script?


 Any hint will be very helpful!


 Thanks a lot.


 RODRIGO PIMENTA CARVALHO
 Inatel Competence Center
 Software
 Ph: +55 35 3471 9200 RAMAL 979


 --
 *De:* users-boun...@lists.opensips.org <
 users-boun...@lists.opensips.org> em nome de Podrigal, Aron <
 ar...@guaranteedplus.com>
 *Enviado:* terça-feira, 3 de novembro de 2015 15:26
 *Para:* OpenSIPS users mailling list
 *Assunto:* Re: [OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?

 Try removing the second argument *"$avp(CallMaxDuration)"* from
 avp_db_query() Because the database backend does not return any results.

 On Tue, Nov 3, 2015 at 8:50 AM, Rodrigo Pimenta Carvalho <
 pime...@inatel.br> wrote:

> Dear OpenSIPS-users,
>
>
> In the OpenSIPS database I have created some new tables, for my
> project. I can read from such tables successfully.  For example, the
> instruction
>
>
>  *avp_db_query("select Value from GeneralConfigurations where
> Attribute = 'CallMaxDuration'", "$avp(CallMaxDuration)");*
>
>
> run and works very well. It put the right value in the apv!
>
>
> However, when the following instruction is executed, it doesn't take
> any effect in the database:
>
>
> * avp_db_query("update GeneralConfigurations set Value = 'yes' where
> Attribute = 'Exists_Intercom_Call'", "$avp(UpdateResult)");*
>
>
> The log says:
>
>
> ---
>
>
> Nov  3 11:32:52 [29114] DBG:avpops:ops_dbquery_avps: query [update
> GeneralConfigurations set Value = 'yes' where Attribute =
> 'Exists_Intercom_Call']
> Nov  3 11:32:52 [29114] DBG:avpops:db_query_avp: no result after query
> Nov  3 11:32:52 [29114] DBG:avpops:db_close_query: close avp query
> Nov  3 11:32:52 [29114] ERROR:db_sqlite:db_sqlite_free_result: invalid
> parameter value
>
>
>
> --
>
>
> But the query UPDATE is correct, because I have already tested it
> directly in the database.
>
>
> So, am I doing something wrong? What exactly does mean that error
> "invalid parameter value" in this case? Can I use UPDATE in an 
> avp_db_query?
>
>
> Any hint will be very helpful!
>
>
> Best regards.
>
>
>
>
>
>
>
>
> RODRIGO PIMENTA CARVALHO
> Inatel Competence Center
> Software
> Ph: +55 35 3471 9200 RAMAL 979
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>


 --
 Aron Podrigal
 -
 '101', '1110010', '110', '1101110'   '101', '110',
 '1100100', '1110010', '1101001', '1100111', '111', '1101100'

 P: '2b', '31', '33', '34', '37', '34', '35', '38', '36', '30', '39',
 '39'


 

Re: [OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?

2015-11-03 Thread Rodrigo Pimenta Carvalho
Hi Podrigal.


Yes. The query doesn't have to return a value. It is Ok. But, the query also 
doesn't take effect in the database.


By the way, take a look in the code you have just pointed me in [1].


That function has the parameter _s  :  int 
db_sqlite_raw_query(const db_con_t* _h, const str* _s, db_res_t** _r).

However, such parameter is not passed to the sqlite3_exec. See:


sqlite3_exec(CON_CONNECTION(_h), query_holder.s, NULL, NULL, &errmsg)


query_holder.s was used in place of _s.


Could it be a bug in the dbase.c file? What do you think?


Best regards.



RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph: +55 35 3471 9200 RAMAL 979



De: users-boun...@lists.opensips.org  em nome 
de Podrigal, Aron 
Enviado: terça-feira, 3 de novembro de 2015 16:11
Para: OpenSIPS users mailling list
Assunto: Re: [OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?

Here [1] is where your issue is. That it simply executes the query but returns 
no results. I guess we need to have some conditional to run the update function 
for update statements instead.

[1] 
https://github.com/OpenSIPS/opensips/blob/98dccc53f4c25da6edf756333ef45a93bc2f41c7/modules/db_sqlite/dbase.c#L336
[https://avatars1.githubusercontent.com/u/3853758?v=3&s=400]

OpenSIPS/opensips
opensips - OpenSIPS is a GPL implementation of a multi-functionality SIP Server 
that targets to deliver a high-level technical solution (performance, security 
and quality) to be used in professiona...
Leia 
mais...




On Tue, Nov 3, 2015 at 1:03 PM, Patrick Wakano 
mailto:pwak...@gmail.com>> wrote:
I think Opensips lexer is converting your 'yes' to the integer 1 when running 
the SQL query in your DB.
See this thread:
http://lists.opensips.org/pipermail/users/2015-February/030946.html

Try to use something different from 'yes' to see what happens.

Patrick


On Tue, Nov 3, 2015 at 3:50 PM, Rodrigo Pimenta Carvalho 
mailto:pime...@inatel.br>> wrote:

Hi Aron.


Do you know whether it is necessary to commit the modifications made by 
avp_db_query("Update") ?

Is there some kind of ' commit' command to be executed in the OpenSIPS script?


Any hint will be very helpful!


Thanks a lot.


RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph: +55 35 3471 9200 RAMAL 979



De: users-boun...@lists.opensips.org 
mailto:users-boun...@lists.opensips.org>> em 
nome de Podrigal, Aron 
mailto:ar...@guaranteedplus.com>>
Enviado: terça-feira, 3 de novembro de 2015 15:26
Para: OpenSIPS users mailling list
Assunto: Re: [OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?

Try removing the second argument "$avp(CallMaxDuration)" from avp_db_query() 
Because the database backend does not return any results.

On Tue, Nov 3, 2015 at 8:50 AM, Rodrigo Pimenta Carvalho 
mailto:pime...@inatel.br>> wrote:

Dear OpenSIPS-users,


In the OpenSIPS database I have created some new tables, for my project. I can 
read from such tables successfully.  For example, the instruction


 avp_db_query("select Value from GeneralConfigurations where Attribute = 
'CallMaxDuration'", "$avp(CallMaxDuration)");


run and works very well. It put the right value in the apv!


However, when the following instruction is executed, it doesn't take any effect 
in the database:


 avp_db_query("update GeneralConfigurations set Value = 'yes' where Attribute = 
'Exists_Intercom_Call'", "$avp(UpdateResult)");


The log says:

---


Nov  3 11:32:52 [29114] DBG:avpops:ops_dbquery_avps: query [update 
GeneralConfigurations set Value = 'yes' where Attribute = 
'Exists_Intercom_Call']
Nov  3 11:32:52 [29114] DBG:avpops:db_query_avp: no result after query
Nov  3 11:32:52 [29114] DBG:avpops:db_close_query: close avp query
Nov  3 11:32:52 [29114] ERROR:db_sqlite:db_sqlite_free_result: invalid 
parameter value


--


But the query UPDATE is correct, because I have already tested it directly in 
the database.


So, am I doing something wrong? What exactly does mean that error "invalid 
parameter value" in this case? Can I use UPDATE in an avp_db_query?


Any hint will be very helpful!


Best regards.








RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph: +55 35 3471 9200 RAMAL 979

___
Users mailing list
Users@lists.opensips.org
http://lis

[OpenSIPS-Users] REG::Adding user_avp

2015-11-03 Thread Ravitez Ravi
Hello Everybody,
   Can some one suggest on how to add user_avp's.
   Thank you.

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


Re: [OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?

2015-11-03 Thread Rodrigo Pimenta Carvalho
Ok Aronp.


Thank you very much.


I will try this solution, test and tell you about the result.

By the way, It will be my first time applying a patch. So let me ask you:


Have I to download your fixed source code, or have i to download some binary 
file?

After getting the file,  I will apply the patch following a kind of tutorial 
about it.


Best regards.


RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph: +55 35 3471 9200 RAMAL 979



De: users-boun...@lists.opensips.org  em nome 
de Podrigal, Aron 
Enviado: terça-feira, 3 de novembro de 2015 16:32
Para: OpenSIPS users mailling list
Assunto: Re: [OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?

Woop, I missed the link.

Try applying this patch [1]. I also created a pull request [2] for this, 
However, I did not test this in any way. Please report back how that worked.

[1] 
https://github.com/ar45/opensips/commit/62c638fb2d5bf795775908cf0f45be6c30df5044
[2] https://github.com/OpenSIPS/opensips/pull/689

On Tue, Nov 3, 2015 at 1:31 PM, Podrigal, Aron 
mailto:ar...@guaranteedplus.com>> wrote:
Try applying this patch [1]. I also created a pull request for this, However, I 
did not test this in any way. Please report back how that worked.

On Tue, Nov 3, 2015 at 1:11 PM, Podrigal, Aron 
mailto:ar...@guaranteedplus.com>> wrote:
Here [1] is where your issue is. That it simply executes the query but returns 
no results. I guess we need to have some conditional to run the update function 
for update statements instead.

[1] 
https://github.com/OpenSIPS/opensips/blob/98dccc53f4c25da6edf756333ef45a93bc2f41c7/modules/db_sqlite/dbase.c#L336


On Tue, Nov 3, 2015 at 1:03 PM, Patrick Wakano 
mailto:pwak...@gmail.com>> wrote:
I think Opensips lexer is converting your 'yes' to the integer 1 when running 
the SQL query in your DB.
See this thread:
http://lists.opensips.org/pipermail/users/2015-February/030946.html

Try to use something different from 'yes' to see what happens.

Patrick


On Tue, Nov 3, 2015 at 3:50 PM, Rodrigo Pimenta Carvalho 
mailto:pime...@inatel.br>> wrote:

Hi Aron.


Do you know whether it is necessary to commit the modifications made by 
avp_db_query("Update") ?

Is there some kind of ' commit' command to be executed in the OpenSIPS script?


Any hint will be very helpful!


Thanks a lot.


RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph: +55 35 3471 9200 RAMAL 979



De: users-boun...@lists.opensips.org 
mailto:users-boun...@lists.opensips.org>> em 
nome de Podrigal, Aron 
mailto:ar...@guaranteedplus.com>>
Enviado: terça-feira, 3 de novembro de 2015 15:26
Para: OpenSIPS users mailling list
Assunto: Re: [OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?

Try removing the second argument "$avp(CallMaxDuration)" from avp_db_query() 
Because the database backend does not return any results.

On Tue, Nov 3, 2015 at 8:50 AM, Rodrigo Pimenta Carvalho 
mailto:pime...@inatel.br>> wrote:

Dear OpenSIPS-users,


In the OpenSIPS database I have created some new tables, for my project. I can 
read from such tables successfully.  For example, the instruction


 avp_db_query("select Value from GeneralConfigurations where Attribute = 
'CallMaxDuration'", "$avp(CallMaxDuration)");


run and works very well. It put the right value in the apv!


However, when the following instruction is executed, it doesn't take any effect 
in the database:


 avp_db_query("update GeneralConfigurations set Value = 'yes' where Attribute = 
'Exists_Intercom_Call'", "$avp(UpdateResult)");


The log says:

---


Nov  3 11:32:52 [29114] DBG:avpops:ops_dbquery_avps: query [update 
GeneralConfigurations set Value = 'yes' where Attribute = 
'Exists_Intercom_Call']
Nov  3 11:32:52 [29114] DBG:avpops:db_query_avp: no result after query
Nov  3 11:32:52 [29114] DBG:avpops:db_close_query: close avp query
Nov  3 11:32:52 [29114] ERROR:db_sqlite:db_sqlite_free_result: invalid 
parameter value


--


But the query UPDATE is correct, because I have already tested it directly in 
the database.


So, am I doing something wrong? What exactly does mean that error "invalid 
parameter value" in this case? Can I use UPDATE in an avp_db_query?


Any hint will be very helpful!


Best regards.








RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph: +55 35 3471 9200 RAMAL 979

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




--
Aron Podrigal
-
'101', '1110010', '110', '1101110

Re: [OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?

2015-11-03 Thread Podrigal, Aron
That's right. I can't believe I looked over that. I updated the pull
request.

On Tue, Nov 3, 2015 at 1:38 PM, Rodrigo Pimenta Carvalho 
wrote:

> Hi Podrigal.
>
> Yes. The query doesn't have to return a value. It is Ok. But, the query
> also doesn't take effect in the database.
>
>
> By the way, take a look in the code you have just pointed me in [1].
>
>
> That function has the parameter _s  :  *int
> db_sqlite_raw_query(const db_con_t* _h, const str* _s, db_res_t** _r).*
>
> However, such parameter is not passed to the sqlite3_exec. See:
>
>
> *sqlite3_exec(CON_CONNECTION(_h), query_holder.s, NULL, NULL, &errmsg)*
>
>
> query_holder.s was used in place of _s.
>
>
> Could it be a bug in the *dbase.c* file? What do you think?
>
>
> Best regards.
>
>
> RODRIGO PIMENTA CARVALHO
> Inatel Competence Center
> Software
> Ph: +55 35 3471 9200 RAMAL 979
>
>
> --
> *De:* users-boun...@lists.opensips.org 
> em nome de Podrigal, Aron 
> *Enviado:* terça-feira, 3 de novembro de 2015 16:11
> *Para:* OpenSIPS users mailling list
> *Assunto:* Re: [OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?
>
> Here [1] is where your issue is. That it simply executes the query but
> returns no results. I guess we need to have some conditional to run the
> update function for update statements instead.
>
> [1]
> https://github.com/OpenSIPS/opensips/blob/98dccc53f4c25da6edf756333ef45a93bc2f41c7/modules/db_sqlite/dbase.c#L336
>
> 
> OpenSIPS/opensips
> opensips - OpenSIPS is a GPL implementation of a multi-functionality SIP
> Server that targets to deliver a high-level technical solution
> (performance, security and quality) to be used in professiona...
> Leia mais...
> 
>
>
>
> On Tue, Nov 3, 2015 at 1:03 PM, Patrick Wakano  wrote:
>
>> I think Opensips lexer is converting your 'yes' to the integer 1 when
>> running the SQL query in your DB.
>> See this thread:
>> http://lists.opensips.org/pipermail/users/2015-February/030946.html
>>
>> Try to use something different from 'yes' to see what happens.
>>
>> Patrick
>>
>>
>> On Tue, Nov 3, 2015 at 3:50 PM, Rodrigo Pimenta Carvalho <
>> pime...@inatel.br> wrote:
>>
>>> Hi Aron.
>>>
>>>
>>> Do you know whether it is necessary to commit the modifications made by
>>> avp_db_query("Update") ?
>>>
>>> Is there some kind of ' commit' command to be executed in the OpenSIPS
>>> script?
>>>
>>>
>>> Any hint will be very helpful!
>>>
>>>
>>> Thanks a lot.
>>>
>>>
>>> RODRIGO PIMENTA CARVALHO
>>> Inatel Competence Center
>>> Software
>>> Ph: +55 35 3471 9200 RAMAL 979
>>>
>>>
>>> --
>>> *De:* users-boun...@lists.opensips.org 
>>> em nome de Podrigal, Aron 
>>> *Enviado:* terça-feira, 3 de novembro de 2015 15:26
>>> *Para:* OpenSIPS users mailling list
>>> *Assunto:* Re: [OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?
>>>
>>> Try removing the second argument *"$avp(CallMaxDuration)"* from
>>> avp_db_query() Because the database backend does not return any results.
>>>
>>> On Tue, Nov 3, 2015 at 8:50 AM, Rodrigo Pimenta Carvalho <
>>> pime...@inatel.br> wrote:
>>>
 Dear OpenSIPS-users,


 In the OpenSIPS database I have created some new tables, for my
 project. I can read from such tables successfully.  For example, the
 instruction


  *avp_db_query("select Value from GeneralConfigurations where
 Attribute = 'CallMaxDuration'", "$avp(CallMaxDuration)");*


 run and works very well. It put the right value in the apv!


 However, when the following instruction is executed, it doesn't take
 any effect in the database:


 * avp_db_query("update GeneralConfigurations set Value = 'yes' where
 Attribute = 'Exists_Intercom_Call'", "$avp(UpdateResult)");*


 The log says:


 ---


 Nov  3 11:32:52 [29114] DBG:avpops:ops_dbquery_avps: query [update
 GeneralConfigurations set Value = 'yes' where Attribute =
 'Exists_Intercom_Call']
 Nov  3 11:32:52 [29114] DBG:avpops:db_query_avp: no result after query
 Nov  3 11:32:52 [29114] DBG:avpops:db_close_query: close avp query
 Nov  3 11:32:52 [29114] ERROR:db_sqlite:db_sqlite_free_result: invalid
 parameter value



 --


 But the query UPDATE is correct, because I have already tested it
 directly in the database.


 So, am I doing something wrong?

Re: [OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?

2015-11-03 Thread Podrigal, Aron
Here is how to compile and install

cd /usr/local/src/
git clone https://github.com/ar45/opensips
-b fix_sqlite_delete_update_avp_query
cd opensips
make menuconfig

Then configure your compile options and install location and compile it.


On Tue, Nov 3, 2015 at 2:25 PM, Podrigal, Aron 
wrote:

> That's right. I can't believe I looked over that. I updated the pull
> request.
>
> On Tue, Nov 3, 2015 at 1:38 PM, Rodrigo Pimenta Carvalho <
> pime...@inatel.br> wrote:
>
>> Hi Podrigal.
>>
>> Yes. The query doesn't have to return a value. It is Ok. But, the query
>> also doesn't take effect in the database.
>>
>>
>> By the way, take a look in the code you have just pointed me in [1].
>>
>>
>> That function has the parameter _s  :  *int
>> db_sqlite_raw_query(const db_con_t* _h, const str* _s, db_res_t** _r).*
>>
>> However, such parameter is not passed to the sqlite3_exec. See:
>>
>>
>> *sqlite3_exec(CON_CONNECTION(_h), query_holder.s, NULL, NULL, &errmsg)*
>>
>>
>> query_holder.s was used in place of _s.
>>
>>
>> Could it be a bug in the *dbase.c* file? What do you think?
>>
>>
>> Best regards.
>>
>>
>> RODRIGO PIMENTA CARVALHO
>> Inatel Competence Center
>> Software
>> Ph: +55 35 3471 9200 RAMAL 979
>>
>>
>> --
>> *De:* users-boun...@lists.opensips.org 
>> em nome de Podrigal, Aron 
>> *Enviado:* terça-feira, 3 de novembro de 2015 16:11
>> *Para:* OpenSIPS users mailling list
>> *Assunto:* Re: [OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?
>>
>> Here [1] is where your issue is. That it simply executes the query but
>> returns no results. I guess we need to have some conditional to run the
>> update function for update statements instead.
>>
>> [1]
>> https://github.com/OpenSIPS/opensips/blob/98dccc53f4c25da6edf756333ef45a93bc2f41c7/modules/db_sqlite/dbase.c#L336
>>
>> 
>> OpenSIPS/opensips
>> opensips - OpenSIPS is a GPL implementation of a multi-functionality SIP
>> Server that targets to deliver a high-level technical solution
>> (performance, security and quality) to be used in professiona...
>> Leia mais...
>> 
>>
>>
>>
>> On Tue, Nov 3, 2015 at 1:03 PM, Patrick Wakano  wrote:
>>
>>> I think Opensips lexer is converting your 'yes' to the integer 1 when
>>> running the SQL query in your DB.
>>> See this thread:
>>> http://lists.opensips.org/pipermail/users/2015-February/030946.html
>>>
>>> Try to use something different from 'yes' to see what happens.
>>>
>>> Patrick
>>>
>>>
>>> On Tue, Nov 3, 2015 at 3:50 PM, Rodrigo Pimenta Carvalho <
>>> pime...@inatel.br> wrote:
>>>
 Hi Aron.


 Do you know whether it is necessary to commit the modifications made by
 avp_db_query("Update") ?

 Is there some kind of ' commit' command to be executed in the OpenSIPS
 script?


 Any hint will be very helpful!


 Thanks a lot.


 RODRIGO PIMENTA CARVALHO
 Inatel Competence Center
 Software
 Ph: +55 35 3471 9200 RAMAL 979


 --
 *De:* users-boun...@lists.opensips.org <
 users-boun...@lists.opensips.org> em nome de Podrigal, Aron <
 ar...@guaranteedplus.com>
 *Enviado:* terça-feira, 3 de novembro de 2015 15:26
 *Para:* OpenSIPS users mailling list
 *Assunto:* Re: [OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?

 Try removing the second argument *"$avp(CallMaxDuration)"* from
 avp_db_query() Because the database backend does not return any results.

 On Tue, Nov 3, 2015 at 8:50 AM, Rodrigo Pimenta Carvalho <
 pime...@inatel.br> wrote:

> Dear OpenSIPS-users,
>
>
> In the OpenSIPS database I have created some new tables, for my
> project. I can read from such tables successfully.  For example, the
> instruction
>
>
>  *avp_db_query("select Value from GeneralConfigurations where
> Attribute = 'CallMaxDuration'", "$avp(CallMaxDuration)");*
>
>
> run and works very well. It put the right value in the apv!
>
>
> However, when the following instruction is executed, it doesn't take
> any effect in the database:
>
>
> * avp_db_query("update GeneralConfigurations set Value = 'yes' where
> Attribute = 'Exists_Intercom_Call'", "$avp(UpdateResult)");*
>
>
> The log says:
>
>
> ---
>
>
> Nov  3 11:32:52 [29114] DBG:avpops:ops_dbquery_avps: query [update
> GeneralConfigurations set Value = 'yes' where Attribute =
> 'Exists_Intercom_Call']
> Nov  3 11:32:52 [29114] DBG:avpops:db_query_avp: no result a

Re: [OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?

2015-11-03 Thread Rodrigo Pimenta Carvalho

Thank you very much!!

I have to try it tomorrow, cause I have to leave for the day now.


By the way: you have used _s->s. The SQLite documentation says that such 
parameter should end with \0, shouldn't it? Should you have created a new 
string ending with \0, to be used here?


According to a developer from my team (Daniel Fússia), maybe the following 
"patch" code should be considered:



+/* fix possible non '\0' 
terminated table name */

+char stable[512];

+memcpy(stable, _s->s, _s->len);

+stable[_s->len] = '\0';

+if 
(sqlite3_exec(CON_CONNECTION(_h),

-   
 query_holder.s, NULL, NULL, &errmsg)) {

+   
stable, NULL, NULL, &errmsg)) {




What about?


Regards.




RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph: +55 35 3471 9200 RAMAL 979



De: users-boun...@lists.opensips.org  em nome 
de Podrigal, Aron 
Enviado: terça-feira, 3 de novembro de 2015 17:29
Para: OpenSIPS users mailling list
Assunto: Re: [OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?

Here is how to compile and install

cd /usr/local/src/
git clone https://github.com/ar45/opensips -b fix_sqlite_delete_update_avp_query
[https://avatars1.githubusercontent.com/u/4923160?v=3&s=400]

ar45/opensips
opensips - OpenSIPS is a GPL implementation of a multi-functionality SIP Server 
that targets to deliver a high-level technical solution (performance, security 
and quality) to be used in professiona...
Leia mais...

cd opensips
make menuconfig

Then configure your compile options and install location and compile it.


On Tue, Nov 3, 2015 at 2:25 PM, Podrigal, Aron 
mailto:ar...@guaranteedplus.com>> wrote:
That's right. I can't believe I looked over that. I updated the pull request.

On Tue, Nov 3, 2015 at 1:38 PM, Rodrigo Pimenta Carvalho 
mailto:pime...@inatel.br>> wrote:
Hi Podrigal.


Yes. The query doesn't have to return a value. It is Ok. But, the query also 
doesn't take effect in the database.


By the way, take a look in the code you have just pointed me in [1].


That function has the parameter _s  :  int 
db_sqlite_raw_query(const db_con_t* _h, const str* _s, db_res_t** _r).

However, such parameter is not passed to the sqlite3_exec. See:


sqlite3_exec(CON_CONNECTION(_h), query_holder.s, NULL, NULL, &errmsg)


query_holder.s was used in place of _s.


Could it be a bug in the dbase.c file? What do you think?


Best regards.



RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph: +55 35 3471 9200 RAMAL 979



De: users-boun...@lists.opensips.org 
mailto:users-boun...@lists.opensips.org>> em 
nome de Podrigal, Aron 
mailto:ar...@guaranteedplus.com>>
Enviado: terça-feira, 3 de novembro de 2015 16:11
Para: OpenSIPS users mailling list
Assunto: Re: [OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?

Here [1] is where your issue is. That it simply executes the query but returns 
no results. I guess we need to have some conditional to run the update function 
for update statements instead.

[1] 
https://github.com/OpenSIPS/opensips/blob/98dccc53f4c25da6edf756333ef45a93bc2f41c7/modules/db_sqlite/dbase.c#L336
[https://avatars1.githubusercontent.com/u/3853758?v=3&s=400]

OpenSIPS/opensips
opensips - OpenSIPS is a GPL implementation of a multi-functionality SIP Server 
that targets to deliver a high-level technical solution (performance, security 
and quality) to be used in professiona...
Leia 
mais...




On Tue, Nov 3, 2015 at 1:03 PM, Patrick Wakano 
mailto:pwak...@gmail.com>> wrote:
I think Opensips lexer is converting your 'yes' to the integer 1 when running 
the SQL query in your DB.
See this thread:
http://lists.opensips.org/pipermail/users/2015-February/030946.html

Try to use something different from 'yes' to see what happens.

Patrick


On Tue, Nov 3, 2015 at 3:50 PM, Rodrigo Pimenta Carvalho 
mailto:pime...@inatel.br>> wrote:

Hi Aron.


Do you know whether it is necessary to commit the modifications made by 
avp_db_query("Update") ?

Is there some kind of ' commit' command to be executed in the OpenSIPS script?


Any hint will be very helpful!


Thanks a lot.


RODRIGO PIMENTA CARVALHO
Inatel Competence Center
Software
Ph: +55 35 3471 9200 RAMAL 979


_

Re: [OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?

2015-11-03 Thread Podrigal, Aron
Yes. That's correct.

On Tue, Nov 3, 2015 at 2:44 PM, Rodrigo Pimenta Carvalho 
wrote:

>
> Thank you very much!!
>
> I have to try it tomorrow, cause I have to leave for the day now.
>
> By the way: you have used _s->s. The SQLite documentation says that such
> parameter should end with \0, shouldn't it? Should you have created a new
> string ending with \0, to be used here?
>
>
> According to a developer from my team (Daniel Fússia), maybe the following
> "patch" code should be considered:
>
>
> +/* fix possible non '\0'
> terminated table name */
>
> +char stable[512];
>
> +memcpy(stable, _s->s,
> _s->len);
>
> +stable[_s->len] = '\0';
>
> +if
> (sqlite3_exec(CON_CONNECTION(_h),
>
> -
> query_holder.s, NULL, NULL, &errmsg)) {
>
> +
> stable, NULL, NULL, &errmsg)) {
>
>
>
> What about?
>
>
> Regards.
>
>
>
>
> RODRIGO PIMENTA CARVALHO
> Inatel Competence Center
> Software
> Ph: +55 35 3471 9200 RAMAL 979
>
>
> --
> *De:* users-boun...@lists.opensips.org 
> em nome de Podrigal, Aron 
> *Enviado:* terça-feira, 3 de novembro de 2015 17:29
> *Para:* OpenSIPS users mailling list
> *Assunto:* Re: [OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?
>
> Here is how to compile and install
>
> cd /usr/local/src/
> git clone https://github.com/ar45/opensips
> -b fix_sqlite_delete_update_avp_query
> 
> ar45/opensips
> opensips - OpenSIPS is a GPL implementation of a multi-functionality SIP
> Server that targets to deliver a high-level technical solution
> (performance, security and quality) to be used in professiona...
> Leia mais... 
> cd opensips
> make menuconfig
>
> Then configure your compile options and install location and compile it.
>
>
> On Tue, Nov 3, 2015 at 2:25 PM, Podrigal, Aron 
> wrote:
>
>> That's right. I can't believe I looked over that. I updated the pull
>> request.
>>
>> On Tue, Nov 3, 2015 at 1:38 PM, Rodrigo Pimenta Carvalho <
>> pime...@inatel.br> wrote:
>>
>>> Hi Podrigal.
>>>
>>> Yes. The query doesn't have to return a value. It is Ok. But, the query
>>> also doesn't take effect in the database.
>>>
>>>
>>> By the way, take a look in the code you have just pointed me in [1].
>>>
>>>
>>> That function has the parameter _s  :  *int
>>> db_sqlite_raw_query(const db_con_t* _h, const str* _s, db_res_t** _r).*
>>>
>>> However, such parameter is not passed to the sqlite3_exec. See:
>>>
>>>
>>> *sqlite3_exec(CON_CONNECTION(_h), query_holder.s, NULL, NULL, &errmsg)*
>>>
>>>
>>> query_holder.s was used in place of _s.
>>>
>>>
>>> Could it be a bug in the *dbase.c* file? What do you think?
>>>
>>>
>>> Best regards.
>>>
>>>
>>> RODRIGO PIMENTA CARVALHO
>>> Inatel Competence Center
>>> Software
>>> Ph: +55 35 3471 9200 RAMAL 979
>>>
>>>
>>> --
>>> *De:* users-boun...@lists.opensips.org 
>>> em nome de Podrigal, Aron 
>>> *Enviado:* terça-feira, 3 de novembro de 2015 16:11
>>> *Para:* OpenSIPS users mailling list
>>> *Assunto:* Re: [OpenSIPS-Users] Can I use 'UPDATE' in avp_db_query ?
>>>
>>> Here [1] is where your issue is. That it simply executes the query but
>>> returns no results. I guess we need to have some conditional to run the
>>> update function for update statements instead.
>>>
>>> [1]
>>> https://github.com/OpenSIPS/opensips/blob/98dccc53f4c25da6edf756333ef45a93bc2f41c7/modules/db_sqlite/dbase.c#L336
>>>
>>> 
>>> OpenSIPS/opensips
>>> opensips - OpenSIPS is a GPL implementation of a multi-functionality SIP
>>> Server that targets to deliver a high-level technical solution
>>> (performance, security and quality) to be used in professiona...
>>> Leia mais...
>>> 
>>>
>>>
>>>
>>> On Tue, Nov 3, 2015 at 1:03 PM, Patrick Wakano 
>>> wrote:
>>>
 I think Opensips lexer is converting your 'yes' to the integer 1 when
 running the SQL query in your DB.
 See this thread:
 http://lists.opensips.org/pipermail/users/2015-February/030946.html

 Try to use something different from 'yes' to see what happens.

 Patrick


 On Tue, Nov 3, 2015 at 3:50 PM, Rodrigo Pimenta Carvalho <
 pime...@inatel.br> wrote:

> Hi Aron.
>
>
> Do you know whether it is necessary to commit the modifications made
> by avp_db_query("Update") ?
>
> Is there some kind of ' commit' command to be executed in the OpenSIPS
> script?
>
>
> Any hint will be very helpful!
>
>
> Thanks a lot.
>
>
> RODRIGO PIMENTA CARVALHO
> Inatel Comp

Re: [OpenSIPS-Users] Presence server: Using domain name instead of IP address

2015-11-03 Thread surya
Hi Nabeel,

I think I am missing something.

What I did is:

*domain.com="192.168.192.129"*
alias="domain.com"
listen=udp:"alias":5060

This gives me syntax error at the first line.

Please correct what I am doing wrong.

Thanks



--
View this message in context: 
http://opensips-open-sip-server.1449251.n2.nabble.com/Presence-server-Using-domain-name-instead-of-IP-address-tp7599676p7599740.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.com.

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


Re: [OpenSIPS-Users] Presence server: Using domain name instead of IP address

2015-11-03 Thread Nabeel
You shouldn't need the first line at all.  The 'listen' line should use the
actual IP address:

alias="domain.com"
listen=udp:192.168.192.129:5060
On 3 Nov 2015 20:06, "surya"  wrote:

> Hi Nabeel,
>
> I think I am missing something.
>
> What I did is:
>
> *domain.com="192.168.192.129"*
> alias="domain.com"
> listen=udp:"alias":5060
>
> This gives me syntax error at the first line.
>
> Please correct what I am doing wrong.
>
> Thanks
>
>
>
> --
> View this message in context:
> http://opensips-open-sip-server.1449251.n2.nabble.com/Presence-server-Using-domain-name-instead-of-IP-address-tp7599676p7599740.html
> Sent from the OpenSIPS - Users mailing list archive at Nabble.com.
>
> ___
> 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] CRITICAL

2015-11-03 Thread Dragomir Haralambiev
Now worked fine!
Thanks for your help!

BR

2015-11-03 17:35 GMT+02:00 Ionut Ionita :

> Hi,
>
> If you look into the documentation[1], the comma is not optional. So you
> should call something like:
> if (!is_contact_registered("location","$fu",,)) {
> 
>
> Regards,
> Ionut Ionita
>
> [1]
> http://www.opensips.org/html/docs/modules/2.2.x/registrar.html#id294862
>
> On 02.11.2015 21:58, Dragomir Haralambiev wrote:
>
>> Hello,
>>
>> I try to test latest version: opensips 2.2-dev.
>>
>> When use:
>> if (!registered("location","$fu")) {
>> 
>> I receive follow message:
>> WARNING:registrar:registered: Deprecated! Use is_contact_registered()
>> instead!
>>
>> when use:
>> if (!is_contact_registered("location","$fu")) {
>> .
>>
>> I receive :
>> CRITICAL:core:yyerror: parse error in config file /opensips.cfg, unknown
>> command , missing loadmodule?
>>
>> Regards,
>>
>>
>> ___
>> 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] Presence server: Using domain name instead of IP address

2015-11-03 Thread surya
Oh Thanks this works. 

Few comments back you approved similar lines. Nevermind.
This also means that now I don't need entry in /etc/hosts.

One more question, can I get IP from env into this file?

Thanks,




--
View this message in context: 
http://opensips-open-sip-server.1449251.n2.nabble.com/Presence-server-Using-domain-name-instead-of-IP-address-tp7599676p7599742.html
Sent from the OpenSIPS - Users mailing list archive at Nabble.com.

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


Re: [OpenSIPS-Users] Presence server: Using domain name instead of IP address

2015-11-03 Thread Nabeel
I don't know if that will work, I haven't tried it myself.
On 3 Nov 2015 20:20, "surya"  wrote:

> Oh Thanks this works.
>
> Few comments back you approved similar lines. Nevermind.
> This also means that now I don't need entry in /etc/hosts.
>
> One more question, can I get IP from env into this file?
>
> Thanks,
>
>
>
>
> --
> View this message in context:
> http://opensips-open-sip-server.1449251.n2.nabble.com/Presence-server-Using-domain-name-instead-of-IP-address-tp7599676p7599742.html
> Sent from the OpenSIPS - Users mailing list archive at Nabble.com.
>
> ___
> 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] CRASH OpenSips 2.2

2015-11-03 Thread Dragomir Haralambiev
Hello,

I have problem with OpenSips 2.2 test.

Here part of Opensips sript and trace log 4 .

reate_dialog("PB");
Nov  3 22:27:08 sbc /sbin/mv[13999]: DBG:dialog:w_create_dialog2: will ping
caller
Nov  3 22:27:08 sbc /sbin/mv[13999]: DBG:dialog:w_create_dialog2: bye on
timeout activated
set_dlg_profile("caller","$fU");
Nov  3 22:27:08 sbc /sbin/mv[13999]: DBG:dialog:link_dlg_profile: Entered
here with hash = 7
$DLG_timeout=$avp(get_maxtime);
Nov  3 22:27:09 sbc /sbin/mv[13989]: DBG:core:handle_sigs: unknown child
process 13999 ended. Ignoring

Here the execution the script stops and Opensips crash.

Can samone help me.

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