Re: [OpenSIPS-Users] multiple retransmissions on 4XX after ACK [Solved]

2016-10-31 Thread Newlin, Ben
So you are saying the issue has been resolved by performing matching on the ACK?

If not, I would still need a full transaction trace. Many components of the ACK 
for a failure response are dependent on fields in the initial INVITE, which was 
not included.


Ben Newlin

From:  on behalf of Richard Robson 

Organization: Greenlight Innovation
Reply-To: OpenSIPS users mailling list 
Date: Wednesday, October 12, 2016 at 8:08 AM
To: "users@lists.opensips.org" 
Subject: Re: [OpenSIPS-Users] multiple retransmissions on 4XX after ACK [Solved]

OK, I am using topolgy hiding and checking for this but the ACK wasn't being 
handled in the topology_hiding_match

On 11/10/2016 14:04, Richard Robson wrote:
Does this help?

4XX

2016/10/11 14:02:44.810905 192.168.36.141:5060 -> 192.168.36.68:5060
SIP/2.0 487 Request Terminated
Via: SIP/2.0/UDP 
192.168.36.68:5060;received=192.168.36.68;rport=5060;branch=z9hG4bK789668db
From: 
;tag=as04ad0c35
To: 
;tag=as3154cbe9
Call-ID: 
7f643eb34e5355e54575f8ec391740d3@192.168.36.68:5060
CSeq: 103 INVITE
Server: FPBX-12.0.76.4(11.5.1)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, 
PUBLISH
Supported: replaces, timer
Content-Length: 0


ACK

2016/10/11 14:02:44.811879 192.168.36.68:5060 -> 192.168.36.141:5060
ACK sip:441382250630@141.170.9.156:5060;did=a8f.46c3a1f1 SIP/2.0
Via: SIP/2.0/UDP 192.168.36.68:5060;branch=z9hG4bK789668db;rport
Max-Forwards: 70
From: 
;tag=as04ad0c35
To: 
;tag=as3154cbe9
Contact: 

Call-ID: 
7f643eb34e5355e54575f8ec391740d3@192.168.36.68:5060
CSeq: 103 ACK
User-Agent: FPBX-12.0.76.4(11.5.1)
Content-Length: 0


Regards,

Richard


On 10/10/2016 17:52, Newlin, Ben wrote:
It’s impossible to say whether the ACK or the 4XX response are formatted 
properly from just seeing the ACK. The entire transaction is necessary.


Ben Newlin

From: 
 on 
behalf of Richard Robson 

Organization: Greenlight Innovation
Reply-To: OpenSIPS users mailling list 

Date: Monday, October 10, 2016 at 12:33 PM
To: OpenSIPS users mailling list 

Subject: Re: [OpenSIPS-Users] multiple retransmissions on 4XX after ACK

Hi All

I've made tha call from an internal machine and opensips still appears to 
ignore the ACKs

The ACK looks to be OK

2016/10/10 17:28:20.183387 192.168.36.92:5060 -> 192.168.36.141:5060
ACK sip:01382250631@192.168.36.141 SIP/2.0
Via: SIP/2.0/UDP 192.168.36.92:5060;branch=z9hG4bK665e6330;rport
Max-Forwards: 70
From: 
;tag=as27a256cc
To: 
;tag=gK0ca8d98e
Contact: 

Call-ID: 
259bb5f7748fc7fe68eaf1c95a70f5ec@192.168.36.92:5060
CSeq: 103 ACK
User-Agent: FPBX-12.0.76.2(11.7.0)
Content-Length: 0

this is from an asterisk box in response to a 404 from the Opensips Box.
Opensips sends several 404s and there are ACKs to the fist four and it still 
sends subsequebt ones
Regards

Richard

On 07/10/2016 19:46, Richard Robson wrote:

The ack is from the cp. opensips is sending the 4xx.
I'll try the same on another provider. Thanks for the info

On 7 Oct 2016 18:27, "Newlin, Ben" 
mailto:ben.new...@inin.com>> wrote:
The most likely cause is that there is something wrong in the format of the ACK 
which is causing the far end to not recognize it as being the ACK for that 4XX 
response. So the far end will continue to retransmit the 4XX response. On the 
OpenSIPS side, these are recognized as retransmissions so the previous response 
is resent without triggering the failure route.

The reason it happens on 4XX but not on 200 OK is that ACKs within a dialog – 
for 200 OK responses to INVITE or BYE – are actually requests themselves and 
are sent end-to-end just like INVITEs and BYEs. These ACKs are constructed 
following the rules for any request within a dialog [1].

