[OpenSIPS-Users] Openims+opensips; error 407 proxy authentication required

2015-12-01 Thread Lin Zhu
Hi All,

I'm implementation opensips as a presence server for my open-ims. But when
my openims sends SIP request to my opensips server, the opensips server
gives a 407 proxy authentication required.

My question is that: is there a way to disable opensips server's
authentication? Or is there something to change, so that I can make
opensips server trust my openims server's ip address?

I attached my SIP trace from my openims core.
172.31.16.158 is my open-ims
172.31..23.32 is my opensips server
129.10.18.45 is my ims client

Someone please help me. You can also reach me at zhu@husky.neu.edu

Thanks
Lin
ᐧ


trace_from_opensips(ims).pcapng
Description: Binary data
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] How to avoid 'out of memory' issue ? I'm a bit confused if '-m' and '-M' options...

2015-12-01 Thread Rodrigo Pimenta Carvalho
Hi.


I have used OpenSIPS without problems in my computer. It is OpenSIPS 2.2. I'm 
also using SQLite 3.0 as the OpenSIPS database.

Everything is ok.

See how I start the OpenSIPS in my computer:

/usr/local/opensips_proxy/sbin/opensips -P /var/run/opensips/opensips.pid -m 64 
-M 4 -u root -g root -E -f 
/usr/local/opensips_proxy/etc/opensips/opensips_residential_2015-11-5_16_46_31.cfg


So, 64 Mbyte of shared memory and 4 Mbyte of private memory.



However, after porting OpenSIPS 2.2 and SQLite 3.0 in another system (embedded 
system) and still using the same configurations files, I got an 'out of memory' 
issue.



Dec  1 19:12:02 [232] ERROR:db_sqlite:db_sqlite_connect: Can't open database: 
out of memory
Dec  1 19:12:02 [232] ERROR:db_sqlite:db_sqlite_new_connection: initial connect 
failed



My current platform has 109 Mbyte of free memory before starting OpenSIPS. When 
I try to start it, I got 'out of memory' to open SQLite.

So, I have tried to solve the problem (giving more memory to the SQLite) doing 
the following steps:


1 - starting opensips with 32MB share memory: STARTOPTIONS="-m 32"


2 - Configuring the size of the hash table internally used to keep the dialogs. 
EX: modparam("dialog", "hash_size", 1024) . Default is 4096.


It seems that the option "-m 32" didn't take effect?  I suspect that in the 
embedded system OpenSIPs is trying to use much more that 32 or 64 Mbyte. So 
SQLite doesn't have sufficient memory.


How to solve such problem?


How could be a good use of -M and -m options to give more memory to OpenSIPs or 
to SQLite?


Should I increase or decrease the value of '-m' flag?


Any hint will be very helpful!

Thanks a lot!


Best regards!


---


P.S.: as curiosity, bellow is the file Makefile.config.




exclude_modules?= aaa_radius b2b_logic cachedb_cassandra cachedb_couchbase 
cachedb_memcached cachedb_mongodb cachedb_redis carrierroute compression cpl-c 
db_berkeley db_http db_mysql db_oracle db_perlvdb db_postgres db_unixodbc 
emergency event_rabbitmq h350 regex identity jabber json ldap lua httpd 
mi_xmlrpc_ng mmgeoip osp perl pi_http presence presence_dialoginfo presence_mwi 
presence_xml proto_sctp proto_tls pua pua_bla pua_dialoginfo pua_mi pua_usrloc 
pua_xmpp python rest_client rls sngtc snmpstats tlsops xcap xcap_client xmpp



include_modules?= dialplan db_sqlite presence



DEFS+= -DPKG_MALLOC #Uses a faster malloc (exclusive w/ USE_SHM_MEM)

DEFS+= -DSHM_MMAP #Use mmap instead of SYSV shared memory

DEFS+= -DUSE_MCAST #Compile in support for IP Multicast

DEFS+= -DDISABLE_NAGLE #Disabled the TCP NAgle Algorithm ( lower delay )

#DEFS+= -DSTATISTICS #Enables the statistics manager

DEFS+= -DHAVE_RESOLV_RES #Support for changing some of the resolver parameters

#DEFS+= -DHP_MALLOC #High performance allocator with fine-grained locking

DEFS+= -DF_MALLOC #An even faster allocator. Not recommended for debugging

#DEFS+= -DF_MALLOC_OPTIMIZATIONS #Remove all internal checks in F_MALLOC

#DEFS+= -DDBG_QM_MALLOC #Allocator used for debugging information

