Re: [OpenSIPS-Users] mid registrar

2018-06-08 Thread Liviu Chircu

Hi Volga,

The mid-registrar has full DB persistency support since 2.4. It works 
with all the user location presets except the "DB only" ones. For 
example, you only have to set:


modparam("usrloc", "working_mode_preset", 
"single-instance-sql-write-through")


or

modparam("usrloc", "working_mode_preset", "single-instance-sql-write-back")

Best regards,

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

On 08.06.2018 02:48, volga...@networklab.ca wrote:

Hello Everyone,
Is possible configure mid registrar with database persistency ?



volga629


___
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] mid registrar

2018-06-08 Thread volga629

Hello Liviu,
What will happened if set federation-cachedb-cluster and mid registrar 
is in use.



volga629

On Fri, Jun 8, 2018 at 5:41 AM, Liviu Chircu  wrote:

Hi Volga,

The mid-registrar has full DB persistency support since 2.4. It works 
with all the user location presets except the "DB only" ones. For 
example, you only have to set:


modparam("usrloc", "working_mode_preset", 
"single-instance-sql-write-through")


or

modparam("usrloc", "working_mode_preset", 
"single-instance-sql-write-back")


Best regards,

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

On 08.06.2018 02:48, volga...@networklab.ca wrote:

Hello Everyone,
Is possible configure mid registrar with database persistency ?



volga629


___
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] OpenSIPS Crash

2018-06-08 Thread Liviu Chircu

Hi Ben,

Excellent report! I managed to reproduce the crash on first try:

Core was generated by `./opensips -m64 -M16 -f 
cfg/opensips-2.4-sipp-siptrace.cfg -w .'.

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x7f7987cd7f2a in sip_trace (msg=0x7f799817fd20, 
info=0x7f799468d5e0) at siptrace.c:1646

1646        db_vals[1].val.str_val.s = msg->callid->body.s;
(gdb) bt
#0  0x7f7987cd7f2a in sip_trace (msg=0x7f799817fd20, 
info=0x7f799468d5e0) at siptrace.c:1646
#1  0x7f7987cd7c8d in sip_trace_w (msg=0x7f799817fd20, 
param1=0x7f7998169110 "\001", param2=0x2 address 0x2>, param3=0x7f79981691f8 "\001", param4=0x0) at siptrace.c:1590
#2  0x00445082 in do_action (a=0x7f79981589a0, 
msg=0x7f799817fd20) at action.c:1864
#3  0x0043ccf7 in run_action_list (a=0x7f79981589a0, 
msg=0x7f799817fd20) at action.c:172


Quick question for you: you are sending a malformed INVITE, correct? 
Here is how mine looked like:


INVITE sip:sipp@127.0.0.1:5060 SIP/2.0.
Via: SIP/2.0/UDP 127.0.0.1:7000;branch=z9hG4bK-1988-1-0.
From: sipp ;tag=123456789.
To: sut .
CSeq: 1 INVITE.
Contact:    Call-ID: 1-1988@127.0.0.1.
Max-Forwards: 70.
Subject: Performance Test.
Content-Type: application/sdp.
Content-Length:   129.
.
v=0.
o=user1 53655765 2353687637 IN IP4 127.0.0.1.
s=-.
c=IN IP4 127.0.0.1.
t=0 0.
m=audio 6001 RTP/AVP 0.
a=rtpmap:0 PCMU/8000.

Notice how OpenSIPS will be unable to parse the Call-ID header field, 
hence the immediate crash in sip_trace(), as it's unable to handle a 
NULL Call-ID.


Best regards,

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

On 07.06.2018 22:24, Ben Newlin wrote:


Hi,

While running a new test scenario I encountered an OpenSIPS crash.

version: opensips 2.3.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_lt, epoll_et, sigio_rt, select.

git revision: a0bed9d

main.c compiled on 21:08:28 May 16 2018 with gcc 4.8.5

Logs: https://pastebin.com/3vL3rbG4 

BT: https://pastebin.com/tTp32ASC 

Let me know if anything else is needed.

Thanks,

Ben Newlin



___
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] mid registrar

2018-06-08 Thread Liviu Chircu
First of all: mid-registrar + clustering is still uncharted territory, I 
haven't done any testing yet with this setup.


Disclaimer aside, this setup should somewhat work:

* [CORRECT] mid-registrar saved contacts should propagate through the 
cluster just like with registrar. They will contain the short lifetime 
of the UAC side, not the longer lifetime shown to the backend registrar
* [CORRECT] throttled contact updates should propagate through the 
cluster just like with registrar (although we absorb the REGISTER, we 
instruct other nodes to update their cache, so they don't delete the 
contact prematurely)
* [INCORRECT] the mid-registrar semantics (specific fields) are not 
getting replicated to other nodes. If you fail over to another 
mid-registrar within the cluster, you won't be able to throttle contacts 
anymore. In fact, you should see something like:


ERROR:'last_reg_ts' key not found!

, and the handling for the "inherited" REGISTER traffic would completely 
fail.


To sum up: this setup should "kinda" work, but it's not going to be 
fully useful unless we fix it. Replicating the "kv_store" should not be 
complicated at all (actually, it seems to be a 50-line patch at most), 
but it will require the usual bit of testing / fiddling around until all 
corner-cases are covered.


We've not had requests for this feature up until now, but I've logged it 
on GitHub, so we can start a discussion [1]


Best regards,

[1]: https://github.com/OpenSIPS/opensips/issues/1379

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

On 08.06.2018 12:13, volga...@networklab.ca wrote:

Hello Liviu,
What will happened if set federation-cachedb-cluster and mid registrar 
is in use.



volga629

On Fri, Jun 8, 2018 at 5:41 AM, Liviu Chircu  wrote:

Hi Volga,

The mid-registrar has full DB persistency support since 2.4. It works 
with all the user location presets except the "DB only" ones. For 
example, you only have to set:


modparam("usrloc", "working_mode_preset", 
"single-instance-sql-write-through")


or

modparam("usrloc", "working_mode_preset", 
"single-instance-sql-write-back")


Best regards,

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

On 08.06.2018 02:48, volga...@networklab.ca wrote:

Hello Everyone,
Is possible configure mid registrar with database persistency ?



volga629


___
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] user location cluster

2018-06-08 Thread volga629

Hello Liviu
Might need update documentation.
I tested Mongodb URI in following formats
modparam("usrloc", "cachedb_url", 
"mongodb://node1:27017,node2:27017/opensips_prod01.userlocation")


or

modparam("usrloc", "cachedb_url", 
"mongodb://node1:27017/opensips_prod01.userlocation")


they all works. Meaning you can add multiply mongos for redundancy an 
HA purpose without adding any extra layers in between.


Reference

https://docs.mongodb.com/manual/reference/connection-string/

volga629




On Wed, Jun 6, 2018 at 2:05 PM, Liviu Chircu  wrote:

Hi Volga,

The comma-separated hosts are correctly parsed by OpenSIPS and fed to 
the libmongoc driver, which should be able to use them, as per [1].


So, in theory, this should work! In practice: nobody has yet lived to 
tell the story using the latest libmongoc. Please let me know if you 
run into any issues, and I'll happily help sort them out.


Best regards,

[1]: https://docs.mongodb.com/manual/reference/connection-string/

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

On 06.06.2018 17:30, volga...@networklab.ca wrote:

Hello Everyone,
We have the following config

 USeR LOCation module
loadmodule "usrloc.so"
modparam("usrloc", "db_url", "postgres://uri/db")
modparam("usrloc", "use_domain", 1)
modparam("usrloc", "working_mode_preset", 
"federation-cachedb-cluster")

modparam("usrloc", "location_cluster", 1)
modparam("usrloc", "cachedb_url", 
"mongodb://10.100.101.9:27017/opensips_prod01.userlocation")

modparam("usrloc","nat_bflag","NATED_CALLEE")


In our setup we have mongodb cluster with 2 mongos  to serve 
application. Is possible in modparam("usrloc", "cachedb_url" "uri")
specify URI in format like mongodb module where you specify 
mongodb:replica://primary mongos:port,backup mongos:port ?



volga629




___
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] user location cluster

2018-06-08 Thread Liviu Chircu

Nice! Thank you, Volga -- I'll put this on the bucket list.

Cheers,

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

On 08.06.2018 13:19, volga...@networklab.ca wrote:

Hello Liviu
Might need update documentation.
I tested Mongodb URI in following formats
modparam("usrloc", "cachedb_url", 
"mongodb://node1:27017,node2:27017/opensips_prod01.userlocation")


or

modparam("usrloc", "cachedb_url", 
"mongodb://node1:27017/opensips_prod01.userlocation")


they all works. Meaning you can add multiply mongos for redundancy an 
HA purpose without adding any extra layers in between.


Reference

https://docs.mongodb.com/manual/reference/connection-string/

volga629




On Wed, Jun 6, 2018 at 2:05 PM, Liviu Chircu  wrote:

Hi Volga,

The comma-separated hosts are correctly parsed by OpenSIPS and fed to 
the libmongoc driver, which should be able to use them, as per [1].


So, in theory, this should work! In practice: nobody has yet lived to 
tell the story using the latest libmongoc. Please let me know if you 
run into any issues, and I'll happily help sort them out.


Best regards,

[1]: https://docs.mongodb.com/manual/reference/connection-string/

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

On 06.06.2018 17:30, volga...@networklab.ca wrote:

Hello Everyone,
We have the following config

 USeR LOCation module
loadmodule "usrloc.so"
modparam("usrloc", "db_url", "postgres://uri/db")
modparam("usrloc", "use_domain", 1)
modparam("usrloc", "working_mode_preset", "federation-cachedb-cluster")
modparam("usrloc", "location_cluster", 1)
modparam("usrloc", "cachedb_url", 
"mongodb://10.100.101.9:27017/opensips_prod01.userlocation")

modparam("usrloc","nat_bflag","NATED_CALLEE")


In our setup we have mongodb cluster with 2 mongos  to serve 
application. Is possible in modparam("usrloc", "cachedb_url" "uri")
specify URI in format like mongodb module where you specify 
mongodb:replica://primary mongos:port,backup mongos:port ?



volga629




___
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] Using Sipp stress tool with Opensips

2018-06-08 Thread Jan Skórczyński
I managed to run Sipp finally. I tried to run UAC from my PC which is
behind NAT, and UAS from VPN where opensips is installed.
I just moved UAC to the machine which public address and add
service@
to usr loc via *opensipsctl ul add.*

Thanks for replies

2018-06-06 16:01 GMT+02:00 Daniel Zanutti :

> I think the problem is related to configuring SIPP properly.
>
> If I'm not wrong, SIPP standard scenario for UAC/UAS is configured to work
> with a gateway (B2B), but Opensips is a proxy. You have to use Routes to
> properly handle the incoming call and respond it.
>
> Take a lookt at "rrs" param of recv command.
>
> This is the code I use on UAC.xml, after receiving 200 OK from initial
> invite:
>
>
>   
> 
>check_it="false" assign_to="3"/>
>assign_to="4"/>
> 
>   
>
>   
> 
>   
>
>   
>   
>   
>
>   
>   
> 
>   
>
>   
>
>
>
>
> On Wed, Jun 6, 2018 at 7:32 AM, David Villasmil <
> david.villasmil.w...@gmail.com> wrote:
>
>> Are the 2 sipp instances behind nat? If so, you need to set the
>> appropiate switch on sipp, i believe it is
>> -bind_local the actual local ip
>> -i the public ip
>>
>> Take a look at sipp's documentation
>>
>> Hope it helps
>>
>> David
>>
>> On Wed, Jun 6, 2018, 10:33 Jan Skórczyński > m> wrote:
>>
>>> Hello,
>>>
>>> I'm a beginner in VOIP world so maybe this question have obvious
>>> answer...
>>> I would like to perform series of stress tests of my Opensips server.
>>>
>>> Opensips instance is located on VPS at adres XXX.XXX.XXX.XXX (public IP)
>>> and it is listening on 5060 port. I'm using custom client apps, everything
>>> works fine, however I have some issue when I try to test with Sipp.
>>>
>>> I'm setting UAS on my VPS, with the following command:
>>>
>>> sipp -sn uas -rsa XXX.XXX.XXX.XXX:5060 -i XXX.XXX.XXX.XXX
>>>
>>> and UAC on my PC:
>>>
>>> sipp -sn uac XXX.XXX.XXX.XXX:5061  -i 192.168.0.103
>>>
>>> I can see on UAS that it receives messages from my UAC, but it cannot
>>> reply to them.
>>>
>>> -- Scenario Screen  [1-9]: Change
>>> Screen --
>>>   Port   Total-time  Total-calls  Transport
>>>   5061  19.07 s   30  UDP
>>>
>>>   0 new calls during 1.004 s period  1 ms scheduler resolution
>>>   0 callsPeak was 6 calls, after 6 s
>>>   0 Running, 31 Paused, 4 Woken up
>>>   90 dead call msg (discarded)
>>>   4 open sockets
>>>
>>>  Messages  Retrans   Timeout
>>>  Unexpected-Msg
>>>   --> INVITE 300 0 0
>>>
>>>   <-- 180300
>>>   <-- 20030140
>>>   --> ACK E-RTD1 0 0 0 30
>>>
>>>   --> BYE0 0 0 0
>>>   <-- 2000 0
>>>   [   4000ms] Pause  0 0
>>> -- Sipp Server Mode
>>> ---
>>>
>>>
>>> Logs from UAC:
>>>
>>> -- Scenario Screen  [1-9]: Change
>>> Screen --
>>>   Call-rate(length)   Port   Total-time  Total-calls  Remote-host
>>>   10.0(0 ms)/1.000s   5060  73.29 s   90
>>> XXX.XXX.XXX.XXX:5061(UDP)
>>>
>>>   0 new calls during 1.004 s period  1 ms scheduler resolution
>>>   30 calls (limit 30)Peak was 30 calls, after 3 s
>>>   0 Running, 62 Paused, 24 Woken up
>>>   0 dead call msg (discarded)0 out-of-call msg (discarded)
>>>
>>>   3 open sockets
>>>
>>>  Messages  Retrans   Timeout
>>>  Unexpected-Msg
>>>   INVITE --> 90415   60
>>>  100 <-- 0 0 0 0
>>>  180 <-- 0 0 0 0
>>>  183 <-- 0 0 0 0
>>>  200 <--  E-RTD1 0 0 0 0
>>>  ACK --> 0 0
>>>Pause [  0ms] 0 0
>>>  BYE --> 0 0 0
>>>  200 <-- 0 0 0 0
>>>
>>> -- [+|-|*|/]: Adjust rate  [q]: Soft exit  [p]: Pause
>>> traffic -
>>>
>>> And here is my opensips.cfg routing script:
>>>
>>> route{
>>> xlog("Begin route");
>>> if (!mf_process_maxfwd_header("10")) {
>>> xlog("Too many hops");
>>> send_reply("483","Too Many Hops");
>>> exit;
>>> }
>>>
>>> if (has_totag() && ($fU!="sipp")) {
>>> xlog("Has totag");
>>> # handle hop-by-hop ACK (no routing required)
>>> if ( is_method("ACK") && t_check_trans() ) {
>>> xlog("Method: ACK && t_check_trans.
>>> Relaying...");
>>> t_relay();
>>> exit;
>>> }
>>>
>>> # sequential request within a dialog should
>>> # take the path determined by record-routing
>>> if ( !loose_route() ) {
>>> # we d

Re: [OpenSIPS-Users] OpenSIPS Crash

2018-06-08 Thread Ben Newlin
Liviu,

I am very impressed! I was indeed sending a malformed invite just like the one 
you posted, specifically with the missing line termination before the Call-ID.

Thanks,
Ben Newlin


From: Users  on behalf of Liviu Chircu 

Reply-To: OpenSIPS users mailling list 
Date: Friday, June 8, 2018 at 5:17 AM
To: "users@lists.opensips.org" 
Subject: Re: [OpenSIPS-Users] OpenSIPS Crash


Hi Ben,

Excellent report! I managed to reproduce the crash on first try:

Core was generated by `./opensips -m64 -M16 -f 
cfg/opensips-2.4-sipp-siptrace.cfg -w .'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x7f7987cd7f2a in sip_trace (msg=0x7f799817fd20, info=0x7f799468d5e0) 
at siptrace.c:1646
1646db_vals[1].val.str_val.s = msg->callid->body.s;
(gdb) bt
#0  0x7f7987cd7f2a in sip_trace (msg=0x7f799817fd20, info=0x7f799468d5e0) 
at siptrace.c:1646
#1  0x7f7987cd7c8d in sip_trace_w (msg=0x7f799817fd20, 
param1=0x7f7998169110 "\001", param2=0x2 , param3=0x7f79981691f8 "\001", param4=0x0) at siptrace.c:1590
#2  0x00445082 in do_action (a=0x7f79981589a0, msg=0x7f799817fd20) at 
action.c:1864
#3  0x0043ccf7 in run_action_list (a=0x7f79981589a0, 
msg=0x7f799817fd20) at action.c:172
Quick question for you: you are sending a malformed INVITE, correct? Here is 
how mine looked like:

INVITE sip:sipp@127.0.0.1:5060 SIP/2.0.
Via: SIP/2.0/UDP 127.0.0.1:7000;branch=z9hG4bK-1988-1-0.
From: sipp ;tag=123456789.
To: sut .
CSeq: 1 INVITE.
Contact:Call-ID: 
1-1988@127.0.0.1.
Max-Forwards: 70.
Subject: Performance Test.
Content-Type: application/sdp.
Content-Length:   129.
.
v=0.
o=user1 53655765 2353687637 IN IP4 127.0.0.1.
s=-.
c=IN IP4 127.0.0.1.
t=0 0.
m=audio 6001 RTP/AVP 0.
a=rtpmap:0 PCMU/8000.

Notice how OpenSIPS will be unable to parse the Call-ID header field, hence the 
immediate crash in sip_trace(), as it's unable to handle a NULL Call-ID.

Best regards,

Liviu Chircu

OpenSIPS Developer

http://www.opensips-solutions.com
On 07.06.2018 22:24, Ben Newlin wrote:
Hi,

While running a new test scenario I encountered an OpenSIPS crash.

version: opensips 2.3.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_lt, epoll_et, sigio_rt, select.
git revision: a0bed9d
main.c compiled on 21:08:28 May 16 2018 with gcc 4.8.5

