TRY THIS OpenSIPS Avoids Kamailio Woes

tbrummell

Guru
Joined
Jan 8, 2011
Messages
1,275
Reaction score
339
I reviewed the script, to be clear, what am I forwarding to Asterisk? Any dialable number I have on my existing system that I want to dial from opensips? Consequently, I assume I'm going to need an Outbound Route from Asterisk to Opensips for any extension I have residing there.
I'm going to have to wait for your TUT I guess to see how this is all going to play out.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
With OpenSIPS, using a SIP phone from anywhere in the world, any SIP user CAN:

  • Make SIP URI calls to authorized extensions and ring groups on your Asterisk PBX
  • Make SIP URI calls to authorized clients registered to a 3CX PBX with a SIP UUID
  • With a legitimate password, make DISA-like calls with Asterisk trunks, if enabled
  • With an invalid DISA password, converse with Lenny
  • With a legitimate password, check and manage authorized Asterisk voicemail accounts
  • With a legitimate password, participate in authorized Asterisk conferences
  • Access other authorized Asterisk applications available from Asterisk extensions
Using a SIP phone from anywhere in the world, an OpenSIPS-registered User also CAN:

  • Make PSTN calls from OpenSIPS-registered SIP phones, if enabled
  • Receive calls from Asterisk forwarded to any OpenSIPS-registered SIP phone
  • Receive calls from Asterisk forwarded to any 3CX-registered client or SIP phone
Using any SIP phone registered to a SIP proxy, you CANNOT:

  • Log into any Asterisk user account without whitelist permission and credentials
  • Make 911 calls
 

tbrummell

