[OpenSIPS-Users] OpenSIPS 3 Installation on Debian - Detailed Blog

2020-02-13 Thread Sharad Kumar via Users
Hey guys,

I just wrote a blog on OpenSIPS 3 installation on Debian. I hope this blog will 
help newbies to get started pretty quick on OpenSIPS. Please review and comment 
.
https://www.securevoip.io/2020/02/13/how-to-install-opensips-3-from-source-on-debian/

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


Re: [OpenSIPS-Users] How to start OpenSIPS 3.0 server

2020-02-13 Thread Liviu Chircu

On 13.02.2020 18:41, Callum Guy wrote:
shows a resource limit error "Starting opensips (via systemctl):  Job 
for opensips.service failed because a configured resource limit was 
exceeded."


IMO, that is a typical systemd error, since it attempts to start your 
service in some
insane "while (!started) { start_service() }"  type of loop until it 
realizes that it
did so many quick attempts that it ran out of resource X (cycles, 
memory, disk, etc.)

and needs to throttle things down...

--
Liviu Chircu
www.twitter.com/liviuchircu | www.opensips-solutions.com

OpenSIPS Summit, Amsterdam, May 2020
  www.opensips.org/events
OpenSIPS Bootcamp, Miami, March 2020
  www.opensips.org/training


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


Re: [OpenSIPS-Users] How to start OpenSIPS 3.0 server

2020-02-13 Thread Callum Guy
I would imagine Liviu is correct, the answer will be quite clear

Not sure if you have seen my earlier comments but wanted to reiterate that
your initial email shows a resource limit error "Starting opensips (via
systemctl):  Job for opensips.service failed because a configured resource
limit was exceeded."

Try looking at the service file systemd is using, try something like the
following (P.S. your init.d file is probably not relevant):

[16:36]  FR-P-SIPSBC-3  $ sudo systemctl cat opensips
# /etc/systemd/system/opensips.service
[Unit]
Description=OpenSIPS is a very fast and flexible SIP (RFC3261) server
Documentation=man:opensips
After=network.target mysqld.service postgresql.service rtpproxy.service

[Service]
Type=forking
User=opensips
Group=opensips
RuntimeDirectory=opensips
RuntimeDirectoryMode=775
Environment=
EnvironmentFile=-/etc/sysconfig/opensips
PermissionsStartOnly=yes
PIDFile=%t/opensips/opensips.pid
ExecStart=/usr/sbin/opensips -P %t/opensips/opensips.pid -f
/etc/opensips/opensips.cfg -m $S_MEMORY -M $P_MEMORY $OPTIONS
ExecStop=/usr/bin/pkill --pidfile %t/opensips/opensips.pid
Restart=always
TimeoutStopSec=30s
LimitNOFILE=262144

[Install]
WantedBy=multi-user.target

Try changing the P_MEMORY/S_MEMORY values in the listed Env file and if you
tweak this file run systemctl daemon-reload before trying to start it.

On Thu, 13 Feb 2020 at 16:10, Liviu Chircu  wrote:

> On 13.02.2020 11:19, Tekin, Arda wrote:
>
> It prints too many logs when I run below command manually
>
> opensips –DD –E
>
> Well, those logs are _exactly_ where you should be starting at!  Redirect
> them
> to a file, maybe with "opensips -D -E &>/tmp/out &", then do "less
> /tmp/out" and
> take a look for any helpful errors.
>
> I assume you just want to start with the default
> /etc/opensips/opensips.cfg that
> comes with the "opensips" CentOS package, right?
>
> Regards,
>
> --
> Liviu Chircuwww.twitter.com/liviuchircu | www.opensips-solutions.com
>
> OpenSIPS Summit, Amsterdam, May 2020
>   www.opensips.org/events
> OpenSIPS Bootcamp, Miami, March 2020
>   www.opensips.org/training
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>

-- 





*0333 332   |  www.x-on.co.uk   |   ** 
    
   *


X-on
is a trading name of Storacall 
Technology Ltd a limited company registered in
England and Wales.


Registered Office : Avaland House, 110 London Road, Apsley, Hemel 
Hempstead,
Herts, HP3 9SD. Company Registration No. 2578478.

The 
information in this e-mail is confidential and for use by the addressee(s)

only. If you are not the intended recipient, please notify X-on immediately 
on +44(0)333 332  and delete the
message from your computer. If you are 
not a named addressee you must not use,
disclose, disseminate, distribute, 
copy, print or reply to this email. Views
or opinions expressed by an 
individual
within this email may not necessarily
reflect the views of X-on 
or its associated companies. Although X-on routinely
screens for viruses, 
addressees should scan this email and any attachments
for
viruses. X-on 
makes no representation or warranty as to the absence of viruses
in this 
email or any attachments.










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