Logs: https://pastebin.com/3vL3rbG4
BT: https://pastebin.com/tTp32ASC

Let me know if anything else is needed.

Thanks,
Ben Newlin





___

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 Crash

2018-06-08 Thread Schneur Rosenberg
A malformed sip packet should not crash OpenSIPS it should just give
an error and move on

On Fri, Jun 8, 2018 at 3:00 PM, Ben Newlin  wrote:
> Liviu,
>
>
>
> I am very impressed! I was indeed sending a malformed invite just like the
> one you posted, specifically with the missing line termination before the
> Call-ID.
>
>
>
> Thanks,
>
> Ben Newlin
>
>
>
>
>
> From: Users  on behalf of Liviu Chircu
> 
> Reply-To: OpenSIPS users mailling list 
> Date: Friday, June 8, 2018 at 5:17 AM
> To: "users@lists.opensips.org" 
> Subject: Re: [OpenSIPS-Users] OpenSIPS Crash
>
>
>
> Hi Ben,
>
> Excellent report! I managed to reproduce the crash on first try:
>
> Core was generated by `./opensips -m64 -M16 -f
> cfg/opensips-2.4-sipp-siptrace.cfg -w .'.
> Program terminated with signal SIGSEGV, Segmentation fault.
> #0  0x7f7987cd7f2a in sip_trace (msg=0x7f799817fd20,
> info=0x7f799468d5e0) at siptrace.c:1646
> 1646db_vals[1].val.str_val.s = msg->callid->body.s;
> (gdb) bt
> #0  0x7f7987cd7f2a in sip_trace (msg=0x7f799817fd20,
> info=0x7f799468d5e0) at siptrace.c:1646
> #1  0x7f7987cd7c8d in sip_trace_w (msg=0x7f799817fd20,
> param1=0x7f7998169110 "\001", param2=0x2  address 0x2>, param3=0x7f79981691f8 "\001", param4=0x0) at siptrace.c:1590
> #2  0x00445082 in do_action (a=0x7f79981589a0, msg=0x7f799817fd20)
> at action.c:1864
> #3  0x0043ccf7 in run_action_list (a=0x7f79981589a0,
> msg=0x7f799817fd20) at action.c:172
>
> Quick question for you: you are sending a malformed INVITE, correct? Here is
> how mine looked like:
>
> INVITE sip:sipp@127.0.0.1:5060 SIP/2.0.
> Via: SIP/2.0/UDP 127.0.0.1:7000;branch=z9hG4bK-1988-1-0.
> From: sipp ;tag=123456789.
> To: sut .
> CSeq: 1 INVITE.
> Contact:Call-ID: 1-1988@127.0.0.1.
> Max-Forwards: 70.
> Subject: Performance Test.
> Content-Type: application/sdp.
> Content-Length:   129.
> .
> v=0.
> o=user1 53655765 2353687637 IN IP4 127.0.0.1.
> s=-.
> c=IN IP4 127.0.0.1.
> t=0 0.
> m=audio 6001 RTP/AVP 0.
> a=rtpmap:0 PCMU/8000.
>
> Notice how OpenSIPS will be unable to parse the Call-ID header field, hence
> the immediate crash in sip_trace(), as it's unable to handle a NULL Call-ID.
>
> Best regards,
>
> Liviu Chircu
>
> OpenSIPS Developer
>
> http://www.opensips-solutions.com
>
> On 07.06.2018 22:24, Ben Newlin wrote:
>
> Hi,
>
>
>
> While running a new test scenario I encountered an OpenSIPS crash.
>
>
>
> version: opensips 2.3.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_lt, epoll_et, sigio_rt, select.
>
> git revision: a0bed9d
>
> main.c compiled on 21:08:28 May 16 2018 with gcc 4.8.5
>
>
>
> Logs: https://pastebin.com/3vL3rbG4
>
> BT: https://pastebin.com/tTp32ASC
>
>
>
> Let me know if anything else is needed.
>
>
>
> Thanks,
>
> Ben Newlin
>
>
>
>
>
>
> ___
>
> 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] OpenSIPS Crash

2018-06-08 Thread Liviu Chircu
That we already know, dear sir! But before simply fixing this issue and 
moving on, my question is: How many more OpenSIPS functions (sip_trace() 
included) are still subject to such a basic vulnerability?


(probably this will turn into a GitHub ticket that will be assigned to 
me. Oh well, at least it's for the better good of the community)


Cheers,

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

On 08.06.2018 18:58, Schneur Rosenberg wrote:

A malformed sip packet should not crash OpenSIPS it should just give
an error and move on

On Fri, Jun 8, 2018 at 3:00 PM, Ben Newlin  wrote:

Liviu,



I am very impressed! I was indeed sending a malformed invite just like the
one you posted, specifically with the missing line termination before the
Call-ID.



Thanks,

Ben Newlin





From: Users  on behalf of Liviu Chircu

Reply-To: OpenSIPS users mailling list 
Date: Friday, June 8, 2018 at 5:17 AM
To: "users@lists.opensips.org" 
Subject: Re: [OpenSIPS-Users] OpenSIPS Crash



Hi Ben,

Excellent report! I managed to reproduce the crash on first try:

Core was generated by `./opensips -m64 -M16 -f
cfg/opensips-2.4-sipp-siptrace.cfg -w .'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x7f7987cd7f2a in sip_trace (msg=0x7f799817fd20,
info=0x7f799468d5e0) at siptrace.c:1646
1646db_vals[1].val.str_val.s = msg->callid->body.s;
(gdb) bt
#0  0x7f7987cd7f2a in sip_trace (msg=0x7f799817fd20,
info=0x7f799468d5e0) at siptrace.c:1646
#1  0x7f7987cd7c8d in sip_trace_w (msg=0x7f799817fd20,
param1=0x7f7998169110 "\001", param2=0x2 , param3=0x7f79981691f8 "\001", param4=0x0) at siptrace.c:1590
#2  0x00445082 in do_action (a=0x7f79981589a0, msg=0x7f799817fd20)
at action.c:1864
#3  0x0043ccf7 in run_action_list (a=0x7f79981589a0,
msg=0x7f799817fd20) at action.c:172