ACKs to failure responses, however, are transmitted at the transaction layer 
which means in this case they are being generated by OpenSIPS directly. 
Transactional ACKs are not requests and the rules for constructing them are 
different [2]. The most important parts are that the Via and Request-URI 
headers must match those in the initial request exactly.

I have encountered this problem several times when my manipulations of messages 
in the routing script cause the ACKs to be malformed. I would suggest capturing 
a SIP trace of the failing transaction and verify the ACK is constructed 
properly.

[1] https://tools.ietf.org/html/rfc3261#section-12.2.1.1
[2] https://tools.ietf.org/html/rfc3261#section-17.1.1.3

Ben Newlin

From: 
mailto:users-boun...@lists.opensips.org>> on 
behalf of Richard Robson 
mailto:rrob...@greenlightcrm.com>>
Organization: Greenlight Innovation
Reply-To: OpenSIPS users mailling list 
mailto:users@lists.opensips.org>>
Date: Friday, October 7, 2016 at 12:46 

Re: [OpenSIPS-Users] OpenSIPS performance.

2016-10-31 Thread Liviu Chircu

> memory usage is 2.8% out of 16GB

OpenSIPS uses a fixed, pre-allocated pool of memory, and system memory 
will always stay constant!


This is the correct way to monitor OpenSIPS memory usage:

opensipsctl fifo get_statistics shmem: pkmem:

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 27.10.2016 22:22, Ramachandran, Agalya (Contractor) wrote:
memory usage is 2.8% out of 16GB. 


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


[OpenSIPS-Users] Can I read "$(avp(attr)[$T_branch_idx])" in "branch_route[per_branch_ops]" ??

2016-10-31 Thread Rodrigo Pimenta Carvalho

Hi.


In my project with OpenSIPS, I have the following kind of code in the 
configuration:


modparam("registrar", "attr_avp", "$avp(attr)")

.

.

.

if register request come from machine M1 {

   $avp(attr) = "User in M1"; //this mean that the user is behind a NAT, from 
the point of view OpenSIPS.

}

if register request come from machine M2 {

   $avp(attr) = "User in M2";

}

...

else{

  $avp(attr) = "User in Mx"; //this mean that there is no NAT.

}




In my opensips.cfg file I need read "$(avp(attr)[$T_branch_idx])" in the 
"branch_route[per_branch_ops]" .


Does $(avp(attr)[$T_branch_idx]) will give me the correct value, even if the 
callee is always online in several machines (M1, M2...etc) ?


So, can I discover which machine is participating in the dialog?


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 read "$(avp(attr)[$T_branch_idx])" in "branch_route[per_branch_ops]" ??

2016-10-31 Thread Liviu Chircu
Yes, lookup() will populate the attributes of each branch in your 
"attr_avp", and you can access them through $T_branch_idx within 
branch_route. [1]



[1]: http://www.opensips.org/html/docs/modules/2.3.x/registrar.html#id293909

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 31.10.2016 16:08, Rodrigo Pimenta Carvalho wrote:



Hi.


In my project with OpenSIPS, I have the following kind of code in the 
configuration:



modparam("registrar", "attr_avp", "$avp(attr)")

.

.

.

if register request come from machine M1 {

$avp(attr) = "User in M1"; //this mean that the user is behind a NAT, 
from the point of view OpenSIPS.


}

if register request come from machine M2 {

$avp(attr) = "User in M2";

}

...

else{

$avp(attr) = "User in Mx"; //this mean that there is no NAT.

}




In my opensips.cfg file I need read "$(avp(attr)[$T_branch_idx])" in 
the "branch_route[per_branch_ops]" .



Does $(avp(attr)[$T_branch_idx]) will give me the correct value, even 
if the callee is always online in several machines (M1, M2...etc) ?



So, can I discover which machine is participating in the dialog?


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


[OpenSIPS-Users] Partitions question (drouting)

2016-10-31 Thread Pete Kelly
Hi

I have a scenario whereby I want to query 1 DR group (A) which will imply
another DR group (B) to query.

I then want to loop through the gateways in group B and if all should fail,
I want to continue to loop through the gateways from A.

Obviously if I call do_routing() a second time, I will lose all the gateway
list from the initial lookup.

Can I achieve what I want to to by using partitions?

e.g.

