Re: [OpenSIPS-Users] How to invok lookup() and get attr from the caller, without side effects?

2016-06-28 Thread Rodrigo Pimenta Carvalho
Hi Johan and Ben. Yes. AVPops is a easy solution. However, it is easy for dada stored in DB. What about data stored in RAM? I'm using db_mode = 0 for module usrloc (so user location is always in RAM). So, if AVPops could extract data from the RAM too, as it does with queries and DB, it

Re: [OpenSIPS-Users] How to invok lookup() and get attr from the caller, without side effects?

2016-06-22 Thread Rodrigo Pimenta Carvalho
Hi Răzvan Crainea. Thank you very much for trying to help me. Yesterday my boss asked me to work in another part of our project. So, I will have to pause this verification for a while. When I return to it, I will check the log. Best regards. RODRIGO PIMENTA CARVALHO Inatel Competence

Re: [OpenSIPS-Users] How to invok lookup() and get attr from the caller, without side effects?

2016-06-22 Thread johan de clercq
Ben is correct. In my opinion, a very easy solution. From: users-boun...@lists.opensips.org [mailto:users-boun...@lists.opensips.org] On Behalf Of Newlin, Ben Sent: Tuesday, June 21, 2016 5:24 PM To: sevpal ; OpenSIPS users mailling list Subject:

Re: [OpenSIPS-Users] How to invok lookup() and get attr from the caller, without side effects?

2016-06-22 Thread Newlin, Ben
It also seems like AVPOPS module [1] may be a good solution here as it has functions to pull data from a database into AVPs based by user. [1] http://www.opensips.org/html/docs/modules/2.2.x/avpops.html Ben Newlin From: on behalf of sevpal

Re: [OpenSIPS-Users] How to invok lookup() and get attr from the caller, without side effects?

2016-06-22 Thread Răzvan Crainea
Hi, Rodrigo! Can you print the $ru variable before and after each lookup() query? Something like: $var(ru) = $ru; xlog("R-URI before caller lookup: $ru\n"); lookup("location", "", "$fu"); # this takes the caller from FROM uri, which I think is more suitable than from contact uri $ru =

Re: [OpenSIPS-Users] How to invok lookup() and get attr from the caller, without side effects?

2016-06-21 Thread Rodrigo Pimenta Carvalho
Hi Sevpal. Yes. That is what I was doing. It worked very well. But, nowadays I'm using db_mode = 0 for usrloc. So, the information is always only in RAM. In this case, the query will return no result. That is why I'm trying to read the attr column from table location, from RAM, and get

Re: [OpenSIPS-Users] How to invok lookup() and get attr from the caller, without side effects?

2016-06-21 Thread sevpal
Hi, have you tried/considered running a simple query on the database and parsing for the information you need? From: Rodrigo Pimenta Carvalho Sent: Tuesday, June 21, 2016 10:39 AM To: OpenSIPS users mailling list Subject: Re: [OpenSIPS-Users] How to invok lookup() and get attr from the

Re: [OpenSIPS-Users] How to invok lookup() and get attr from the caller, without side effects?

2016-06-21 Thread Rodrigo Pimenta Carvalho
Hi Răzvan. I have tried that idea. But that didn't work. The SIP INVITE message is being changed by the OpenSIPS in a wrong way, in my point of view. Do you know some way to save the entire SIP INVITE message before calling lookup() and then make the saved message take place after the

Re: [OpenSIPS-Users] How to invok lookup() and get attr from the caller, without side effects?

2016-06-21 Thread Rodrigo Pimenta Carvalho
Hi Razvan Crainea. I didn't know about this possibility. I will try this idea now. Thank you very much!! Best regards. RODRIGO PIMENTA CARVALHO Inatel Competence Center Software Ph: +55 35 3471 9200 RAMAL 979 De: users-boun...@lists.opensips.org

[OpenSIPS-Users] How to invok lookup() and get attr from the caller, without side effects?

2016-06-20 Thread Rodrigo Pimenta Carvalho
Dear OpenSIPS-users, The table location has the column attr where I use to store specific additional information for each registration. Whenever A calls B, I have to read this specific information from the A record and from the B record. That is, I need to get and handle specific information