Re: [OpenSIPS-Users] Escaping URL parameter values

2019-01-17 Thread CARTWRIGHT, CORY C
Thank you!

From: Users  On Behalf Of Alain Bieuzent
Sent: Thursday, January 17, 2019 10:19
To: OpenSIPS users mailling list 
Subject: Re: [OpenSIPS-Users] Escaping URL parameter values

Hi,


You can use s.escape.user,



https://opensips.org/pipermail/users/2015-September/032545.html



Reagrds


De : Users 
mailto:users-boun...@lists.opensips.org>> au 
nom de "CARTWRIGHT, CORY C" mailto:cc3...@att.com>>
Répondre à : OpenSIPS users mailling list 
mailto:users@lists.opensips.org>>
Date : lundi 14 janvier 2019 à 19:09
À : "users@lists.opensips.org" 
mailto:users@lists.opensips.org>>
Objet : [OpenSIPS-Users] Escaping URL parameter values

Hello,

I have a need to escape URL parameters in the Contact header received from an 
application.

Here is an example:
Contact: >

I believe according to the RFC I need to escape the “ and any spaces?  I would 
like to do that within opensips based on certain conditions.  I welcome any 
thoughts or suggestions.



Thanks,
C


___ 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] Escaping URL parameter values

2019-01-17 Thread Alain Bieuzent
Hi,

 
You can use s.escape.user,
 
https://opensips.org/pipermail/users/2015-September/032545.html
 
Reagrds
 

 

De : Users  au nom de "CARTWRIGHT, CORY C" 

Répondre à : OpenSIPS users mailling list 
Date : lundi 14 janvier 2019 à 19:09
À : "users@lists.opensips.org" 
Objet : [OpenSIPS-Users] Escaping URL parameter values

 

Hello,

 

I have a need to escape URL parameters in the Contact header received from an 
application.

 

Here is an example:

Contact:  

 

I believe according to the RFC I need to escape the “ and any spaces?  I would 
like to do that within opensips based on certain conditions.  I welcome any 
thoughts or suggestions.

 

 

 

Thanks,

C

 

 

___ 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] Opensips caching

2019-01-17 Thread Ben Newlin
No, the dynamic routing module will cache the entire configuration and only 
read from memory. It must be reloaded when the configuration changes. It’s very 
quick.

Ben Newlin

From: Users  on behalf of Schneur Rosenberg 

Reply-To: OpenSIPS users mailling list 
Date: Thursday, January 17, 2019 at 2:44 AM
To: OpenSIPS users mailling list 
Subject: Re: [OpenSIPS-Users] Opensips caching

I believe that dynamic routing runs a SQL query every time, I don't think that 
can be cached, but if you do your own logic in opensips, you should be able to 
use cashedb_memcached

On Thu, Jan 17, 2019, 9:40 AM Schneur Rosenberg 
mailto:rosenberg11...@gmail.com> wrote:
In the script you have multiple caching options, cache_store and cache_fetch 
from cachedb_mamcached work without external servers like cachedb_mongo that 
requires mongodb or other nosql modules.

On Thu, Jan 17, 2019, 9:18 AM Vishal Pai 
mailto:vishalm...@gmail.com> wrote:
Hello everyone

what is the best way to implement the caching in opensips. I am doing following

we have a rate table with NPANXX with rate per minute. Every time when we do 
outbound calls we get NPANXX of dialed number and search it in database. Since 
in this way it will create a load on cpu for each select query.

Can anyone help me in this also let me know if there is any caching 
functionality is available in opensips ?


Vishal Pai
___
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] set_advertised_address usage

2019-01-17 Thread Ben Newlin
I don’t believe you can do that in a reply route because all the headers are 
already in the message. No new headers or addresses are being inserted. You 
need to use set_advertised_address() on the original request so that the 
addresses are inserted in the request properly.

Ben Newlin

From: Users  on behalf of Alexey Kazantsev 
via Users 
Reply-To: Alexey Kazantsev , OpenSIPS users mailling list 

Date: Thursday, January 17, 2019 at 6:20 AM
To: "users@lists.opensips.org" 
Subject: [OpenSIPS-Users] set_advertised_address usage

