Re: [OpenSIPS-Users] Async event_route and cachdb_redis

2016-06-22 Thread SamyGo
Thanks Razvan for dedicating time for me.
You can find the output from the given command here:
http://pastebin.com/fh11mkXS



On Wed, Jun 22, 2016 at 12:48 PM, Răzvan Crainea 
wrote:

> Could you run the 'opensipsctl trap' command and paste the output on
> pastebin.
>
> Best regards,
>
> Răzvan Crainea
> OpenSIPS Solutionswww.opensips-solutions.com
>
> On 06/22/2016 07:39 PM, SamyGo wrote:
>
> Yes correct. Async event route even stops to be executed.
> On Jun 22, 2016 12:37, "Răzvan Crainea"  wrote:
>
>> So the patch doesn't do anything but stops triggering the event?
>>
>> Regards,
>>
>> Răzvan Crainea
>> OpenSIPS Solutionswww.opensips-solutions.com
>>
>> On 06/22/2016 07:07 PM, SamyGo wrote:
>>
>> Yeah it only happens at startup. If I start opensips in debug_mode=yes
>> then the error prints for infinite time.
>>
>> With your patch; putting "async" doesn't even call the event route. If I
>> remove async attribute then it works just like before the patch.
>>
>> Regards,
>> Sammy
>>
>>
>> On Wed, Jun 22, 2016 at 3:10 AM, Răzvan Crainea < 
>> raz...@opensips.org> wrote:
>>
>>> Hi, Sammy!
>>>
>>> Does this happen only at startime, or happens during runtime too?
>>>
>>> Regards,
>>>
>>> Răzvan Crainea
>>> OpenSIPS Solutionswww.opensips-solutions.com
>>>
>>> On 06/21/2016 10:57 PM, SamyGo wrote:
>>>
>>> Hi ,
>>>
>>> After recompiling , when I start opensips it gives this error:
>>>
>>> ERROR:event_route:event_route_handler: invalid receive sock info
>>>
>>> The two event routes I have are these:
>>>
>>> event_route[E_UL_CONTACT_INSERT,async] {
>>>
>>> fetch_event_params("aor=$avp(aor);address=$avp(address);received=$avp(received)");
>>> 
>>>  cache_raw_query("redis:group1","HSET
>>> GLOBAL_USER_LOCATION $avp(aor) $var(my_value1)");
>>>
>>> }
>>>
>>> event_route[E_UL_AOR_DELETE,async] {
>>> fetch_event_params("aor=$avp(aor)");
>>> ...
>>> cache_raw_query("redis:group1","DEL GLOBAL_USER_LOCATION
>>> $avp(aor)");
>>>
>>> }
>>>
>>>
>>> Some Xlog lines in both of these routes, nothing seems to be printed
>>> now, no error , no cache data modifications executing..
>>>
>>> I'll see in further detail what is happening and if I find anything
>>> abnormal will reply.
>>>
>>>
>>> Regards.
>>> Sammy
>>>
>>>
>>>
>>>
>>> On Tue, Jun 21, 2016 at 3:40 AM, Răzvan Crainea < 
>>> raz...@opensips.org> wrote:
>>>
 Hi, Sammy!

 Could you try this patch:

 https://gist.github.com/razvancrainea/9d239c82474bb0f1c403b6459dbdb647

 Thanks,

 Răzvan Crainea
 OpenSIPS Solutionswww.opensips-solutions.com

 On 06/19/2016 08:56 PM, SamyGo wrote:

 Hi,
 I'm seeing errors from cachedb_redis module when called in an event
 route in async mode.

 event_route[E_UL_CONTACT_INSERT,async] {
 ...
 cache_raw_query("redis:group1","SET ABC");
 ..

 }

 OpenSIPS throws error stating that redis group1 unavailable

 DBG:core:cachedb_raw_query: from script [redis] - with grp [group1]
 ERROR:core:cachedb_raw_query: failed to get connection for grp name
 [group1]

 I tried same command in main route of reply route, all works normal. if
 I remove the "async" from the event_route definition it works in event
 route.

 Any logical reason why async route don't recognize the connections ?

 Tried with OpenSIPS 2.2 and 2.1 as well, same behavior.


 Regards,
 Sammy



 ___
 Users mailing 
 listUsers@lists.opensips.orghttp://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 
>>> listUsers@lists.opensips.orghttp://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 
>> listUsers@lists.opensips.orghttp://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 
> listUsers@lists.opensips.orghttp://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] CURL library with respect to REST_API calls

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

Any one has any clue on the below topic?

Regards,
Agalya

From: Ramachandran, Agalya (Contractor)
Sent: Monday, June 20, 2016 1:45 PM
To: OpenSIPS users mailling list 
Subject: CURL library with respect to REST_API calls

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, _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


Re: [OpenSIPS-Users] Async event_route and cachdb_redis

2016-06-22 Thread Răzvan Crainea
Could you run the 'opensipsctl trap' command and paste the output on 
pastebin.


Best regards,

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

On 06/22/2016 07:39 PM, SamyGo wrote:


Yes correct. Async event route even stops to be executed.

On Jun 22, 2016 12:37, "Răzvan Crainea" > wrote:


So the patch doesn't do anything but stops triggering the event?

Regards,

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

On 06/22/2016 07:07 PM, SamyGo wrote:

Yeah it only happens at startup. If I start opensips in
debug_mode=yes then the error prints for infinite time.

With your patch; putting "async" doesn't even call the event
route. If I remove async attribute then it works just like before
the patch.

Regards,
Sammy


On Wed, Jun 22, 2016 at 3:10 AM, Răzvan Crainea
> wrote:

Hi, Sammy!

Does this happen only at startime, or happens during runtime too?

Regards,

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

On 06/21/2016 10:57 PM, SamyGo wrote:

Hi ,

After recompiling , when I start opensips it gives this error:

ERROR:event_route:event_route_handler: invalid receive sock info

The two event routes I have are these:

event_route[E_UL_CONTACT_INSERT,async] {

fetch_event_params("aor=$avp(aor);address=$avp(address);received=$avp(received)");

 cache_raw_query("redis:group1","HSET GLOBAL_USER_LOCATION
$avp(aor) $var(my_value1)");

}

event_route[E_UL_AOR_DELETE,async] {
fetch_event_params("aor=$avp(aor)");
...
cache_raw_query("redis:group1","DEL GLOBAL_USER_LOCATION
$avp(aor)");

}


Some Xlog lines in both of these routes, nothing seems to be
printed now, no error , no cache data modifications executing..

I'll see in further detail what is happening and if I find
anything abnormal will reply.


Regards.
Sammy




On Tue, Jun 21, 2016 at 3:40 AM, Răzvan Crainea
> wrote:

Hi, Sammy!

Could you try this patch:


https://gist.github.com/razvancrainea/9d239c82474bb0f1c403b6459dbdb647

Thanks,

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


On 06/19/2016 08:56 PM, SamyGo wrote:

Hi,
I'm seeing errors from cachedb_redis module when called
in an event route in async mode.

event_route[E_UL_CONTACT_INSERT,async] {
...
cache_raw_query("redis:group1","SET ABC");
..

}

OpenSIPS throws error stating that redis group1 unavailable

DBG:core:cachedb_raw_query: from script [redis] - with
grp [group1]
ERROR:core:cachedb_raw_query: failed to get connection
for grp name [group1]

I tried same command in main route of reply route, all
works normal. if I remove the "async" from the
event_route definition it works in event route.

Any logical reason why async route don't recognize the
connections ?

Tried with OpenSIPS 2.2 and 2.1 as well, same behavior.


Regards,
Sammy



___
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



___
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] Async event_route and cachdb_redis

2016-06-22 Thread SamyGo
Yes correct. Async event route even stops to be executed.
On Jun 22, 2016 12:37, "Răzvan Crainea"  wrote:

> So the patch doesn't do anything but stops triggering the event?
>
> Regards,
>
> Răzvan Crainea
> OpenSIPS Solutionswww.opensips-solutions.com
>
> On 06/22/2016 07:07 PM, SamyGo wrote:
>
> Yeah it only happens at startup. If I start opensips in debug_mode=yes
> then the error prints for infinite time.
>
> With your patch; putting "async" doesn't even call the event route. If I
> remove async attribute then it works just like before the patch.
>
> Regards,
> Sammy
>
>
> On Wed, Jun 22, 2016 at 3:10 AM, Răzvan Crainea 
> wrote:
>
>> Hi, Sammy!
>>
>> Does this happen only at startime, or happens during runtime too?
>>
>> Regards,
>>
>> Răzvan Crainea
>> OpenSIPS Solutionswww.opensips-solutions.com
>>
>> On 06/21/2016 10:57 PM, SamyGo wrote:
>>
>> Hi ,
>>
>> After recompiling , when I start opensips it gives this error:
>>
>> ERROR:event_route:event_route_handler: invalid receive sock info
>>
>> The two event routes I have are these:
>>
>> event_route[E_UL_CONTACT_INSERT,async] {
>>
>> fetch_event_params("aor=$avp(aor);address=$avp(address);received=$avp(received)");
>> 
>>  cache_raw_query("redis:group1","HSET
>> GLOBAL_USER_LOCATION $avp(aor) $var(my_value1)");
>>
>> }
>>
>> event_route[E_UL_AOR_DELETE,async] {
>> fetch_event_params("aor=$avp(aor)");
>> ...
>> cache_raw_query("redis:group1","DEL GLOBAL_USER_LOCATION
>> $avp(aor)");
>>
>> }
>>
>>
>> Some Xlog lines in both of these routes, nothing seems to be printed now,
>> no error , no cache data modifications executing..
>>
>> I'll see in further detail what is happening and if I find anything
>> abnormal will reply.
>>
>>
>> Regards.
>> Sammy
>>
>>
>>
>>
>> On Tue, Jun 21, 2016 at 3:40 AM, Răzvan Crainea 
>> wrote:
>>
>>> Hi, Sammy!
>>>
>>> Could you try this patch:
>>>
>>> https://gist.github.com/razvancrainea/9d239c82474bb0f1c403b6459dbdb647
>>>
>>> Thanks,
>>>
>>> Răzvan Crainea
>>> OpenSIPS Solutionswww.opensips-solutions.com
>>>
>>> On 06/19/2016 08:56 PM, SamyGo wrote:
>>>
>>> Hi,
>>> I'm seeing errors from cachedb_redis module when called in an event
>>> route in async mode.
>>>
>>> event_route[E_UL_CONTACT_INSERT,async] {
>>> ...
>>> cache_raw_query("redis:group1","SET ABC");
>>> ..
>>>
>>> }
>>>
>>> OpenSIPS throws error stating that redis group1 unavailable
>>>
>>> DBG:core:cachedb_raw_query: from script [redis] - with grp [group1]
>>> ERROR:core:cachedb_raw_query: failed to get connection for grp name
>>> [group1]
>>>
>>> I tried same command in main route of reply route, all works normal. if
>>> I remove the "async" from the event_route definition it works in event
>>> route.
>>>
>>> Any logical reason why async route don't recognize the connections ?
>>>
>>> Tried with OpenSIPS 2.2 and 2.1 as well, same behavior.
>>>
>>>
>>> Regards,
>>> Sammy
>>>
>>>
>>>
>>> ___
>>> Users mailing 
>>> listUsers@lists.opensips.orghttp://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 
>> listUsers@lists.opensips.orghttp://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 
> listUsers@lists.opensips.orghttp://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] Async event_route and cachdb_redis

2016-06-22 Thread Răzvan Crainea

So the patch doesn't do anything but stops triggering the event?

Regards,

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

On 06/22/2016 07:07 PM, SamyGo wrote:
Yeah it only happens at startup. If I start opensips in debug_mode=yes 
then the error prints for infinite time.


With your patch; putting "async" doesn't even call the event route. If 
I remove async attribute then it works just like before the patch.


Regards,
Sammy


On Wed, Jun 22, 2016 at 3:10 AM, Răzvan Crainea > wrote:


Hi, Sammy!

Does this happen only at startime, or happens during runtime too?

Regards,

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

On 06/21/2016 10:57 PM, SamyGo wrote:

Hi ,

After recompiling , when I start opensips it gives this error:

ERROR:event_route:event_route_handler: invalid receive sock info

The two event routes I have are these:

event_route[E_UL_CONTACT_INSERT,async] {

fetch_event_params("aor=$avp(aor);address=$avp(address);received=$avp(received)");

 cache_raw_query("redis:group1","HSET GLOBAL_USER_LOCATION
$avp(aor) $var(my_value1)");

}

event_route[E_UL_AOR_DELETE,async] {
  fetch_event_params("aor=$avp(aor)");
...
  cache_raw_query("redis:group1","DEL GLOBAL_USER_LOCATION
$avp(aor)");

}


Some Xlog lines in both of these routes, nothing seems to be
printed now, no error , no cache data modifications executing..

I'll see in further detail what is happening and if I find
anything abnormal will reply.


Regards.
Sammy




On Tue, Jun 21, 2016 at 3:40 AM, Răzvan Crainea
> wrote:

Hi, Sammy!

Could you try this patch:

https://gist.github.com/razvancrainea/9d239c82474bb0f1c403b6459dbdb647

Thanks,

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

On 06/19/2016 08:56 PM, SamyGo wrote:

Hi,
I'm seeing errors from cachedb_redis module when called in
an event route in async mode.

event_route[E_UL_CONTACT_INSERT,async] {
...
cache_raw_query("redis:group1","SET ABC");
..

}

OpenSIPS throws error stating that redis group1 unavailable

DBG:core:cachedb_raw_query: from script [redis] - with grp
[group1]
ERROR:core:cachedb_raw_query: failed to get connection for
grp name [group1]

I tried same command in main route of reply route, all works
normal. if I remove the "async" from the event_route
definition it works in event route.

Any logical reason why async route don't recognize the
connections ?

Tried with OpenSIPS 2.2 and 2.1 as well, same behavior.


Regards,
Sammy



___
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



___
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] Async event_route and cachdb_redis

2016-06-22 Thread SamyGo
Yeah it only happens at startup. If I start opensips in debug_mode=yes then
the error prints for infinite time.

With your patch; putting "async" doesn't even call the event route. If I
remove async attribute then it works just like before the patch.

Regards,
Sammy


On Wed, Jun 22, 2016 at 3:10 AM, Răzvan Crainea  wrote:

> Hi, Sammy!
>
> Does this happen only at startime, or happens during runtime too?
>
> Regards,
>
> Răzvan Crainea
> OpenSIPS Solutionswww.opensips-solutions.com
>
> On 06/21/2016 10:57 PM, SamyGo wrote:
>
> Hi ,
>
> After recompiling , when I start opensips it gives this error:
>
> ERROR:event_route:event_route_handler: invalid receive sock info
>
> The two event routes I have are these:
>
> event_route[E_UL_CONTACT_INSERT,async] {
>
> fetch_event_params("aor=$avp(aor);address=$avp(address);received=$avp(received)");
> 
>  cache_raw_query("redis:group1","HSET GLOBAL_USER_LOCATION
> $avp(aor) $var(my_value1)");
>
> }
>
> event_route[E_UL_AOR_DELETE,async] {
> fetch_event_params("aor=$avp(aor)");
> ...
> cache_raw_query("redis:group1","DEL GLOBAL_USER_LOCATION
> $avp(aor)");
>
> }
>
>
> Some Xlog lines in both of these routes, nothing seems to be printed now,
> no error , no cache data modifications executing..
>
> I'll see in further detail what is happening and if I find anything
> abnormal will reply.
>
>
> Regards.
> Sammy
>
>
>
>
> On Tue, Jun 21, 2016 at 3:40 AM, Răzvan Crainea 
> wrote:
>
>> Hi, Sammy!
>>
>> Could you try this patch:
>>
>> https://gist.github.com/razvancrainea/9d239c82474bb0f1c403b6459dbdb647
>>
>> Thanks,
>>
>> Răzvan Crainea
>> OpenSIPS Solutionswww.opensips-solutions.com
>>
>> On 06/19/2016 08:56 PM, SamyGo wrote:
>>
>> Hi,
>> I'm seeing errors from cachedb_redis module when called in an event route
>> in async mode.
>>
>> event_route[E_UL_CONTACT_INSERT,async] {
>> ...
>> cache_raw_query("redis:group1","SET ABC");
>> ..
>>
>> }
>>
>> OpenSIPS throws error stating that redis group1 unavailable
>>
>> DBG:core:cachedb_raw_query: from script [redis] - with grp [group1]
>> ERROR:core:cachedb_raw_query: failed to get connection for grp name
>> [group1]
>>
>> I tried same command in main route of reply route, all works normal. if I
>> remove the "async" from the event_route definition it works in event route.
>>
>> Any logical reason why async route don't recognize the connections ?
>>
>> Tried with OpenSIPS 2.2 and 2.1 as well, same behavior.
>>
>>
>> Regards,
>> Sammy
>>
>>
>>
>> ___
>> Users mailing 
>> listUsers@lists.opensips.orghttp://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 
> listUsers@lists.opensips.orghttp://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] DNS-SRV query in opensips

2016-06-22 Thread Bogdan-Andrei Iancu

Hi,

They are different. RURI is the part in request's first line, while the 
DURI is a an outbound proxy used just to finding the destination at 
network level (it will not be present in the SIP request).


by using the set functions you do not create a new branch, you are just 
changing the RURI and DURI from the default branch. To create a new 
branch you have to use append_branch().


Regards,

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

On 22.06.2016 17:13, Ramachandran, Agalya (Contractor) wrote:


Hi Bogdan,

Request URI and destination URI are one and the same right?

Basically what I understand from the below mail is , we can use both 
seturi and setdsturi to set a new branch.


Am I right?


Regards,
Agalya

*From:*Bogdan-Andrei Iancu [mailto:bog...@opensips.org]
*Sent:* Wednesday, June 22, 2016 3:15 AM
*To:* Ramachandran, Agalya (Contractor) 
*Cc:* OpenSIPS users mailling list 
*Subject:* Re: [OpenSIPS-Users] DNS-SRV query in opensips

Hi Agalya,

seturi() and setdsturi() set the RURI / DestinationURI for the current 
message / branch.


When you do an append_branch() a new branch is stored for 
serial/parallel forking (note that the current branch does not changes 
- this is branch number 1).


So, append_branch() will make a copy of the current branch (RURI, 
DURI, PATH, Forced Socket, etc) and store a new branch for later forking.


Regards,

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

On 21.06.2016 21:08, Ramachandran, Agalya (Contractor) wrote:

Hi Bogdan,

I have a question regarding /seturi/and /setdsturi///function calls.

As far as my understanding, when append_branch() is called, seturi
() is called to set the URI where to fork the call.

I tried by calling only /seturi ()/function call, after
append_branch it was working same behavior as when I used
/setdsturi()/as well.

My question is do we really need /setdsturi /or when is the case
when /setdsturi()/is used.?

Regards,
Agalya

*From:*Bogdan-Andrei Iancu [mailto:bog...@opensips.org]
*Sent:* Tuesday, June 21, 2016 3:41 AM
*To:* OpenSIPS users mailling list >; Ramachandran, Agalya
(Contractor) >; Ramachandran, Agalya
(Contractor) >
*Subject:* Re: [OpenSIPS-Users] DNS-SRV query in opensips

Hi Agalya,

OpenSIPS does full flavor DNS lookup (with NATPR and SRV), but
this is internal, and not accessible from script. OpenSIPS
implements auto DNS-based failover :
http://www.opensips.org/html/docs/modules/2.2.x/tm.html#id293694

My understanding is you want the DNS resolving to be done at
script level and to have access to the results ?

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer

http://www.opensips-solutions.com

On 20.06.2016 20:35, Ramachandran, Agalya (Contractor) wrote:

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



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


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 Center
Software
Ph: +55 35 3471 9200 RAMAL 979



De: users-boun...@lists.opensips.org  em nome 
de Răzvan Crainea 
Enviado: quarta-feira, 22 de junho de 2016 03:57
Para: users@lists.opensips.org
Assunto: Re: [OpenSIPS-Users] How to invok lookup() and get attr from the 
caller, without side effects?

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 = $var(ru);
# continue your processing here
xlog("R-URI after caller lookup: $ru\n");
...
# now do the real lookup for the callee
xlog("R-URI before callee lookup: $ru\n");
lookup("location");
xlog("R-URI after callee lookup: $ru\n");

Make sure they are all correct, or if they are not, send me these logs.

Thanks,


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

Home — OpenSIPS Solutions
www.opensips-solutions.com
OpenSIPS is a mature Open Source implementation of a SIP server. OpenSIPS is 
more than a SIP proxy/router as it includes application-level functionalities.

On 06/21/2016 07:39 PM, Rodrigo Pimenta Carvalho wrote:

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 specific 
information for the caller.


For the callee, everything is all right.


Regards.


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



De: users-boun...@lists.opensips.org 
 em 
nome de sevpal 
Enviado: terça-feira, 21 de junho de 2016 12:20
Para: OpenSIPS users mailling list
Assunto: Re: [OpenSIPS-Users] How to invok lookup() and get attr from the 
caller, without side effects?

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 
caller, without side effects?


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 lookup() 
execution?



My original message is:



INVITE sip:6...@mydomain.com.br SIP/2.0
Via: SIP/2.0/TCP 192.168.21.40:5090;rport;branch=z9hG4bK876727215
From: ;tag=179920819
To: 
Call-ID: 1410250893
CSeq: 21 INVITE
Contact: 

Proxy-Authorization: Digest username="crdphmacl_SPnuV5xqtnSX", 
realm="localhost", nonce="5769458c01cc263a7c0d6995dc48d42288ec6f8e4048", 
uri="sip:6...@mydomain.com.br", response="0f4c122d2a0a28dea6194c235cd77430", 
algorithm=MD5
Content-Type: application/sdp
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, 
INFO
Max-Forwards: 70
User-Agent: Linphone/3.6.1 (eXosip2/4.0.0)
Subject: Phone call
Content-Length:   227


This is being changed to:



INVITE 
sip:crdphmacl_SPnuV5xqtnSX@131.221.240.204:60672;transport=tcp;line=c6356a7d87d6f81
 SIP/2.0
Record-Route: 
Via: SIP/2.0/TCP myDomain.com.br:5060;branch=z9hG4bKe2db.49d54587.0;i=1
Via: SIP/2.0/TCP 
192.168.21.40:5090;received=xxx.yyy.240.204;rport=60672;branch=z9hG4bK716249970
From: ;tag=12586028
To: 
Call-ID: 1106771604
CSeq: 21 INVITE
Contact: 
Content-Type: application/sdp
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, 
INFO
Max-Forwards: 

Re: [OpenSIPS-Users] Leak AVPOS + SQLITE

2016-06-22 Thread Rodrigo Pimenta Carvalho
Ok.


Thank you very much!


Regards.


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



De: users-boun...@lists.opensips.org  em nome 
de Razvan Crainea 
Enviado: quarta-feira, 22 de junho de 2016 04:04
Para: users@lists.opensips.org
Assunto: Re: [OpenSIPS-Users] Leak AVPOS + SQLITE


Hi, Rodrigo!


Valgrind may report some memory allocated, and not freed, but that is not 
necessarily a memory leak. There is a single block of 1024 bytes not freed 
during runtime, so I think that is peanuts. The memory used by OpenSIPS is not 
allocated with malloc, so cannot be traced by valgrind.

Regarding the system memory, it is normal to decrease as OpenSIPS uses that 
memory during runtime. However, after some time, this should  stabilize. 
Anyhow, sometimes the system memory might generate false alarms, so if you are 
tracing any memory leaks, you should check OpenSIPS's internal statistics.


Best regards,

Razvan Crainea
OpenSIPS Solutions
www.opensips-solutions.com

Home - OpenSIPS Solutions
www.opensips-solutions.com
OpenSIPS is a mature Open Source implementation of a SIP server. OpenSIPS is 
more than a SIP proxy/router as it includes application-level functionalities.

On 06/21/2016 10:38 PM, Rodrigo Pimenta Carvalho wrote:

Hi.


Does someone here is getting/handling memory leaks with OpenSIPS 2.2 and last 
version of SQLite?

I'm using newest commit from OpenSIPS 2.2 and newest version of SQLite.


My query is :


avp_db_query("select Value from GeneralConfigurations where Attribute = 
'CONFIGURATION_INTERCOM_A_NAME'");


Valgrind shows:


==16087== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)

==16088== Searching for pointers to 296,489 not-freed blocks

==16088== Checked 103,297,688 bytes

==16088==

==16088== 1,024 bytes in 1 blocks are possibly lost in loss record 184 of 246

==16088==at 0x4C2745D: malloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)

==16088==by 0x8F8B05F: sqlite3MemMalloc (sqlite3.c:20167)

==16088==by 0x8F701C7: sqlite3Malloc (sqlite3.c:23846)

==16088==by 0x8F75459: pcache1Alloc (sqlite3.c:44312)

==16088==by 0x8F8019F: sqlite3BtreeCursor (sqlite3.c:44455)

==16088==by 0x8FD0FDD: sqlite3VdbeExec (sqlite3.c:80098)

==16088==by 0x8FDB89F: sqlite3_step (sqlite3.c:75131)

==16088==by 0x8FDC9A1: sqlite3_exec (sqlite3.c:108122)

==16088==by 0x8D20736: db_sqlite_raw_query (dbase.c:358)

==16088==by 0x9464DB8: db_query_avp (avpops_db.c:436)

==16088==by 0x946943E: ops_dbquery_avps (avpops_impl.c:840)

==16088==by 0x9459A61: w_dbquery_avps (avpops.c:1395)

==16088==

==16088== LEAK SUMMARY:

==16088==definitely lost: 0 bytes in 0 blocks

==16088==indirectly lost: 0 bytes in 0 blocks

==16088==  possibly lost: 1,024 bytes in 1 blocks

==16088==still reachable: 47,457,573 bytes in 296,488 blocks

==16088== suppressed: 0 bytes in 0 blocks

==16088== Reachable blocks (those to which a pointer was found) are not shown.

==16088== To see them, rerun with: --leak-check=full --show-leak-kinds=all



After some time running that query, I can see, via command top, that the 
available memory is decreasing.

In fact, the memory is not freed even after stop running the query for a time.


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


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


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?

 

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  >
Reply-To: sevpal  >, OpenSIPS users 
mailling list  >
Date: Tuesday, June 21, 2016 at 11:20 AM
To: OpenSIPS users mailling list  >
Subject: Re: [OpenSIPS-Users] How to invok lookup() and get attr from the 
caller, without side effects?

 

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 
caller, without side effects?

 

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 lookup() 
execution?

 

My original message is:

 

INVITE sip:6...@mydomain.com.br SIP/2.0
Via: SIP/2.0/TCP 192.168.21.40:5090;rport;branch=z9hG4bK876727215
From: ;tag=179920819
To: 
Call-ID: 1410250893
CSeq: 21 INVITE
Contact: 
Proxy-Authorization: Digest username="crdphmacl_SPnuV5xqtnSX", 
realm="localhost", nonce="5769458c01cc263a7c0d6995dc48d42288ec6f8e4048", 
uri="sip:6...@mydomain.com.br", response="0f4c122d2a0a28dea6194c235cd77430", 
algorithm=MD5
Content-Type: application/sdp
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, 
INFO
Max-Forwards: 70
User-Agent: Linphone/3.6.1 (eXosip2/4.0.0)
Subject: Phone call
Content-Length:   227

 

This is being changed to:

 

INVITE 
sip:crdphmacl_SPnuV5xqtnSX@131.221.240.204:60672;transport=tcp;line=c6356a7d87d6f81
 SIP/2.0
Record-Route: 
Via: SIP/2.0/TCP myDomain.com.br:5060;branch=z9hG4bKe2db.49d54587.0;i=1
Via: SIP/2.0/TCP 
192.168.21.40:5090;received=xxx.yyy.240.204;rport=60672;branch=z9hG4bK716249970
From: ;tag=12586028
To: 
Call-ID: 1106771604
CSeq: 21 INVITE
Contact: 
Content-Type: application/sdp
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, 
INFO
Max-Forwards: 70
User-Agent: Linphone/3.6.1 (eXosip2/4.0.0)
Subject: Phone call
Content-Length:   224

 

So, the caller is receiving its own SIP INVITE.

That is why when A calls B, is A that rings, not B.

 

It is becoming a bit complicated. So, I suspect I'm going to the incorrect 
direction 

 

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 Răzvan Crainea  >
Enviado: terça-feira, 21 de junho de 2016 04:24
Para: users@lists.opensips.org  
Assunto: Re: [OpenSIPS-Users] How to invok lookup() and get attr from the 
caller, without side effects? 

 

Hi, Rodrigo!

 

Have you tried restoring the R-URI after the caller lookup? Something like:

 

$var(ru) = $ru;

lookup("location", "", "$fu"); # this takes the caller from FROM uri, which I 
think is more suitable than from contact uri

$ru = $var(ru);

# continue your processing here



# now do the real lookup for the callee

lookup("location");

 

Don't do the lookups in the reversed way, because you might loose some contacts.

 

Best regards,

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


  Home — OpenSIPS Solutions

www.opensips-solutions.com  

OpenSIPS is a mature Open Source 

Re: [OpenSIPS-Users] webrtc native client for opensips

2016-06-22 Thread John Nash
OK but in this i will not have control over webrtc codecs. What I am
looking for is ...

1- Native application can send SIP messages over wss.
2- For media instead of using chrome functions , use my custom webrtc (
https://webrtc.org/native-code/ios/) which I use as library

I am not even sure at this point if I am making sense.

On Wed, Jun 22, 2016 at 3:23 PM, Tito Cumpen  wrote:

> If you intend on running on android and iOS restcomm appears to have
> native clients that support sip over websocket . I've tested the iOS app
> they with OpenSIPS and baseline functionality was there .
> https://github.com/RestComm/restcomm-android-sdk
> On Jun 22, 2016 5:34 AM, "John Nash"  wrote:
>
>> My objective is to make a native webrtc application which can use SIP
>> over wss for signalling and for media also I do not want to be dependent on
>> chrome as in future I wish to incorporate more codecs into it.
>>
>> Any pointers for me?
>>
>> On Wed, Jun 22, 2016 at 2:55 PM, Tito Cumpen  wrote:
>>
>>> John,
>>>
>>> You can utilize sipjs and jssip on account that they utilize sip over
>>> websocket. Take into consideration that chrome will only allow getusermedia
>>> if you are using wss and https .
>>> On Jun 22, 2016 3:07 AM, "John Nash"  wrote:
>>>
 Apart from sipml5 is there any native webrtc client also which I can
 explore to work with opensips?

 The examples I find for webrtc native seem to be using jingle protocol
 but in case to make it work with opensips, It has to use SIP/SDP at client
 end right?..Any examples?

 ___
 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
>>
>>
> ___
> 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] webrtc native client for opensips

2016-06-22 Thread Tito Cumpen
If you intend on running on android and iOS restcomm appears to have native
clients that support sip over websocket . I've tested the iOS app they with
OpenSIPS and baseline functionality was there .
https://github.com/RestComm/restcomm-android-sdk
On Jun 22, 2016 5:34 AM, "John Nash"  wrote:

> My objective is to make a native webrtc application which can use SIP over
> wss for signalling and for media also I do not want to be dependent on
> chrome as in future I wish to incorporate more codecs into it.
>
> Any pointers for me?
>
> On Wed, Jun 22, 2016 at 2:55 PM, Tito Cumpen  wrote:
>
>> John,
>>
>> You can utilize sipjs and jssip on account that they utilize sip over
>> websocket. Take into consideration that chrome will only allow getusermedia
>> if you are using wss and https .
>> On Jun 22, 2016 3:07 AM, "John Nash"  wrote:
>>
>>> Apart from sipml5 is there any native webrtc client also which I can
>>> explore to work with opensips?
>>>
>>> The examples I find for webrtc native seem to be using jingle protocol
>>> but in case to make it work with opensips, It has to use SIP/SDP at client
>>> end right?..Any examples?
>>>
>>> ___
>>> 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
>
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] webrtc native client for opensips

2016-06-22 Thread John Nash
My objective is to make a native webrtc application which can use SIP over
wss for signalling and for media also I do not want to be dependent on
chrome as in future I wish to incorporate more codecs into it.

Any pointers for me?

On Wed, Jun 22, 2016 at 2:55 PM, Tito Cumpen  wrote:

> John,
>
> You can utilize sipjs and jssip on account that they utilize sip over
> websocket. Take into consideration that chrome will only allow getusermedia
> if you are using wss and https .
> On Jun 22, 2016 3:07 AM, "John Nash"  wrote:
>
>> Apart from sipml5 is there any native webrtc client also which I can
>> explore to work with opensips?
>>
>> The examples I find for webrtc native seem to be using jingle protocol
>> but in case to make it work with opensips, It has to use SIP/SDP at client
>> end right?..Any examples?
>>
>> ___
>> 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] webrtc native client for opensips

2016-06-22 Thread Tito Cumpen
John,

You can utilize sipjs and jssip on account that they utilize sip over
websocket. Take into consideration that chrome will only allow getusermedia
if you are using wss and https .
On Jun 22, 2016 3:07 AM, "John Nash"  wrote:

> Apart from sipml5 is there any native webrtc client also which I can
> explore to work with opensips?
>
> The examples I find for webrtc native seem to be using jingle protocol but
> in case to make it work with opensips, It has to use SIP/SDP at client end
> right?..Any examples?
>
> ___
> 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] 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 
Reply-To: sevpal , OpenSIPS users mailling list 

Date: Tuesday, June 21, 2016 at 11:20 AM
To: OpenSIPS users mailling list 
Subject: Re: [OpenSIPS-Users] How to invok lookup() and get attr from the 
caller, without side effects?

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 
caller, without side effects?


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 lookup() 
execution?



My original message is:


INVITE sip:6...@mydomain.com.br SIP/2.0
Via: SIP/2.0/TCP 192.168.21.40:5090;rport;branch=z9hG4bK876727215
From: ;tag=179920819
To: 
Call-ID: 1410250893
CSeq: 21 INVITE
Contact: 
Proxy-Authorization: Digest username="crdphmacl_SPnuV5xqtnSX", 
realm="localhost", nonce="5769458c01cc263a7c0d6995dc48d42288ec6f8e4048", 
uri="sip:6...@mydomain.com.br", response="0f4c122d2a0a28dea6194c235cd77430", 
algorithm=MD5
Content-Type: application/sdp
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, 
INFO
Max-Forwards: 70
User-Agent: Linphone/3.6.1 (eXosip2/4.0.0)
Subject: Phone call
Content-Length:   227


This is being changed to:


INVITE 
sip:crdphmacl_SPnuV5xqtnSX@131.221.240.204:60672;transport=tcp;line=c6356a7d87d6f81
 SIP/2.0
Record-Route: 
Via: SIP/2.0/TCP myDomain.com.br:5060;branch=z9hG4bKe2db.49d54587.0;i=1
Via: SIP/2.0/TCP 
192.168.21.40:5090;received=xxx.yyy.240.204;rport=60672;branch=z9hG4bK716249970
From: ;tag=12586028
To: 
Call-ID: 1106771604
CSeq: 21 INVITE
Contact: 
Content-Type: application/sdp
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, 
INFO
Max-Forwards: 70
User-Agent: Linphone/3.6.1 (eXosip2/4.0.0)
Subject: Phone call
Content-Length:   224



So, the caller is receiving its own SIP INVITE.

That is why when A calls B, is A that rings, not B.



It is becoming a bit complicated. So, I suspect I'm going to the incorrect 
direction



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 Răzvan Crainea 
Enviado: terça-feira, 21 de junho de 2016 04:24
Para: users@lists.opensips.org
Assunto: Re: [OpenSIPS-Users] How to invok lookup() and get attr from the 
caller, without side effects?


Hi, Rodrigo!



Have you tried restoring the R-URI after the caller lookup? Something like:



$var(ru) = $ru;

lookup("location", "", "$fu"); # this takes the caller from FROM uri, which I 
think is more suitable than from contact uri

$ru = $var(ru);

# continue your processing here



# now do the real lookup for the callee

lookup("location");



Don't do the lookups in the reversed way, because you might loose some contacts.



Best regards,

Răzvan Crainea

OpenSIPS Solutions

www.opensips-solutions.com
Home — OpenSIPS Solutions
www.opensips-solutions.com
OpenSIPS is a mature Open Source implementation of a SIP server. OpenSIPS is 
more than a SIP proxy/router as it includes application-level functionalities.

On 06/20/2016 09:02 PM, Rodrigo Pimenta Carvalho wrote:

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) = 

Re: [OpenSIPS-Users] B2BUA not responding to reinvites

2016-06-22 Thread Kevin Stewart
After some stracing of opensips I found that the reinvites where not making it 
to opensips then tracked the issue down to fail2ban :/


solution:

aptitude remove ufw fail2ban

I am going back to hand crafted iptables rules []


thanks for the help.


Kevin


From: users-boun...@lists.opensips.org  on 
behalf of Bogdan-Andrei Iancu 
Sent: Tuesday, 14 June 2016 9:53:53 p.m.
To: OpenSIPS users mailling list; Kevin Stewart
Subject: Re: [OpenSIPS-Users] B2BUA not responding to reinvites

Hello Kevin,

Once the B2B session started, the sequential request will not land to your 
script as they will be captured by B2B before the script (and handled according 
to the XML script).

Still, with debug level 6 you should see various messages from OpenSIPS when 
the B2B would handle the re-INVITE.

Are you sure the re-INVITE is actually reaching OpenSIPS on the right IP and 
port ?

Regards,

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

On 14.06.2016 09:49, Kevin Stewart wrote:
I am trying to implement a simple topology hiding B2BUA with opensips 1.11.5

most things work except that re invites for session expiry are being ignored.

I assume that I am missing something in my config.

the strange thing is that I see no debug to syslog when the Invites come in 
even with debug set to 9.

the basic config is a client on port 5061 (C) inviting the B2BUA on port 
5066(B) with then invites the main server on another host on port 5060(A).
I do not expect and inbount calls from A

C invites B, B invites A all proceeds normally until after 15 minutes A invites 
B and is ignored then sends bye a number of times.
none of the reinvites or byes are reported in the logs.

C then hangs up sending a bye to B, B sends a bye to A and gets 481 Unknown 
Dialog.

below is my config

route{
if ( !mf_process_maxfwd_header("10") )
{
sl_send_reply("483","To Many Hops");
drop();
};

if (is_method("OPTIONS"))
{
#xlog("L_NOTICE", "$ci|end|unsupported method");
sl_send_reply("404", "Not found");
exit;
}

if(is_method("INVITE")){
xlog("L_NOTICE","got invite");
if($sp=="5061"){
xlog("L_NOTICE","got invite 5061");
xlog("L_NOTICE","[$mi] before B2B request\n");
$ru="sip:"+$tU+"@172.22.2.140:5060";
b2b_init_request("top hiding");
xlog("L_INFO","[$mi] after B2B request\n");
}else{
xlog("L_NOTICE","got invite $sp");
xlog("L_INFO","[$mi] not from 5061\n");
}
exit;
}else{
xlog("L_ERR","got request method $rm from $si: $fU, $tU");
sl_send_reply("501", "Not Implemented");
exit;
}
}

Kevin Stewart|  Senior VOIP Network Engineer

D:  +64 9 919 6120E:  
 
kevin.stew...@m2group.co.nz

M:  +64 21 879 057W:  
vocus.co.nz

A:  PO Box 108-109, Symonds St, Auckland 1150


[cid:part5.09070902.08000600@opensips.org]






Kevin Stewart | Senior VOIP Network Engineer
D: +64 9 919 6120E: kevin.stew...@m2group.co.nz
M: +64 21 879 057W: vocus.co.nz
A: PO Box 108-109, Symonds St, Auckland 1150

___
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] DNS-SRV query in opensips

2016-06-22 Thread Bogdan-Andrei Iancu

Hi Agalya,

seturi() and setdsturi() set the RURI / DestinationURI for the current 
message / branch.


When youdo an append_branch() a new branch is stored for serial/parallel 
forking (note that the current branch does not changes - this is branch 
number 1).


So, append_branch() will make a copy of the current branch (RURI, DURI, 
PATH, Forced Socket, etc) and store a new branch for later forking.


Regards,

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

On 21.06.2016 21:08, Ramachandran, Agalya (Contractor) wrote:


Hi Bogdan,

I have a question regarding /seturi/and /setdsturi///function calls.

As far as my understanding, when append_branch() is called, seturi () 
is called to set the URI where to fork the call.


I tried by calling only /seturi ()/function call, after append_branch 
it was working same behavior as when I used /setdsturi()/as well.


My question is do we really need /setdsturi /or when is the case when 
/setdsturi()/is used.?


Regards,
Agalya

*From:*Bogdan-Andrei Iancu [mailto:bog...@opensips.org]
*Sent:* Tuesday, June 21, 2016 3:41 AM
*To:* OpenSIPS users mailling list >; Ramachandran, Agalya (Contractor) 
>; Ramachandran, Agalya 
(Contractor) >

*Subject:* Re: [OpenSIPS-Users] DNS-SRV query in opensips

Hi Agalya,

OpenSIPS does full flavor DNS lookup (with NATPR and SRV), but this is 
internal, and not accessible from script. OpenSIPS implements auto 
DNS-based failover :

http://www.opensips.org/html/docs/modules/2.2.x/tm.html#id293694

My understanding is you want the DNS resolving to be done at script 
level and to have access to the results ?


Regards,

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

On 20.06.2016 20:35, Ramachandran, Agalya (Contractor) wrote:

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



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


Re: [OpenSIPS-Users] Async event_route and cachdb_redis

2016-06-22 Thread Răzvan Crainea

Hi, Sammy!

Does this happen only at startime, or happens during runtime too?

Regards,

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

On 06/21/2016 10:57 PM, SamyGo wrote:

Hi ,

After recompiling , when I start opensips it gives this error:

ERROR:event_route:event_route_handler: invalid receive sock info

The two event routes I have are these:

event_route[E_UL_CONTACT_INSERT,async] {
fetch_event_params("aor=$avp(aor);address=$avp(address);received=$avp(received)");

 cache_raw_query("redis:group1","HSET GLOBAL_USER_LOCATION $avp(aor) 
$var(my_value1)");


}

event_route[E_UL_AOR_DELETE,async] {
fetch_event_params("aor=$avp(aor)");
...
cache_raw_query("redis:group1","DEL GLOBAL_USER_LOCATION $avp(aor)");

}


Some Xlog lines in both of these routes, nothing seems to be printed 
now, no error , no cache data modifications executing..


I'll see in further detail what is happening and if I find anything 
abnormal will reply.



Regards.
Sammy




On Tue, Jun 21, 2016 at 3:40 AM, Răzvan Crainea > wrote:


Hi, Sammy!

Could you try this patch:

https://gist.github.com/razvancrainea/9d239c82474bb0f1c403b6459dbdb647

Thanks,

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

On 06/19/2016 08:56 PM, SamyGo wrote:

Hi,
I'm seeing errors from cachedb_redis module when called in an
event route in async mode.

event_route[E_UL_CONTACT_INSERT,async] {
...
cache_raw_query("redis:group1","SET ABC");
..

}

OpenSIPS throws error stating that redis group1 unavailable

DBG:core:cachedb_raw_query: from script [redis] - with grp [group1]
ERROR:core:cachedb_raw_query: failed to get connection for grp
name [group1]

I tried same command in main route of reply route, all works
normal. if I remove the "async" from the event_route definition
it works in event route.

Any logical reason why async route don't recognize the connections ?

Tried with OpenSIPS 2.2 and 2.1 as well, same behavior.


Regards,
Sammy



___
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


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


[OpenSIPS-Users] webrtc native client for opensips

2016-06-22 Thread John Nash
Apart from sipml5 is there any native webrtc client also which I can
explore to work with opensips?

The examples I find for webrtc native seem to be using jingle protocol but
in case to make it work with opensips, It has to use SIP/SDP at client end
right?..Any examples?
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Leak AVPOS + SQLITE

2016-06-22 Thread Răzvan Crainea

Hi, Rodrigo!


Valgrind may report some memory allocated, and not freed, but that is 
not necessarily a memory leak. There is a single block of 1024 bytes not 
freed during runtime, so I think that is peanuts. The memory used by 
OpenSIPS is not allocated with malloc, so cannot be traced by valgrind.


Regarding the system memory, it is normal to decrease as OpenSIPS uses 
that memory during runtime. However, after some time, this should 
stabilize. Anyhow, sometimes the system memory might generate false 
alarms, so if you are tracing any memory leaks, you should check 
OpenSIPS's internal statistics.



Best regards,

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

On 06/21/2016 10:38 PM, Rodrigo Pimenta Carvalho wrote:


Hi.


Does someone here is getting/handling memory leaks with OpenSIPS 2.2 
and last version of SQLite?


I'm using newest commit from OpenSIPS 2.2 and newest version of SQLite.


My query is :


avp_db_query("select Value from GeneralConfigurations where Attribute 
= 'CONFIGURATION_INTERCOM_A_NAME'");



Valgrind shows:


==16087== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 2 from 2)

==16088== Searching for pointers to 296,489 not-freed blocks

==16088== Checked 103,297,688 bytes

==16088==

==16088== 1,024 bytes in 1 blocks are possibly lost in loss record 184 
of 246


==16088== at 0x4C2745D: malloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)


==16088== by 0x8F8B05F: sqlite3MemMalloc (sqlite3.c:20167)

==16088== by 0x8F701C7: sqlite3Malloc (sqlite3.c:23846)

==16088== by 0x8F75459: pcache1Alloc (sqlite3.c:44312)

==16088== by 0x8F8019F: sqlite3BtreeCursor (sqlite3.c:44455)

==16088== by 0x8FD0FDD: sqlite3VdbeExec (sqlite3.c:80098)

==16088== by 0x8FDB89F: sqlite3_step (sqlite3.c:75131)

==16088== by 0x8FDC9A1: sqlite3_exec (sqlite3.c:108122)

==16088== by 0x8D20736: db_sqlite_raw_query (dbase.c:358)

==16088== by 0x9464DB8: db_query_avp (avpops_db.c:436)

==16088== by 0x946943E: ops_dbquery_avps (avpops_impl.c:840)

==16088== by 0x9459A61: w_dbquery_avps (avpops.c:1395)

==16088==

==16088== LEAK SUMMARY:

==16088== definitely lost: 0 bytes in 0 blocks

==16088== indirectly lost: 0 bytes in 0 blocks

==16088== possibly lost: 1,024 bytes in 1 blocks

==16088== still reachable: 47,457,573 bytes in 296,488 blocks

==16088== suppressed: 0 bytes in 0 blocks

==16088== Reachable blocks (those to which a pointer was found) are 
not shown.


==16088== To see them, rerun with: --leak-check=full --show-leak-kinds=all



After some time running that query, I can see, via command top, that 
the available memory is decreasing.


In fact, the memory is not freed even after stop running the query for 
a time.



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


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


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 = $var(ru);
# continue your processing here
xlog("R-URI after caller lookup: $ru\n");
...
# now do the real lookup for the callee
xlog("R-URI before callee lookup: $ru\n");
lookup("location");
xlog("R-URI after callee lookup: $ru\n");

Make sure they are all correct, or if they are not, send me these logs.

Thanks,

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

On 06/21/2016 07:39 PM, Rodrigo Pimenta Carvalho wrote:


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 specific information for the caller.



For the callee, everything is all right.


Regards.


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



*De:* users-boun...@lists.opensips.org 
 em nome de sevpal 

*Enviado:* terça-feira, 21 de junho de 2016 12:20
*Para:* OpenSIPS users mailling list
*Assunto:* Re: [OpenSIPS-Users] How to invok lookup() and get attr 
from the caller, without side effects?
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 caller, without side effects?


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 
lookup() execution?


My original message is:

INVITE sip:6...@mydomain.com.br SIP/2.0
Via: SIP/2.0/TCP 192.168.21.40:5090;rport;branch=z9hG4bK876727215
From: ;tag=179920819
To: 
Call-ID: 1410250893
CSeq: 21 INVITE
Contact: 
Proxy-Authorization: Digest username="crdphmacl_SPnuV5xqtnSX", 
realm="localhost", 
nonce="5769458c01cc263a7c0d6995dc48d42288ec6f8e4048", 
uri="sip:6...@mydomain.com.br", 
response="0f4c122d2a0a28dea6194c235cd77430", algorithm=MD5

Content-Type: application/sdp
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, 
SUBSCRIBE, INFO

Max-Forwards: 70
User-Agent: Linphone/3.6.1 (eXosip2/4.0.0)
Subject: Phone call
Content-Length: 227

This is being changed to:

INVITE 
sip:crdphmacl_SPnuV5xqtnSX@131.221.240.204:60672;transport=tcp;line=c6356a7d87d6f81 
SIP/2.0
Record-Route: 


Via: SIP/2.0/TCP myDomain.com.br:5060;branch=z9hG4bKe2db.49d54587.0;i=1
Via: SIP/2.0/TCP 
192.168.21.40:5090;received=xxx.yyy.240.204;rport=60672;branch=z9hG4bK716249970

From: ;tag=12586028
To: 
Call-ID: 1106771604
CSeq: 21 INVITE
Contact: 
Content-Type: application/sdp
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, 
SUBSCRIBE, INFO

Max-Forwards: 70
User-Agent: Linphone/3.6.1 (eXosip2/4.0.0)
Subject: Phone call
Content-Length: 224

So, the caller is receiving its own SIP INVITE.

That is why when A calls B, is A that rings, not B.

It is becoming a bit complicated. So, I suspect I'm going to the 
incorrect direction


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 Răzvan Crainea 


*Enviado:* terça-feira, 21 de junho de 2016 04:24
*Para:* users@lists.opensips.org
*Assunto:* Re: [OpenSIPS-Users] How to invok lookup() and get attr 
from the caller, without side effects?


Hi, Rodrigo!


Have you tried restoring the R-URI after the caller lookup? Something 
like:



$var(ru) = $ru;

lookup("location", "", "$fu"); # this takes the caller from FROM uri, 
which I think is more suitable than from contact uri


$ru = $var(ru);

# continue your processing here



# now do the real lookup for the callee

lookup("location");


Don't do the lookups in the reversed way, because you might loose some