Re: [OpenSIPS-Users] How to start OpenSIPS 3.0 server

2020-02-13 Thread Liviu Chircu

On 13.02.2020 11:19, Tekin, Arda wrote:


It prints too many logs when I run below command manually

opensips –DD –E

Well, those logs are _exactly_ where you should be starting at!  
Redirect them
to a file, maybe with "opensips -D -E &>/tmp/out &", then do "less 
/tmp/out" and

take a look for any helpful errors.

I assume you just want to start with the default 
/etc/opensips/opensips.cfg that

comes with the "opensips" CentOS package, right?

Regards,

--
Liviu Chircu
www.twitter.com/liviuchircu | www.opensips-solutions.com

OpenSIPS Summit, Amsterdam, May 2020
  www.opensips.org/events
OpenSIPS Bootcamp, Miami, March 2020
  www.opensips.org/training

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


Re: [OpenSIPS-Users] How to start OpenSIPS 3.0 server

2020-02-13 Thread David Villasmil
Try to find an ERR or CRITICAL in the output. After executing manually, if
opensips is running (and you’re executing it while you’re toot), then it’s
probably related to permissions for the using running it (opensips)

On Thu, 13 Feb 2020 at 04:19, Tekin, Arda  wrote:

> It prints too many logs when I run below command manually
>
> opensips –DD –E
>
>
>
> I tried to share the output of command but mail server is blocking my
> mail. That’s my 3rd try
>
>
>
> Let me share these notes,
>
>
>
> Opensips binary is under standard prefix
>
> [root@a3783871a39f ~]# which opensips
>
> /usr/local/sbin/opensips
>
>
>
>
>
> When I run opensips manually it works
>
> [root@a3783871a39f init.d]# opensips
>
> Listening on
>
>  udp: 172.16.30.241 [172.16.30.241]:5060
>
> Aliases:
>
>
>
> Verified that it listens udp:5060
>
> [root@a3783871a39f run]# netstat -anp | grep opensips
>
> udp0  0 172.16.30.241:5060  0.0.0.0:*
> 31542/opensips
>
> unix  2  [ ] DGRAM21043523 31542/opensips
>
> unix  2  [ ] DGRAM21043526 31542/opensips
>
>
>
> Opensips service start script  looks like this,
>
> [root@a3783871a39f ~]# cat /etc/rc.d/init.d/opensips
>
> …
>
> …
>
>
>
> # Source function library.
>
> . /etc/rc.d/init.d/functions
>
> prog=opensips
>
> opensips=/usr/local/sbin/$prog
>
> cfgdir="/usr/local/etc/$prog"
>
> pidfile="/var/run/$prog.pid"
>
> lockfile="/var/lock/subsys/$prog"
>
> configfile="$cfgdir/$prog.cfg"
>
> m4configfile="$cfgdir/$prog.m4"
>
> m4archivedir="$cfgdir/archive"
>
> OPTIONS=""
>
> S_MEMORY=32
>
> P_MEMORY=32
>
> RETVAL=0
>
> …
>
> …
>
> ---
>
>
>
> systemctl start opensips
>
> service opensips start
>
> commands gives the same result.
>
> Starting opensips (via systemctl):  Job for opensips.service failed
> because a configured resource limit was exceeded. See "systemctl status
> opensips.service" and "journalctl -xe" for details.
>
>[FAILED]
>
>
>
> Any idea?
>
> Do you see any help document that explains how Opensips 3.0 should be
> started by a command/service script?
>
>
>
> Regards,
>
> Arda
>
>
>
>
>
> *From:* Users  *On Behalf Of *David
> Villasmil
> *Sent:* Wednesday, February 12, 2020 4:55 PM
> *To:* OpenSIPS users mailling list 
> *Subject:* Re: [OpenSIPS-Users] How to start OpenSIPS 3.0 server
>
>
>
> *Attention: This email was sent from someone outside of Afiniti. Always
> use caution when opening attachments, clicking links from unknown senders
> or when receiving unexpected emails.*
>
>
>
> That’s your problem. Make sure the path exists and opensips can create the
> pid file there.
>
>
>
> Other test you can do is start manually, I.e: opensips -DD -E
>
> Providing the proper config file; etc.
>
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
-- 
Regards,