Quick question for you: you are sending a malformed INVITE, correct? Here is
how mine looked like:

INVITE sip:sipp@127.0.0.1:5060 SIP/2.0.
Via: SIP/2.0/UDP 127.0.0.1:7000;branch=z9hG4bK-1988-1-0.
From: sipp ;tag=123456789.
To: sut .
CSeq: 1 INVITE.
Contact:Call-ID: 1-1988@127.0.0.1.
Max-Forwards: 70.
Subject: Performance Test.
Content-Type: application/sdp.
Content-Length:   129.
.
v=0.
o=user1 53655765 2353687637 IN IP4 127.0.0.1.
s=-.
c=IN IP4 127.0.0.1.
t=0 0.
m=audio 6001 RTP/AVP 0.
a=rtpmap:0 PCMU/8000.

Notice how OpenSIPS will be unable to parse the Call-ID header field, hence
the immediate crash in sip_trace(), as it's unable to handle a NULL Call-ID.

Best regards,

Liviu Chircu

OpenSIPS Developer

http://www.opensips-solutions.com

On 07.06.2018 22:24, Ben Newlin wrote:

Hi,



While running a new test scenario I encountered an OpenSIPS crash.



version: opensips 2.3.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_lt, epoll_et, sigio_rt, select.

git revision: a0bed9d