#DEFS+= -DUSE_SHM_MEM #All PKG allocations are mapped to SHM ( exclusive w/ 
PKG_MALLOC )

#DEFS+= -DDBG_F_MALLOC #TODO ?

#DEFS+= -DNO_DEBUG #Turns off all debug messages

#DEFS+= -DNO_LOG #Completely turns off all the logging

#DEFS+= -DVQ_MALLOC #TODO ?

#DEFS+= -DFAST_LOCK #Uses fast architecture specific locking

#DEFS+= -DUSE_FUTEX #Uses linux futexs with fast architecture specific locking

#DEFS+= -DUSE_SYSV_SEM #Uses SYSV sems for locking ( slower & limited number of 
locks

DEFS+= -DUSE_PTHREAD_MUTEX #Uses pthread mutexes

#DEFS+= -DBUSY_WAIT #Uses busy waiting on the lock

#DEFS+= -DDBG_LOCK #TODO ?

DEFS+= -DNOSMP #Do not use SMP sompliant locking. Faster but won't work on SMP 
machines

#DEFS+= -DEXTRA_DEBUG #Compiles in some extra debugging code

#DEFS+= -DORACLE_USRLOC #Uses Oracle compatible queries for USRLOC






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


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


[OpenSIPS-Users] Fw: drouting module

2015-12-01 Thread Pasan Meemaduma
fwd again. looks like my email didn't hit the mailling list yet.
 

Hi Guys, 

I'm having an issue with using drouting module. I used the routeid in dr_rules 
table to execute a route block when a prefix match. But the issue is I'm using 
rewriteuser() function to add a suffix to ruri username which is not working.
Ex:  prefix match 000    execute route id add_code

route add_code {    rewriteuser(000123);
}

It doesn't change the rU. I can see that original rU is sent to gateway. Is it 
not possible to mangle ruri when using drouting module ?
I'm using opensips 2.1.1

ThanksRegardsPasan


   

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


Re: [OpenSIPS-Users] Issues with registration proxy

2015-12-01 Thread Patrick Wakano
Hi,
I think cached attributes are like global variables, unique and valid in
the whole Opensips execution. You can store them and fetch at any time
regardless the message you are handling. So, as you suspect, the logic of
the piece of code you showed will store for 1200s the value in cache for
the first request that comes in. During this lifetime, any other subsequent
request won't cause an update in its value. After 1200s the cached
attribute will be deleted and the whole logic will repeat in the next
request it receives.
Not sure why you tried to use the cache to store your domain, maybe because
you need it later in your dialog. If this is the case rethink your logic
and use dialog variables.

Patrick

On Tue, Dec 1, 2015 at 7:29 PM, Travis Manson-Drake 
wrote:

> Hello Everyone!
>
>
>
> Hope you’re all doing well.
>
>
>
> I seem to be having an issue.
>
>
>
> Basically I’m using OpenSIPS as a proxy that will receive request from
> UAC’s, then query a database to find out what Sipserver it belongs to then
> store the result with cachdb_local as an $avp variable, and finally modify
> the R-uri of the sip message to the UAC gets to the correct endpoint. I’ve
> got it working for the most part however I seem to be having an issue when
> I try to have multiple UAC’s hit the proxy.
>
>
>
> I think whats happening is the value stored in memchache is the first
> Sipserver the proxy gets a request for.
>
>
>
> For example:
>
>
>
> If UAC1 sends a REGISTER to the proxy and the proxy finds out it belongs
> on SIPServ1 it then sets the AVP to sipserv1
>
>
>
> Now a few minutes later UAC2 comes along with a same REGISTER request but
> this time it belongs to SIPServ2, however this time it receives a 403 bad
> auth from sipserv2.
>
>
>
> Here’s my current logic for DB query and memcache store:
>
>
>
> NOTE: This is also in the REQUEST Route section of my logic, so this takes
> place before it hits any other routing logic.
>
>
>
> if(cache_fetch("local","PBX",$avp(PBX)))
>
> {
>
> $rd = $avp(PBX);
>
> xlog("this is the value of the modified R-uri:
> $ru\n");
>
> }
>
> else {
>
> avp_db_query("select Servers.ipaddress from
> Servers where Servers.ID in (select phone.ServerID from phone where
> phone.mac in (select MAC FROM `phone_registrations` where auth_userid =
> '$fU'))", "$avp(PBX)");
>
> cache_store("local","PBX","$avp(PBX)",1200);
>
>  }
>
>
>
>
>
> Do you guys have any ideas on what I’m missing, or any advice?
>
>
>
> Thank you in advanced!
>
>
>
> *Travis Manson-Drake*
>
> *Voice Systems Analyst L1*
>
> *Simply Bits, LLC*
>
> *Now You’re Thinkin’ Smart!*
>
> 5225 N. Sabino Canyon Road
> Tucson, AZ 85750
>
> *Phone:* 520-545-0311
>
> *Fax:* 520-545-7252
>
> *Support Hotline*: 5205450333
>
> www.simplybits.com
>
>
>
> ___
> 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] How can I write down the MI commands into the FIFO file, using an editor.

2015-12-01 Thread Rodrigo Pimenta Carvalho
Dear OpenSIPS-users,


I my opensips.cfg I have:


-


# FIFO Management Interface
loadmodule "mi_fifo.so"
modparam("mi_fifo", "fifo_name", "/tmp/FifoCommands.txt")# arquivo para ler 
comandos solicitados por aplicações externas.
modparam("mi_fifo", "reply_dir", "/tmp") # diretório onde 
serão escritas as respostas do OpenSIPS, que serão lidas pelas aplicações 
externas.
modparam("mi_fifo", "fifo_mode", 0777)   # permissão de 
scrita e leitura.
modparam("mi_fifo", "fifo_group", "root")# grupo de 
usuários para o arquivo.
modparam("mi_fifo", "fifo_user", "root") # usuário do 
arquivo.


--



When OpenSIPS is not running, I can edit the file FifoCommands.txt using emacs 
or vi, for example.


However, when OpenSIPS is running I can not.  The editor tells me that the file 
is read only Why? How to solve this? Any configuration?


Any hint will be very helpful!


Thanks a lot.





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] How can I write down the MI commands into the FIFO file, using an editor.

2015-12-01 Thread Brian ::
This is not the correct way to go about what you are trying to achieve.

You *cant* edit the fifo file. You use (correctly configured) opensipsctl
fifo to send commands in realtime

On Tue, Dec 1, 2015 at 5:04 PM, Rodrigo Pimenta Carvalho 
wrote:

> Dear OpenSIPS-users,
>
>
> I my opensips.cfg I have:
>
>
> -
>
>
> # FIFO Management Interface
> loadmodule "mi_fifo.so"
> modparam("mi_fifo", "fifo_name", "/tmp/FifoCommands.txt")# arquivo
> para ler comandos solicitados por aplicações externas.
> modparam("mi_fifo", "reply_dir", "/tmp") # diretório
> onde serão escritas as respostas do OpenSIPS, que serão lidas pelas
> aplicações externas.
> modparam("mi_fifo", "fifo_mode", 0777)   # permissão
> de scrita e leitura.
> modparam("mi_fifo", "fifo_group", "root")# grupo de
> usuários para o arquivo.
> modparam("mi_fifo", "fifo_user", "root") # usuário do
> arquivo.
>
>
> --
>
>
>
> When OpenSIPS is not running, I can edit the file FifoCommands.txt using
> emacs or vi, for example.
>
>
> However, when OpenSIPS is running I can not.  The editor tells me that the
> file is read only Why? How to solve this? Any configuration?
>
>
> Any hint will be very helpful!
>
>
> Thanks a lot.
>
>
>
>
>
> 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 can I write down the MI commands into the FIFO file, using an editor.

2015-12-01 Thread Rodrigo Pimenta Carvalho
Ok. Thanks.


But, if I cann't edit the file, how could a program (let's say a C program) 
write into such file?


I will create a executable that will have to write down MI commands into the 
FIFO file.


Any hint will be very helpful!

Thanks a lot!


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



De: users-boun...@lists.opensips.org  em nome 
de Brian :: 
Enviado: terça-feira, 1 de dezembro de 2015 16:38
Para: OpenSIPS users mailling list
Assunto: Re: [OpenSIPS-Users] How can I write down the MI commands into the 
FIFO file, using an editor.

This is not the correct way to go about what you are trying to achieve.

You *cant* edit the fifo file. You use (correctly configured) opensipsctl fifo 
to send commands in realtime

On Tue, Dec 1, 2015 at 5:04 PM, Rodrigo Pimenta Carvalho 
> wrote:

Dear OpenSIPS-users,


I my opensips.cfg I have:


-