do_routing("A)
do_routing("B...)
use_next_gw("A..)
use_next_gw("B...)
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Partitions question (drouting)

2016-10-31 Thread Liviu Chircu

Hi, Pete!

> if I call do_routing() a second time, I will lose all the gateway 
list from the initial lookup.


Correct.

Failover through multiple partitions like below should definitely work, 
as each partition comes with its unique set of AVPs:


use_next_gw("A..)
use_next_gw("B...)

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 31.10.2016 16:28, Pete Kelly wrote:

Hi

I have a scenario whereby I want to query 1 DR group (A) which will 
imply another DR group (B) to query.


I then want to loop through the gateways in group B and if all should 
fail, I want to continue to loop through the gateways from A.


Obviously if I call do_routing() a second time, I will lose all the 
gateway list from the initial lookup.


Can I achieve what I want to to by using partitions?

e.g.

do_routing("A)
do_routing("B...)
use_next_gw("A..)
use_next_gw("B...)


___
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] Support for https in async

2016-10-31 Thread Ramachandran, Agalya (Contractor)
Hi team,

Have you tried with https://url with async and does that work without issue ?
When I try, resume_async_http_req is called, but crash is occurring at libcurl 
library. So helpless to debug further.
async(rest_put("https://url";, "$fU,$tU,$ci ", "application/json", "$var(body)", 
"$var(ct)", "$var(rcode)"),resume);

My question is crash occring only in my scenario or  OpenSIPS doesn't support 
async as https?
Here is my dump just in case for reference.

#0  0x7f567248da1e in Curl_raw_nequal () from /lib64/libcurl.so.4
#1  0x7f567245bd0f in Curl_checkheaders () from /lib64/libcurl.so.4
#2  0x7f567245d1e5 in Curl_http () from /lib64/libcurl.so.4
#3  0x7f567246db4b in Curl_do () from /lib64/libcurl.so.4
#4  0x7f567247da1b in multi_runsingle () from /lib64/libcurl.so.4
#5  0x7f567247e121 in curl_multi_perform () from /lib64/libcurl.so.4
#6  0x7f56726b75ca in resume_async_http_req (fd=9, msg=0x7f56739c0640 
, _param=0x7f56b3e354d0)
at rest_methods.c:380
#7  0x7f56737771ff in t_resume_async (fd=0x7f56b3e26840, 
param=0x7f567405c3e8) at async.c:125
#8  0x00509975 in handle_io (fm=0x7f56b3e26840, idx=1, event_type=1) at 
net/net_udp.c:267
#9  0x005082b3 in io_wait_loop_epoll (h=0x806e00 <_worker_io>, t=1, 
repeat=0) at net/../io_wait_loop.h:221
#10 0x00509c30 in udp_rcv_loop (si=0x7f56b3dd6808) at net/net_udp.c:308
#11 0x0050a1c8 in udp_start_processes (chd_rank=0x7d30e8 
, startup_done=0x0) at net/net_udp.c:372
#12 0x00492304 in main_loop () at main.c:671
#13 0x00494d8f in main (argc=7, argv=0x7fff38a979f8) at main.c:1261

Regards,
Agalya


From: Ramachandran, Agalya (Contractor)
Sent: Thursday, October 27, 2016 4:24 PM
To: users@lists.opensips.org; 'Liviu Chircu' 
Subject: Support for https in async

Hi team,

Just a quick question.. Does async(), method supports https request?
When I try to use https, resume_async_http_req is called, but I never got the 
response and rather OpenSIPS crashed at libcurl.

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


Re: [OpenSIPS-Users] Can I read "$(avp(attr)[$T_branch_idx])" in "branch_route[per_branch_ops]" ??

2016-10-31 Thread Rodrigo Pimenta Carvalho
Hi Liviu.


Thank you.


That is the point I want to discuss!


According to the example from the documentation, the lookup() is in


route[relay] {

}


However, in my code the lookup() is in


route{


}


Even with lookup() in rout{...}, does it will populate the attributes of each 
branch in my "attr_avp" and I will be able to access them within branch_route?


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 Liviu Chircu 
Enviado: segunda-feira, 31 de outubro de 2016 12:26
Para: users@lists.opensips.org
Assunto: Re: [OpenSIPS-Users] Can I read "$(avp(attr)[$T_branch_idx])" in 
"branch_route[per_branch_ops]" ??


Yes, lookup() will populate the attributes of each branch in your "attr_avp", 
and you can access them through $T_branch_idx within branch_route. [1]


[1]: http://www.opensips.org/html/docs/modules/2.3.x/registrar.html#id293909

Liviu Chircu
OpenSIPS Developer
http://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 31.10.2016 16:08, Rodrigo Pimenta Carvalho wrote:


Hi.


In my project with OpenSIPS, I have the following kind of code in the 
configuration:


modparam("registrar", "attr_avp", "$avp(attr)")

.

.

.

if register request come from machine M1 {

   $avp(attr) = "User in M1"; //this mean that the user is behind a NAT, from 
the point of view OpenSIPS.

}

if register request come from machine M2 {

   $avp(attr) = "User in M2";

}

...

else{

  $avp(attr) = "User in Mx"; //this mean that there is no NAT.

}




In my opensips.cfg file I need read "$(avp(attr)[$T_branch_idx])" in the 
"branch_route[per_branch_ops]" .


Does $(avp(attr)[$T_branch_idx]) will give me the correct value, even if the 
callee is always online in several machines (M1, M2...etc) ?


So, can I discover which machine is participating in the dialog?


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] Support for https in async

2016-10-31 Thread Liviu Chircu

Hi, Agalya!

We have not done any development in that direction, and I assume it 
won't work out of the box, as we need to instruct libcurl on where to 
find the CA certificate before we can expect it to establish the TLS 
connection. As an alternative, we could add the option of disabling 
host/peer verifications like here [1]


[1]: https://curl.haxx.se/libcurl/c/https.html

Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 31.10.2016 16:41, Ramachandran, Agalya (Contractor) wrote:


Hi team,

Have you tried with *https://url*with async and does that work without 
issue ?


When I try, resume_async_http_req is called, but crash is occurring at 
libcurl library. So helpless to debug further.


async(rest_put(*"https://url";, *"$fU,$tU,$ci ", "application/json", 
"$var(body)", "$var(ct)", "$var(rcode)"),resume);


My question is crash occring only in my scenario or  OpenSIPS doesn’t 
support async as https?


Here is my dump just in case for reference.

/#0 0x7f567248da1e in Curl_raw_nequal () from /lib64/libcurl.so.4/

/#1 0x7f567245bd0f in Curl_checkheaders () from /lib64/libcurl.so.4/

/#2 0x7f567245d1e5 in Curl_http () from /lib64/libcurl.so.4/

/#3 0x7f567246db4b in Curl_do () from /lib64/libcurl.so.4/

/#4 0x7f567247da1b in multi_runsingle () from /lib64/libcurl.so.4/

/#5 0x7f567247e121 in curl_multi_perform () from /lib64/libcurl.so.4/

#6 0x7f56726b75ca in resume_async_http_req (fd=9, 
msg=0x7f56739c0640 , _param=0x7f56b3e354d0)


at rest_methods.c:380

#7 0x7f56737771ff in t_resume_async (fd=0x7f56b3e26840, 
param=0x7f567405c3e8) at async.c:125


#8 0x00509975 in handle_io (fm=0x7f56b3e26840, idx=1, 
event_type=1) at net/net_udp.c:267


#9 0x005082b3 in io_wait_loop_epoll (h=0x806e00 <_worker_io>, 
t=1, repeat=0) at net/../io_wait_loop.h:221