Guru
Joined
Jan 8, 2011
Messages
1,275
Reaction score
339
Decided to try this again today. Freshly deployed Deb 8 on Vultr. rtpproxy fails to install, tried twice. I went through the install script and ran the commands associated to rtpproxy manually and found this after running make:
Code:
main.c:925:50: error: 'struct rtpp_cfg_stable' has no member named 'run_gname'
     if (cf.stable->run_uname != NULL || cf.stable->run_gname != NULL) {
                                                  ^
main.c:926:22: warning: passing argument 1 of 'drop_privileges' from incompatible pointer type
  if (drop_privileges(&cf) != 0) {
                      ^
In file included from main.c:60:0:
rtpp_util.h:44:5: note: expected 'const struct rtpp_cfg_stable *' but argument is of type 'struct cfg *'
 int drop_privileges(const struct rtpp_cfg_stable *);
     ^
main.c:759:15: warning: variable 'ncycles_ref' set but not used [-Wunused-but-set-variable]
     long long ncycles_ref, counter;
               ^
Makefile:2940: recipe for target 'rtpproxy-main.o' failed
make[2]: *** [rtpproxy-main.o] Error 1
make[2]: Leaving directory '/usr/src/rtpproxy/src'
Makefile:1236: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/usr/src/rtpproxy/src'
Makefile:487: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
root@opensips:/usr/src/rtpproxy#

I also noticed the git clone command is expecting a tar.gz file to be downloaded, but instead it gets a directory of files. It doesn't appear to hurt anything, just the extract command fails.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
@tbrummell: I know you must think we don't test or use this stuff. But, as I've said many times, the problem with open source code is the number of folks that are always improving things. RTPproxy made it a whole week without breaking so we've dropped back to rtpproxy 1.2.1 which actually works. Tested on Vultr, and it's fine now. Sorry.
 

tbrummell

Guru
Joined
Jan 8, 2011
Messages
1,275
Reaction score
339
Ohhh I hear you. I know it works as I went through it last week and it was fine. I'll take another stab tomorrow with the update.
 

tbrummell

Guru
Joined
Jan 8, 2011
Messages
1,275
Reaction score
339
So the install worked. 2 phones registered (Snom 370 behind a Fortigate and Groundwire on mobile data) and I have no RTP between callers. Not knowing a lick about Opensips, I'm sort of stuck.
 

tbrummell

Guru
Joined
Jan 8, 2011
Messages
1,275
Reaction score
339
No (restrictive) firewalls involved except for what's included in the build. SDP should include the port to use when the call is nailed up. Could be more to it, but don't know where to begin looking.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
Does systemctl status opensips show the RTP ports working?
 

tbrummell

Guru
Joined
Jan 8, 2011
Messages
1,275
Reaction score
339
I'll have to let you be the judge of that..... ;)
Code:
root@opensips:~# systemctl status opensips
● opensips.service - OpenSIPS is a very fast and flexible SIP (RFC3261) server
   Loaded: loaded (/lib/systemd/system/opensips.service; enabled)
   Active: active (running) since Wed 2019-05-22 08:13:08 EDT; 6h ago
     Docs: man:opensips
  Process: 1193 ExecStop=/usr/bin/pkill --pidfile %t/opensips/opensips.pid (code=exited, status=0/SUCCESS)
  Process: 1196 ExecStart=/usr/sbin/opensips -P %t/opensips/opensips.pid -f /etc/opensips/opensips.cfg -m $S_MEMORY -M $P_MEMORY $OPTIONS (code=exited, status=0/SUCCESS)
  Process: 1195 ExecStartPre=/usr/sbin/opensips-m4cfg (code=exited, status=0/SUCCESS)
 Main PID: 1200 (opensips)
   CGroup: /system.slice/opensips.service
           ├─1200 /usr/sbin/opensips -P /run/opensips/opensips.pid -f /etc/opensips/opensips.cfg -m 64 -M 4
           ├─1202 /usr/sbin/opensips -P /run/opensips/opensips.pid -f /etc/opensips/opensips.cfg -m 64 -M 4
           ├─1203 /usr/sbin/opensips -P /run/opensips/opensips.pid -f /etc/opensips/opensips.cfg -m 64 -M 4
           ├─1204 /usr/sbin/opensips -P /run/opensips/opensips.pid -f /etc/opensips/opensips.cfg -m 64 -M 4
           ├─1205 /usr/sbin/opensips -P /run/opensips/opensips.pid -f /etc/opensips/opensips.cfg -m 64 -M 4
           ├─1206 /usr/sbin/opensips -P /run/opensips/opensips.pid -f /etc/opensips/opensips.cfg -m 64 -M 4
           ├─1207 /usr/sbin/opensips -P /run/opensips/opensips.pid -f /etc/opensips/opensips.cfg -m 64 -M 4
           ├─1208 /usr/sbin/opensips -P /run/opensips/opensips.pid -f /etc/opensips/opensips.cfg -m 64 -M 4
           ├─1209 /usr/sbin/opensips -P /run/opensips/opensips.pid -f /etc/opensips/opensips.cfg -m 64 -M 4
           ├─1210 /usr/sbin/opensips -P /run/opensips/opensips.pid -f /etc/opensips/opensips.cfg -m 64 -M 4
           ├─1211 /usr/sbin/opensips -P /run/opensips/opensips.pid -f /etc/opensips/opensips.cfg -m 64 -M 4
           ├─1212 /usr/sbin/opensips -P /run/opensips/opensips.pid -f /etc/opensips/opensips.cfg -m 64 -M 4
           ├─1213 /usr/sbin/opensips -P /run/opensips/opensips.pid -f /etc/opensips/opensips.cfg -m 64 -M 4
           ├─1216 /usr/sbin/opensips -P /run/opensips/opensips.pid -f /etc/opensips/opensips.cfg -m 64 -M 4
           ├─1217 /usr/sbin/opensips -P /run/opensips/opensips.pid -f /etc/opensips/opensips.cfg -m 64 -M 4
           ├─1218 /usr/sbin/opensips -P /run/opensips/opensips.pid -f /etc/opensips/opensips.cfg -m 64 -M 4
           ├─1219 /usr/sbin/opensips -P /run/opensips/opensips.pid -f /etc/opensips/opensips.cfg -m 64 -M 4
           ├─1224 /usr/sbin/opensips -P /run/opensips/opensips.pid -f /etc/opensips/opensips.cfg -m 64 -M 4
           └─1225 /usr/sbin/opensips -P /run/opensips/opensips.pid -f /etc/opensips/opensips.cfg -m 64 -M 4

May 22 09:40:29 opensips.myFQDN.com /usr/sbin/opensips[1209]: ERROR:core:receive_msg: Unable to parse msg received from [184.151.111.18:9025]
May 22 09:40:30 opensips.myFQDN.com /usr/sbin/opensips[1209]: ERROR:presence:handle_subscribe: un-registered support for known event [message-summary]
May 22 09:40:30 opensips.myFQDN.com /usr/sbin/opensips[1209]: INFO:presence:handle_subscribe: Missing or unsupported event header field value
May 22 09:40:30 opensips.myFQDN.com /usr/sbin/opensips[1209]: INFO:presence:handle_subscribe:         event= message-summary
May 22 10:38:08 opensips.myFQDN.com /usr/sbin/opensips[1209]: Auth error for [email protected] from 185.53.91.103 method OPTIONS user-agent (friendly-scanner|sipvicious|sipcli)
May 22 12:06:11 opensips.myFQDN.com /usr/sbin/opensips[1208]: Auth error for [email protected] from 185.53.91.103 method OPTIONS user-agent (friendly-scanner|sipvicious|sipcli)
May 22 13:38:26 opensips.myFQDN.com /usr/sbin/opensips[1209]: Auth error for [email protected] from 185.53.88.2 method REGISTER user-agent (friendly-scanner|sipvicious|sipcli)
May 22 13:55:35 opensips.myFQDN.com /usr/sbin/opensips[1225]: INFO:core:probe_max_sock_buff: using snd buffer of 416 kb
May 22 13:55:35 opensips.myFQDN.com /usr/sbin/opensips[1225]: INFO:core:init_sock_keepalive: TCP keepalive enabled on socket 71
May 22 13:59:02 opensips.myFQDN.com /usr/sbin/opensips[1206]: Auth error for [email protected] from 185.53.88.244 method OPTIONS user-agent (friendly-scanner|sipvicious|sipcli)
root@opensips:~#
 

tbrummell

Guru
Joined
Jan 8, 2011
Messages
1,275
Reaction score
339
I'm guessing the lines @ 9:40 this morning we're from my mobile, that's around the time I was testing.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
Try the following and see if it helps on the RTP. Firewall is already configured for this RTP range. And whitelist shouldn't be necessary, but it could be an issue with some routers.
Code:
sed -i 's|$LISTEN_ADDR|$LISTEN_ADDR -m 10000 -M 20000|' /etc/default/rtpproxy
/etc/init.d/rtpproxy restart
systemctl restart opensips
systemctl status opensips
 
Last edited:

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
I've updated the installer to 1.2.3 with the change. Thanks.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
@tbrummell: I see you've picked up a few of our favorite bad guys already. You might want to load our badguys list which is now documented in the tutorial. :)

Code:
cd /etc
wget http://incrediblepbx.com/badguys.tar.gz
tar zxvf badguys.tar.gz
rm -f badguys.tar.gz
reboot
 

tbrummell

Guru
Joined
Jan 8, 2011
Messages
1,275
Reaction score
339
Le sighhhh.....
Trying to add the forward to Asterisk:
Code:
root@opensips:~# ./asterisk-add-forward 206 206 My.Asterisk.I.P
MySQL password is opensipsrw...
MySQL password for user 'opensips@localhost':
ERROR 1045 (28000): Access denied for user 'opensips'@'localhost' (using password: YES)
ERROR: avp add - SQL Error
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,168
Reaction score
5,199
Le sighhhh.....
Trying to add the forward to Asterisk:
Code:
root@opensips:~# ./asterisk-add-forward 206 206 My.Asterisk.I.P
MySQL password is opensipsrw...
MySQL password for user 'opensips@localhost':
ERROR 1045 (28000): Access denied for user 'opensips'@'localhost' (using password: YES)
ERROR: avp add - SQL Error

Did you actually enter the password when prompted for it: opensipsrw
 

tbrummell

Guru
Joined
Jan 8, 2011
Messages
1,275
Reaction score
339
Haha Haha OMG I'm an idiot. I didn't even see that. Just one of those days. Time to revisit that in the morning.
 

Members online

No members online now.

Forum statistics

Threads
25,779
Messages
167,505
Members
19,199
Latest member
leocipriano
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top