# FIFO Management Interface
loadmodule "mi_fifo.so"
modparam("mi_fifo", "fifo_name", "/tmp/FifoCommands.txt")# arquivo para ler 
comandos solicitados por aplicações externas.
modparam("mi_fifo", "reply_dir", "/tmp") # diretório onde 
serão escritas as respostas do OpenSIPS, que serão lidas pelas aplicações 
externas.
modparam("mi_fifo", "fifo_mode", 0777)   # permissão de 
scrita e leitura.
modparam("mi_fifo", "fifo_group", "root")# grupo de 
usuários para o arquivo.
modparam("mi_fifo", "fifo_user", "root") # usuário do 
arquivo.


--



When OpenSIPS is not running, I can edit the file FifoCommands.txt using emacs 
or vi, for example.


However, when OpenSIPS is running I can not.  The editor tells me that the file 
is read only Why? How to solve this? Any configuration?


Any hint will be very helpful!


Thanks a lot.





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 can I write down the MI commands into the FIFO file, using an editor.

2015-12-01 Thread Ionut Muntean
Come on, read about FIFO in Linux, lot's of info on the net! Sorry, but 
you lack some basic Linux OS knowledge ... The FIFO is active and RW if 
the creating process is active and if you have the permissions to do this.


On 01/12/2015 21:13, Rodrigo Pimenta Carvalho wrote:


Ok. Thanks.


But, if I cann't edit the file, how could a program (let's say a C 
program) write into such file?



I will create a executable that will have to write down MI commands 
into the FIFO file.



Any hint will be very helpful!

Thanks a lot!


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



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

*Enviado:* terça-feira, 1 de dezembro de 2015 16:38
*Para:* OpenSIPS users mailling list
*Assunto:* Re: [OpenSIPS-Users] How can I write down the MI commands 
into the FIFO file, using an editor.

This is not the correct way to go about what you are trying to achieve.

You *cant* edit the fifo file. You use (correctly configured) 
opensipsctl fifo to send commands in realtime


On Tue, Dec 1, 2015 at 5:04 PM, Rodrigo Pimenta Carvalho 
> wrote:


Dear OpenSIPS-users,


I my opensips.cfg I have:


-


# FIFO Management Interface
loadmodule "mi_fifo.so"
modparam("mi_fifo", "fifo_name", "/tmp/FifoCommands.txt")#
arquivo para ler comandos solicitados por aplicações externas.
modparam("mi_fifo", "reply_dir", "/tmp") #
diretório onde serão escritas as respostas do OpenSIPS, que serão
lidas pelas aplicações externas.
modparam("mi_fifo", "fifo_mode", 0777)   #
permissão de scrita e leitura.
modparam("mi_fifo", "fifo_group", "root")#
grupo de usuários para o arquivo.
modparam("mi_fifo", "fifo_user", "root") #
usuário do arquivo.


--



When OpenSIPS is not running, I can edit the file FifoCommands.txt
using emacs or vi, for example.


However, when OpenSIPS is running I can not. The editor tells me
that the file is read only Why? How to solve this? Any configuration?


Any hint will be very helpful!


Thanks a lot.





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


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


Re: [OpenSIPS-Users] CDR search slow in CDRTool

2015-12-01 Thread Tomas Andersen
Hi again,

Thank you for the information.

Yes, the delay is happening between the select rpid queries. So I see the 
request/responses from open sips DB immediately and then 10 seconds “void”, 
before next query.
The search resolves in two different flows and the timeout is 10 s for both of 
them. I see ‘outgoing’ flow and 'on-net-diverted-off-net’ flow.
php5-geoip seems to lookup the correct country when testing a lookup of an ip 
address with a simple php script.

I tried to add some debug info in the rating class, but now I suddenly got 
another problem with CDRTool starting to get connection reset to the rating 
engine. Seems like the ratingEngine stops when trying to do a search.
I am investigating this atm.

Regards,
Tomas


From: 
> on 
behalf of Tijmen de Mes
Reply-To: OpenSIPS users mailling list
Date: Monday 30 November 2015 at 16:19
To: OpenSIPS users mailling list
Subject: Re: [OpenSIPS-Users] CDR search slow in CDRTool

Hi,

As for the usability questions, from trusted peers it matches the ip to a 
reseller so this can be billed. The subscriber table is used to find the RPID 
from the local caller and get quotas.

As for the delay, to me it sounds like a timeout of some sort if it is 10s each 
time. So you see the delay after this query? Can you tell me what it shows for 
‘flow', and does the delay change based on the flow?

Also does php5-geoip work?

Best regards,

Tijmen de Mes
—
AG Projects

On 30 nov. 2015, at 13:43, Tomas Andersen 
> wrote:

Sorry for “spamming” the list, but the sql query request/response itself to the 
subscriber list is fast.
So as you say there must be some more logic before the next caller is checked 
that takes time.
CDRTool “waits” 10 seconds between each query.

Regards,
Tomas


From: 
> on 
behalf of Tomas Andersen
Reply-To: OpenSIPS users mailling list
Date: Monday 30 November 2015 at 13:31
To: OpenSIPS users mailling list
Subject: Re: [OpenSIPS-Users] CDR search slow in CDRTool

Hi.

Thank you for responding. I have now tried to add the parameter you specified 
in my global.inc file. I have also added “skipNormalize” => 1.
The search does still use forever, and according to my RadiusAcct table all 
CDRs are already normalized, as the value is set to 1. I don’t see why it still 
should use that much time..
as they already are normalized..?

By checking wireshark, the calls to OpenSIPS db still searches for rpid in the 
subscriber table and each call takes 10 minutes.
The latest search i did now resulted in 8 CDRs and the search took 8x10seconds 
= 1m 20s.

My concern is that CDRTool relies on a strict way to use OpenSIPS, as it need 
certain tables to be filled out?

We have made another approach to OpenSIPS and are using the grp table for 
listing our subscribers (not the subscriber table).
We are also using dr_gateways to list our external Gateways (e.g other SIP 
servers or external GWs).

We do not use the trusted_peers or subscriber tables which I see are queried 
from cdrtool.

My hope was to use CDRTool to rate calls differently if the call is placed 
internally (userloc-userloc) or from an internal user to an external user (and 
then lookup destinations with country code).

Do you see any limitations based on how we use OpenSIPS?

I really appreciate if you could assist me in the question.

Regards,
Tomas Andersen

From: 
> on 
behalf of Tijmen de Mes
Reply-To: OpenSIPS users mailling list
Date: Monday 30 November 2015 at 13:01
To: OpenSIPS users mailling list
Subject: Re: [OpenSIPS-Users] CDR search slow in CDRTool

Hi Tomas,

That query should not take 10 seconds. Here it completes in 0.02s according to 
mysql. The query is used to determine the flow of the calls. After the query is 
executed in CDRTool, more logic follows. It can easily be that the delay is in 
there.

If web normalizing is enabled and the call is not normalized,  it will also try 
to normalize and rate the calls while searching. This can be disabled if you 
don’t need/want it. Perhaps you can disable this to check if this causes the 
delay.

To disable it add to the opensips datasource in global.inc:  
"skipNormalizeOnPageLoad" => 1


Best regards,

Tijmen de Mes
—
AG Projects


On 30 nov. 2015, at 10:26, Tomas Andersen 
> wrote:

Hi again.

I have set up wireshark to check why the CDR rating engine uses so much time.

The following SQL queries are run from CDRTool to my OpenSIPS server:
select * from domain;
select * from trusted_peers;
Select rpid from subscriber where username = ‘+47’ and domain = 
‘example.sip.com’

(with username and domain scrambled here)

The rpid select statement is run for each caller in the search 

[OpenSIPS-Users] Tight matching of dialog failed

2015-12-01 Thread John Nash
I get following warning in log
Dec  1 08:40:14 [14516] WARNING:dialog:dlg_onroute: tight matching failed
for BYE with callid='[%!<

to}'/36, ftag='9r60aB1Q77tUj'/13, ttag='PROXY1448958761787to'/20 and
direction=0
Dec  1 08:40:14 [14516] WARNING:dialog:dlg_onroute: dialog identification
elements are
callid='DLGCH_FFVEUltVXEVZBAoTXFlQW19bWE0MAENIRAIKWFgURQYLRlcR'/54, caller
tag='9r60aB1Q77tUj'/13, callee tag='PROXY1448958761787to'/20


Strange thing is that when i see the dump in wireshark, I can see call-id
is correct it is not what is printed in above message.

My scenario is One opensips sending call to second opensips (both using
topology hiding). I pasted log from second opensips.
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] tcp_max_msg_time question

2015-12-01 Thread Чалков Артём
I use opensips v2.1.1 and cant clearly understand how to use tcp_max_msg_time better with high amount of sip-users behind NAT. I dont want to use natping_tcp, only TCP-keepalives, but opensips ends all TCP connections after tcp_max_msg_time number of seconds despite the fact that i use TCP-keepalives and i have to use natping_tcp to hold ongoing TCP-connections.Maybe you can provide me with some recomendations about how to tune tcp_max_msg_time value for my tasks? 

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