main.c compiled on 21:08:28 May 16 2018 with gcc 4.8.5



Logs: https://pastebin.com/3vL3rbG4

BT: https://pastebin.com/tTp32ASC



Let me know if anything else is needed.



Thanks,

Ben Newlin






___

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] Sometimes duration is negative when using db_flat

2018-06-08 Thread Aqs Younas
Greetings,

I am using db_flatstore to store cdrs and later on process them by some
external script. But I see sometimes duration and setuptime are in
negative.

Below is just an example of one record. Duration being negative.
INVITE|5X1Kv9cypr62B|as645142e8|fe050032-e538-1236-31be-02420a0f0704|200|OK|1528405376|0|1528405376
*|-1|1271309423*

Could someone please shed a light what might be the reason behind duration
in negative.
version: opensips 2.4.1 (x86_64/linux)

Best Regards,

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


[OpenSIPS-Users] OpenSIPs 2.3.3 - cachedb_mongodb - problems with connecting to secure Mongo with the latest mongoc driver

2018-06-08 Thread vladimirk
Hello,

I am trying to use db_cachedb in conjunction with cachedb_mongodb.
Everything was working fine until we switched to the secured Mongo DB. Now
we switched to use secure mongo instance.

When we use a connection string like below

Config:
loadmodule "cachedb_mongodb.so"
modparam("cachedb_mongodb", "compat_mode_3.0", 1)
loadmodule "db_cachedb.so"
modparam("cachedb_mongodb|db_cachedb", "cachedb_url",
"mongodb:global://myUser:SuperSecret@mongocluster:27017/opensips.col")
modparam("db_cachedb", "cachedb_url",
"mongodb:instance1://myUser:SuperSecret@mongolocal:27017/opensips.col")

 server fails with the following error:

Log:
Jun  8 19:39:02 [30738] DBG:db_cachedb:db_cachedb_bind_api: BINDING API for
: cachedb://mongodb:instance1
Jun  8 19:39:02 [30738] DBG:db_cachedb:db_cachedb_init: Found matching URL :
[mongodb:instance1://myUser:SuperSecret@mongolocal:27017/opensips.col]
Jun  8 19:39:02 [30738] DBG:core:cachedb_bind_mod: Binded to mod mongodb
Jun  8 19:39:02 [30738] DBG:core:parse_cachedb_url: parsing
[mongodb:instance1://myUser:SuperSecret@mongolocal:27017/opensips.col]
Jun  8 19:39:02 [30738] DBG:core:parse_cachedb_url: in host - :
Jun  8 19:39:02 [30738] DBG:core:cachedb_do_init: opening new connection
Jun  8 19:39:02 [30738] DBG:cachedb_mongodb:mongo_new_connection: MongoDB
conn for [opensips-30738]: mongodb:instance1 myUser:SuperSecret
|mongolocal|:27017
Jun  8 19:39:02 [30738] DBG:cachedb_mongodb:mongo_new_connection: cstr:
mongodb://myUser:SuperSecret@mongolocal:27017/opensips.col
2018/06/08 19:39:02.0865: [30738]:  WARNING:   mongoc: Error parsing
URI: 'Invalid database name in URI'
Jun  8 19:39:02 [30738] ERROR:cachedb_mongodb:mongo_new_connection: failed
to connect to Mongo
(mongodb://myUser:SuperSecret@mongolocal:27017/opensips.col)
Jun  8 19:39:02 [30738] ERROR:core:cachedb_do_init: failed to open
connection
Jun  8 19:39:02 [30738] ERROR:db_cachedb:db_cachedb_init: Failed to connect
to the cachedb back-end


I have also noticed, that when we have user/password in the URL,
mongo_new_connection receives connection string with the collection name at
the end

Jun  8 19:39:02 [30738] DBG:cachedb_mongodb:mongo_new_connection: cstr:
mongodb://myUser:SuperSecret@mongolocal:27017/opensips.col

This is not happening if I use connection string with authentication.

Can you help to resolve this issue? Can this be resolved with the
configuration only or this looks more like a code issue?

Thanks,
Vladimir





--
Sent from: 
http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

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