[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 
about the caller and callee.


For the callee, I use to invoke the lookup("location") function that put the 
needed information in the attr_avp. That is good and works very well. Then, I 
just have to read the attr_avp to get such specific information.


For the caller, I use to invoke:


$var(aorChamador) = $(ct.fields(uri));

lookup("location","","$var(aorChamador)");


However it causes amazing side effect in the SIP signaling. Ex: When A calls B, 
B stays quiet and A rings. So A can answer A. Crazy!

According to the documentation, lookup will overwritten the Request-URI. I 
guess that is why the SIP signaling become incoherent.


How could I get the caller attr specific information without side effects?


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] CURL library with respect to REST_API calls

2016-06-20 Thread Ramachandran, Agalya (Contractor)
Hi team,

I have a question regarding curl library behavior with respect to 
curl_easy_perform API call.
Here is the snippet of the code that am using in "rest_put" API call in 
rest_methods.c file

  w_curl_easy_setopt(handle, CURLOPT_WRITEFUNCTION, write_func);
 w_curl_easy_setopt(handle, CURLOPT_WRITEDATA, &res_body);

When curl_easy_perform API call is success, I could able to retrieve the result 
body from the res_body.
But in the case of API call failure am not getting any details of the message. 
But getting only the http response code.
Is there a way to get the message details as well in the case where 
curl_easy_perform API fails?

LM_INFO(" Actual result body is %s\n", res_body.s);
When I print this, in the case of success, am getting a http response message 
in detail.
But in case of failure, the call back function write_func is not at all called. 
Why it is so?

Please guide me if there is a way to the message details in case of failure too.

Regards,
Agalya

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


[OpenSIPS-Users] DNS-SRV query in opensips

2016-06-20 Thread Ramachandran, Agalya (Contractor)
Hi team,

We are using opensips for our project requirements.
I have a scenario where we need DNS-SRV query and the result of this should be 
placed as the desturi to send request out.(In case of forking call)
As far as I went through opensips documentation, there are some core parameters 
for dns related config such as 
"dns_retr_time"
 
,"dns_retr_time"
 
,"dns_servers_no"
 etc...
According to my understanding these config variables can be declared and used 
in the opensips.config file to control the settings of DNS query.

Is there any available function where I can use and pass the DNS server domain 
name, so that it fetches the IP address of the host ?
Please let us know what is the best way to achieve this?

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