#10 0x00509c30 in udp_rcv_loop (si=0x7f56b3dd6808) at 
net/net_udp.c:308


#11 0x0050a1c8 in udp_start_processes (chd_rank=0x7d30e8 
, startup_done=0x0) at net/net_udp.c:372


#12 0x00492304 in main_loop () at main.c:671

#13 0x00494d8f in main (argc=7, argv=0x7fff38a979f8) at 
main.c:1261


Regards,

Agalya

*From:* Ramachandran, Agalya (Contractor)
*Sent:* Thursday, October 27, 2016 4:24 PM
*To:* users@lists.opensips.org; 'Liviu Chircu' 
*Subject:* Support for https in async

Hi team,

Just a quick question.. Does async(), method supports https request?

When I try to use https, resume_async_http_req is called, but I never 
got the response and rather OpenSIPS crashed at libcurl.


Regards,
Agalya



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


[OpenSIPS-Users] Is OpenSIPS a gateway or an application-server?

2016-10-31 Thread Rodrigo Pimenta Carvalho
Hi.


I was reading about "gateway" (RFC 3960) e 
"application-server" (RFC 3959).


In page 4 of RFC 3960 we can see:


"The gateway model is seriously limited in the presence of forking, as 
described in Section 3.1.  Therefore, its use is only acceptable when the User 
Agent (UA) cannot distinguish between early and regular media, as described in 
Section 3.4.  In any other situation (the  majority of UAS), use of the 
application server model described in Section 4 is strongly recommended 
instead.)"


So, I ask:


Is OpenSIPS a kind of gateway or an application-server by default? Or this 
question doesn't make sense here?


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