David Villasmil
email: david.villasmil.w...@gmail.com
phone: +34669448337
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] [BLOG] Quality-based Routing in OpenSIPS 3.1 LTS

2020-02-13 Thread Johan De Clercq
Interesting concept.   Makes a lot of sense for outbound call centers with
multiple interconnect links.

Op do 13 feb. 2020 om 15:11 schreef Liviu Chircu :

> Hi all,
>
> I wrote a 5-minute read [1] on the newly introduced OpenSIPS module,
> "qrouting" (quality-based routing).
> This new module keeps track of call signaling statistics such as ASR,
> PDD, AST, ACD and offers an easy
> way to select the PSTN gateway that best satisfies them.  This is all in
> real-time, so gateway
> ordering is permanently in subject to change, depending on how well they
> perform!
>
> I hope you enjoy it!  If there are any questions about the logic, I will
> gladly answer them! :)
>
> Best regards,
>
> [1]:
>
> https://blog.opensips.org/2020/02/13/quality-based-pstn-routing-in-opensips-3-1-lts/
>
> --
> Liviu Chircu
> www.twitter.com/liviuchircu | www.opensips-solutions.com
>
> OpenSIPS Summit, Amsterdam, May 2020
>www.opensips.org/events
> OpenSIPS Bootcamp, Miami, March 2020
>www.opensips.org/training
>
>
> ___
> 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] Add URI parameter to From hearder

2020-02-13 Thread Andreas Sikkema
Alain,

> I used this to do it :
> uac_replace_to("sip:$rU@$dd;user=phone");

Of course, I forgot that the parameter is in the uri and not outside
the uri. My bad.

Thanks for the assistance!

-- 
Andreas

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


Re: [OpenSIPS-Users] Question about qrouting module

2020-02-13 Thread Liviu Chircu

On 13.02.2020 16:02, Abdoul Osséni wrote:

Congratulations for the work done. In my opinion, it is a big feature.
Thank you!  Over the years, there were lots of discussions on this 
topic.  To quote Linus
Torvalds: "Talk is cheap.  Show me the code." -- that'spretty much what 
we finally decided to do.


I have a question about replication of qmodule data (signaling 
statistics) in a Opensips cluster.
If I have 2 active nodes in the cluster. Is the both nodes will share 
qmodule data?

Is it done automatically or I need to make something ?


The qrouting module is currently not cluster aware, so no qrouting 
statistics will be shared
between your nodes.  The gatewaydisabling logic [1] is not even restart 
persistent, so there are

plentyof work and ideas to put into the module!

[1]: 
https://opensips.org/docs/modules/3.1.x/qrouting.html#func_qr_disable_dst


--
Liviu Chircu
www.twitter.com/liviuchircu | www.opensips-solutions.com

OpenSIPS Summit, Amsterdam, May 2020
  www.opensips.org/events
OpenSIPS Bootcamp, Miami, March 2020
  www.opensips.org/training


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


[OpenSIPS-Users] [BLOG] Quality-based Routing in OpenSIPS 3.1 LTS

2020-02-13 Thread Liviu Chircu

Hi all,

I wrote a 5-minute read [1] on the newly introduced OpenSIPS module, 
"qrouting" (quality-based routing).
This new module keeps track of call signaling statistics such as ASR, 
PDD, AST, ACD and offers an easy
way to select the PSTN gateway that best satisfies them.  This is all in 
real-time, so gateway
ordering is permanently in subject to change, depending on how well they 
perform!


I hope you enjoy it!  If there are any questions about the logic, I will 
gladly answer them! :)


Best regards,

[1]: 
https://blog.opensips.org/2020/02/13/quality-based-pstn-routing-in-opensips-3-1-lts/


--
Liviu Chircu
www.twitter.com/liviuchircu | www.opensips-solutions.com

OpenSIPS Summit, Amsterdam, May 2020
  www.opensips.org/events
OpenSIPS Bootcamp, Miami, March 2020
  www.opensips.org/training


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


[OpenSIPS-Users] Question about qrouting module

2020-02-13 Thread Abdoul Osséni
Hello team,