Hi list

I'm trying to use set_advertised_address(); function
in onreply_route

but I see that nothing changes.

[VoIP ISP] <--- [NAT box x.x.116.2] <--- [OpenSIPS 10.45.144.77] <--- [other 
VoIP server 10.1.30.12]


This is a sip debug, 180 Ringing, leaving OpenSIPS towards Internet:
http://rgho.st/private/7lxQHLFgz/c0af9edb35c175a8dba80228f31ba7a2

I think some addresses should be re-written here, but they are not,
as we see 10.1.30.12 in some headers.

By the way, the next 200 OK with SDP has correct IP address in SDP (as I set it
using rtpengine_answer(... media-address=x.x.116.2). So, I'm sure that I use
set_advertised_address() in the right place. But why it does not change the 
message?

onreply_route {
set_advertised_address(x.x.116.2);

if (has_body("application/sdp")) {
# rewrite SDP for replies within calls from PBX
if ($fd=="pbx. ... .ru") {
rtpengine_answer("RTP/AVP replace-origin replace-session-connection 
ICE=remove to-tag");
} else {
# fix external address and rewrite SDP for replies within calls 
from VoIP ISP
rtpengine_answer("RTP/AVP media-address=x.x.116.2 replace-origin 
replace-session-connection ICE=remove");
}
}
}




---
BR, Alexey
http://alexeyka.zantsev.com/
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] set_advertised_address usage

2019-01-17 Thread Alexey Kazantsev via Users
Just added some lines to route[relay].
Thanks to Kirill Galinurov.

Not ideal in some cases but mostly what I need.

route[relay] {
  # for INVITEs enable some additional helper routes
  if (is_method("INVITE")) {
    t_on_branch("per_branch_ops");
    t_on_reply("handle_nat");
    t_on_failure("missed_call");
  }
  # fix address in Record-Route if this is a 100/200 reply to Multifon // this 
is only until OpenSIPS is behind NAT!
  if($td=="multifon.ru") {
    set_advertised_address("x.X.116.2");
  }
  if (!t_relay()) {
    send_reply("500","Internal Error");
  };
  exit;
}


---
BR, Alexey
http://alexeyka.zantsev.com/___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Opensips caching

2019-01-17 Thread Jon Abrams
There is the sqlcacher module in 2.2+ which will cache whole or parts of
sql tables into OpenSIPs memory.
There is also the excellent drouting module which caches routing data on
startup (or command) into local memory. You could store the rate in the
attributes field of the dr_rules table with each NPANXX.
Redis and memcached modules are available too.

That said, if you don't need hundreds of CPS throughput, you can probably
get by with mysql if you make sure you have the table cached in mysql
correctly and don't have a lot of other things going on in the database.

- Jon

On Thu, Jan 17, 2019 at 1:46 AM Schneur Rosenberg 
wrote:

> I believe that dynamic routing runs a SQL query every time, I don't think
> that can be cached, but if you do your own logic in opensips, you should be
> able to use cashedb_memcached
>
> On Thu, Jan 17, 2019, 9:40 AM Schneur Rosenberg  wrote:
>
>> In the script you have multiple caching options, cache_store and
>> cache_fetch from cachedb_mamcached work without external servers like
>> cachedb_mongo that requires mongodb or other nosql modules.
>>
>> On Thu, Jan 17, 2019, 9:18 AM Vishal Pai >
>>> Hello everyone
>>>
>>> what is the best way to implement the caching in opensips. I am doing
>>> following
>>>
>>> we have a rate table with NPANXX with rate per minute. Every time when
>>> we do outbound calls we get NPANXX of dialed number and search it in
>>> database. Since in this way it will create a load on cpu for each select
>>> query.
>>>
>>> Can anyone help me in this also let me know if there is any caching
>>> functionality is available in opensips ?
>>>
>>>
>>> Vishal Pai
>>> ___
>>> 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] [Re]: set_advertised_address usage

2019-01-17 Thread Alexey Kazantsev via Users
this link opens a bigger image
http://rgho.st/private/7lxQHLFgz/c0af9edb35c175a8dba80228f31ba7a2/image.png  


---
BR, Alexey
http://alexeyka.zantsev.com/___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] set_advertised_address usage

2019-01-17 Thread Alexey Kazantsev via Users
Hi list

I'm trying to use set_advertised_address(); function
in onreply_route

but I see that nothing changes.

[VoIP ISP] <--- [NAT box x.x.116.2] <--- [OpenSIPS 10.45.144.77] <--- [other 
VoIP server 10.1.30.12]


This is a sip debug, 180 Ringing, leaving OpenSIPS towards Internet:
http://rgho.st/private/7lxQHLFgz/c0af9edb35c175a8dba80228f31ba7a2

I think some addresses should be re-written here, but they are not,
as we see 10.1.30.12 in some headers.

By the way, the next 200 OK with SDP has correct IP address in SDP (as I set it
using rtpengine_answer(... media-address=x.x.116.2). So, I'm sure that I use
set_advertised_address() in the right place. But why it does not change the 
message?

onreply_route {
    set_advertised_address(x.x.116.2);
    if (has_body("application/sdp")) {
        # rewrite SDP for replies within calls from PBX
        if ($fd=="pbx. ... .ru") {
            rtpengine_answer("RTP/AVP replace-origin replace-session-connection 
ICE=remove to-tag");
        } else {
            # fix external address and rewrite SDP for replies within calls 
from VoIP ISP
        rtpengine_answer("RTP/AVP media-address=x.x.116.2 replace-origin 
replace-session-connection ICE=remove");
        }
    }
}
 

---
BR, Alexey
http://alexeyka.zantsev.com/___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] Cause of tcp_receive_timeout

2019-01-17 Thread Hamid Hashmi

I am trying to load test TLS listener through sipp.  REGISTER Request is 
working on TLS but INVITE is not working. I changed the transport to TCP and 
receive following logs


version: opensips 2.4.3 (x86_64/linux)
flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, F_MALLOC, 
FAST_LOCK-ADAPTIVE_WAIT
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, 
MAX_URI_SIZE 1024, BUF_SIZE 65535
poll method support: poll, epoll, sigio_rt, select.
git revision: c49ae1d53
main.c compiled on 14:23:04 Dec  5 2018 with gcc 4.8.5


Jan 17 13:10:23 siplb_19 192.168.3.19[29333]: DBG:core:tcp_read_req: Accepted 
connection from 192.168.3.60:36157 on interface 192.168.3.60:2381!
Jan 17 13:10:23 siplb_19 192.168.3.19[29333]: DBG:core:tcp_read_req: Using the 
global ( per process ) buff
Jan 17 13:10:23 siplb_19 192.168.3.19[29333]: DBG:core:tcp_handle_req: We 
didn't manage to read a full request
Jan 17 13:10:23 siplb_19 192.168.3.19[29333]: DBG:core:tcp_read_req: 
tcp_read_req end
Jan 17 13:10:27 siplb_19 192.168.3.19[29333]: DBG:core:tcp_receive_timeout: 
0x7fe984baf740 expired - (18, 18) lt=129
Jan 17 13:10:27 siplb_19 192.168.3.19[29333]: DBG:core:io_watch_del: 
[TCP_worker] io_watch_del op on index -1 7 (0x8c2da0, 7, -1, 0x10,0x1) fd_no=5 
called
Jan 17 13:10:27 siplb_19 192.168.3.19[29333]: DBG:core:tcpconn_release:  
releasing con 0x7fe984baf740, state -2, fd=-1, id=1475809186
Jan 17 13:10:27 siplb_19 192.168.3.19[29333]: DBG:core:tcpconn_release:  
extra_data (nil)
Jan 17 13:10:27 siplb_19 192.168.3.19[29342]: DBG:core:handle_tcp_worker: 
response= 7fe984baf740, -2 from tcp worker 29333 (0)
Jan 17 13:10:27 siplb_19 192.168.3.19[29342]: DBG:core:tcpconn_destroy: 
destroying connection 0x7fe98

PCAP file is also attached.

SIPP Caller 192.168.3.60 --- > SIP Server 192.168.3.19

TLS connection working fine with the softphone. This only occurs when I send 
TLS/TCP request through SIPp script.


Regards

Hamid R. Hashmi


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