I just read your works (
https://blog.opensips.org/2020/02/13/quality-based-pstn-routing-in-opensips-3-1-lts/)
about grouting module.
Congratulations for the work done. In my opinion, it is a big feature.

I have a question about replication of qmodule data (signaling statistics)
in a Opensips cluster.
If I have 2 active nodes in the cluster. Is the both nodes will share
qmodule data?
Is it done automatically or I need to make something ?

Regards
Abdoul OSSENI
AfriCallShop: https://www.africallshop.com/
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Cannot create opensips database for postgresql using opensips-cli

2020-02-13 Thread Tekin, Arda
Hi Ryan

I have recently created the postgres tables by opensips-cli tool.
Copy the default.cfg under your home directory. (while I am root)
cp /root/src/opensips-cli/etc/default.cfg /root/opensips-cli.cfg

add postgres section in opensips-cli.cfg.

The postgres password should be previously set by psql command.

My file looks like this

[default]
log_level: WARNING
prompt_name: opensips-cli
prompt_intro: Welcome to OpenSIPS Command Line Interface!
prompt_emptyline_repeat_cmd: False
history_file: ~/.opensips-cli.history
history_file_size: 1000
output_type: pretty-print
communication_type: fifo
fifo_file: /tmp/opensips_fifo

# optional DB override instance, invoked using `opensips-cli -i postgres ...`
[postgres]
database_path: /usr/local/share/opensips/postgres
database_url: postgres://opensips:@:5432
template_url: postgres://postgres:@:5432
database_name: opensips


Then run the following command to create all tables of opensips

opensips-cli -f /root/opensips-cli.cfg -i postgres -x database create


opensips-cli uses the sql files in /usr/local/share/opensips/postgres path when 
creating tables.


Arda

From: Users  On Behalf Of Ryan embgrets
Sent: Monday, February 10, 2020 12:22 AM
To: users@lists.opensips.org
Subject: [OpenSIPS-Users] Cannot create opensips database for postgresql using 
opensips-cli


Attention: This email was sent from someone outside of Afiniti. Always use 
caution when opening attachments, clicking links from unknown senders or when 
receiving unexpected emails.


Greetings,

I am trying to create opensips database using opensips-cli module but each time 
it is failing.
I am getting below error during the process.

(opensips-cli): database create
Please provide the URL of the SQL database: 
postgres://opensips:opensipsrw@127.0.0.1
ERROR: cannot connect to DB server: (psycopg2.OperationalError) FATAL:  
database "opensips" does not exist
!
Traceback (most recent call last):
  File "/usr/lib/python3.5/cmd.py", line 214, in onecmd
func = getattr(self, 'do_' + cmd)
AttributeError: 'OpenSIPSCLIShell' object has no attribute 'do_database'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/sqlalchemy/pool.py", line 1044, in 
_do_get
return self._pool.get(wait, self._timeout)
  File "/usr/lib/python3/dist-packages/sqlalchemy/util/queue.py", line 145, in 
get
raise Empty
sqlalchemy.util.queue.Empty

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/sqlalchemy/engine/base.py", line 2074, 
in _wrap_pool_connect
return fn()
  File "/usr/lib/python3/dist-packages/sqlalchemy/pool.py", line 318, in 
unique_connection
return _ConnectionFairy._checkout(self)
  File "/usr/lib/python3/dist-packages/sqlalchemy/pool.py", line 713, in 
_checkout
fairy = _ConnectionRecord.checkout(pool)
  File "/usr/lib/python3/dist-packages/sqlalchemy/pool.py", line 480, in 
checkout
rec = pool._do_get()
  File "/usr/lib/python3/dist-packages/sqlalchemy/pool.py", line 1060, in 
_do_get
self._dec_overflow()
  File "/usr/lib/python3/dist-packages/sqlalchemy/util/langhelpers.py", line 
60, in __exit__
compat.reraise(exc_type, exc_value, exc_tb)
  File "/usr/lib/python3/dist-packages/sqlalchemy/util/compat.py", line 186, in 
reraise
raise value
  File "/usr/lib/python3/dist-packages/sqlalchemy/pool.py", line 1057, in 
_do_get
return self._create_connection()
  File "/usr/lib/python3/dist-packages/sqlalchemy/pool.py", line 323, in 
_create_connection
return _ConnectionRecord(self)
  File "/usr/lib/python3/dist-packages/sqlalchemy/pool.py", line 449, in 
__init__
self.connection = self.__connect()
  File "/usr/lib/python3/dist-packages/sqlalchemy/pool.py", line 607, in 
__connect
connection = self.__pool._invoke_creator(self)
  File "/usr/lib/python3/dist-packages/sqlalchemy/engine/strategies.py", line 
97, in connect
return dialect.connect(*cargs, **cparams)
  File "/usr/lib/python3/dist-packages/sqlalchemy/engine/default.py", line 385, 
in connect
return self.dbapi.connect(*cargs, **cparams)
  File "/usr/lib/python3/dist-packages/psycopg2/__init__.py", line 126, in 
connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: FATAL:  database "opensips" does not exist

Any help here is much appreciated.

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


Re: [OpenSIPS-Users] How to start OpenSIPS 3.0 server

2020-02-13 Thread Tekin, Arda
It prints too many logs when I run below command manually
opensips –DD –E

I tried to share the output of command but mail server is blocking my mail. 
That’s my 3rd try

Let me share these notes,

Opensips binary is under standard prefix
[root@a3783871a39f ~]# which opensips
/usr/local/sbin/opensips


When I run opensips manually it works
[root@a3783871a39f init.d]# opensips
Listening on
 udp: 172.16.30.241 [172.16.30.241]:5060
Aliases:

Verified that it listens udp:5060
[root@a3783871a39f run]# netstat -anp | grep opensips
udp0  0 172.16.30.241:5060  0.0.0.0:*   
31542/opensips
unix  2  [ ] DGRAM21043523 31542/opensips
unix  2  [ ] DGRAM21043526 31542/opensips

Opensips service start script  looks like this,
[root@a3783871a39f ~]# cat /etc/rc.d/init.d/opensips
…
…

# Source function library.
. /etc/rc.d/init.d/functions
prog=opensips
opensips=/usr/local/sbin/$prog
cfgdir="/usr/local/etc/$prog"
pidfile="/var/run/$prog.pid"
lockfile="/var/lock/subsys/$prog"
configfile="$cfgdir/$prog.cfg"
m4configfile="$cfgdir/$prog.m4"
m4archivedir="$cfgdir/archive"
OPTIONS=""
S_MEMORY=32
P_MEMORY=32
RETVAL=0
…
…
---

systemctl start opensips
service opensips start
commands gives the same result.
Starting opensips (via systemctl):  Job for opensips.service failed because a 
configured resource limit was exceeded. See "systemctl status opensips.service" 
and "journalctl -xe" for details.
   [FAILED]

Any idea?
Do you see any help document that explains how Opensips 3.0 should be started 
by a command/service script?

Regards,
Arda


From: Users  On Behalf Of David Villasmil
Sent: Wednesday, February 12, 2020 4:55 PM
To: OpenSIPS users mailling list 
Subject: Re: [OpenSIPS-Users] How to start OpenSIPS 3.0 server


Attention: This email was sent from someone outside of Afiniti. Always use 
caution when opening attachments, clicking links from unknown senders or when 
receiving unexpected emails.


That’s your problem. Make sure the path exists and opensips can create the pid 
file there.

Other test you can do is start manually, I.e: opensips -DD -E
Providing the proper config file; etc.

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


Re: [OpenSIPS-Users] codec_delete_except_re

2020-02-13 Thread Bogdan-Andrei Iancu

Hi Alain,

Is is legal to have same codec ID more than once in the the `m` line ?? 
I see that 18 is mentioned like 3 times :-/.


Anyhow, for what you need, what you should do is:
* iterate through the `a` lines using the {sdp.line} transformation
* use a a regexp to check if the current `a` line contains "annexb=yes"
* if such a line was found, go back (decrementing the index of `a` 
lines) and search (backwards) the first `rtpmap` line
* once the rtpmap line found, use the {re.subst,reg_exp} transformation 
to get the codec ID from the line

* after that, simply use the codec delete function

Best regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Summit, Amsterdam, May 2020
  https://www.opensips.org/events/Summit-2020Amsterdam/
OpenSIPS Bootcamp, Miami, March 2020
  https://opensips.org/training/OpenSIPS_Bootcamp_2020/

On 2/11/20 3:35 PM, Alain Bieuzent wrote:


Hi all,

I received an SDP with several codec G729 (with annexb=yes and annexb=no)

=0

o=HNET 600152000 100017799 IN IP4 0.0.0.0

s=0_CALLMEDIA

i=HNET

c=IN IP4 0.0.0.0

t=0 0

m=audio 64976 RTP/AVP 18 18 18 8 101

a=rtpmap:18 G729/8000

a=fmtp:18 annexb=yes

a=ptime:20

a=rtpmap:18 G729/8000

a=fmtp:18 annexb=no

a=rtpmap:18 G729/8000

a=fmtp:18 annexb=yes

a=rtpmap:8 PCMA/8000

a=rtpmap:101 telephone-event/8000

a=fmtp:101 0-15

a=sendonly

How can I delete codec where annexb=yes ?

Thanks for your help


___
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