Re: [OpenSIPS-Users] Dispatcher within a K8s environment

2022-09-06 Thread Bogdan-Andrei Iancu

Hi Jon,

just a feature request on github.

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Summit 27-30 Sept 2022, Athens
  https://www.opensips.org/events/Summit-2022Athens/

On 9/1/22 9:01 PM, Jonathan Hunter wrote:


Hi Bogdan,

Ok cool shall whats the best way to do this?

Is it just a change request in GitHub? Or request for feature?

Also realistically when do you think something like this could be 
completed?


Thanks!

Jon

Sent from Mail  for 
Windows


*From: *Bogdan-Andrei Iancu 
*Sent: *30 August 2022 08:52
*To: *Jonathan Hunter ; OpenSIPS users 
mailling list 

*Subject: *Re: [OpenSIPS-Users] Dispatcher within a K8s environment

Hi Jonathan,

You mean something similar to that option in drouting ? If so, yes, it 
would make sense IMO.


Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
   https://www.opensips-solutions.com  

OpenSIPS Summit 27-30 Sept 2022, Athens
   https://www.opensips.org/events/Summit-2022Athens/  


On 8/26/22 5:36 PM, Jonathan Hunter wrote:

Hi Ben,

Great thank you for that I may well switch for now to drouting.

@Bogdan-Andrei Iancu  is it worth me
raising anything against dispatcher in terms of a change request
for dns behaviour?

Many thanks both.

Jon

Sent from Mail


for Windows

*From: *Ben Newlin 
*Sent: *25 August 2022 18:57
*To: *OpenSIPS users mailling list
; Bogdan-Andrei Iancu

*Subject: *Re: [OpenSIPS-Users] Dispatcher within a K8s environment

The drouting module has a parameter that allows you to disable the
DNS lookup.

https://opensips.org/docs/modules/3.2.x/drouting.html#param_force_dns



Ben Newlin

*From: *Users 
 on behalf of Jonathan
Hunter  
*Date: *Thursday, August 25, 2022 at 4:54 AM
*To: *Bogdan-Andrei Iancu 
, OpenSIPS users mailling list
 
*Subject: *Re: [OpenSIPS-Users] Dispatcher within a K8s environment

* EXTERNAL EMAIL - Please use caution with links and attachments *

Hi Bogdan,

Yes it would appear K8s implementations would be a very good topic
at the Summit that is for sure!

I understand your comments on dispatcher, its unfortunate as
everything else is working fine.

There was a suggestion to add a loopback address for example and
then update  when DNS has updated and records resolve?

Is there any benefit in using dr_routing instead or will this
behaviour be the same in the event of a dns lookup failure?

Thanks for the response!

Jon

Sent from Mail



Re: [OpenSIPS-Users] Autoscaler in 3.2.x

2022-09-06 Thread Bogdan-Andrei Iancu

Hi Yury,

Thanks for the info. I see that the stuck process (24) is an 
auto-scalled one (based on its id). Do you have SIP traffic from UDP to 
TCP or doing some HEP capturing for SIP ? I saw a recent similar report 
where a UDP auto-scalled worked got stuck when trying to do some 
communication with the TCP main/manager process (in order to handle a 
TCP operation).


BTW, any chance to do a "opensips-cli -x trap" when you have that stuck 
process, just to see where is it stuck? and is it hard to reproduce? as 
I may ask you to extract some information from the running process


Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Summit 27-30 Sept 2022, Athens
  https://www.opensips.org/events/Summit-2022Athens/

On 9/3/22 6:54 PM, Yury Kirsanov wrote:

Hi Bogdan,
This has finally happened, OS is stuck again in 100% for one of its 
processes. Here's the output of load: command:


opensips-cli -x mi get_statistics load:
{
    "load:load-proc-1": 0,
    "load:load1m-proc-1": 0,
    "load:load10m-proc-1": 0,
    "load:load-proc-2": 0,
    "load:load1m-proc-2": 0,
    "load:load10m-proc-2": 0,
    "load:load-proc-3": 0,
    "load:load1m-proc-3": 0,
    "load:load10m-proc-3": 0,
    "load:load-proc-4": 0,
    "load:load1m-proc-4": 0,
    "load:load10m-proc-4": 0,
    "load:load-proc-5": 0,
    "load:load1m-proc-5": 0,
    "load:load10m-proc-5": 8,
    "load:load-proc-6": 0,
    "load:load1m-proc-6": 0,
    "load:load10m-proc-6": 6,
    "load:load-proc-13": 0,
    "load:load1m-proc-13": 0,
    "load:load10m-proc-13": 0,
    "load:load-proc-14": 0,
    "load:load1m-proc-14": 0,
    "load:load10m-proc-14": 0,
    "load:load-proc-21": 0,
    "load:load1m-proc-21": 0,
    "load:load10m-proc-21": 0,
    "load:load-proc-22": 0,
    "load:load1m-proc-22": 0,
    "load:load10m-proc-22": 0,
    "load:load-proc-23": 0,
    "load:load1m-proc-23": 0,
    "load:load10m-proc-23": 0,
    "load:load-proc-24": 100,
    "load:load1m-proc-24": 100,
    "load:load10m-proc-24": 100,
    "load:load": 12,
    "load:load1m": 12,
    "load:load10m": 14,
    "load:load-all": 10,
    "load:load1m-all": 10,
    "load:load10m-all": 11,
    "load:processes_number": 13
}

As you can see, process 24 is consuming 100% of time for more than a 
minute already


Here's the output of process list, it's a UDP socket listener on 
internal interface that's stuck at 100% load:


opensips-cli -x mi ps
{
    "Processes": [
        {
            "ID": 0,
            "PID": 5457,
            "Type": "attendant"
        },
        {
            "ID": 1,
            "PID": 5463,
            "Type": "HTTPD 10.x.x.x:"
        },
        {
            "ID": 2,
            "PID": 5464,
            "Type": "MI FIFO"
        },
        {
            "ID": 3,
            "PID": 5465,
            "Type": "time_keeper"
        },
        {
            "ID": 4,
            "PID": 5466,
            "Type": "timer"
        },
        {
            "ID": 5,
            "PID": 5467,
            "Type": "SIP receiver udp:10.x.x.x:5060"
        },
        {
            "ID": 6,
            "PID": 5470,
            "Type": "SIP receiver udp:10.x.x.x:5060"
        },
        {
            "ID": 13,
            "PID": 5477,
            "Type": "SIP receiver udp:103.x.x.x:7060"
        },
        {
            "ID": 14,
            "PID": 5478,
            "Type": "SIP receiver udp:103.x.x.x:7060"
        },
        {
            "ID": 21,
            "PID": 5485,
            "Type": "TCP receiver"
        },
        {
            "ID": 22,
            "PID": 5486,
            "Type": "Timer handler"
        },
        {
            "ID": 23,
            "PID": 5487,
            "Type": "TCP main"
        },
        {
            "ID": 24,
            "PID": 5759,
            "Type": "SIP receiver udp:10.x.x.x:5060"
        }
    ]
}

opensips -V
version: opensips 3.2.8 (x86_64/linux)
flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, 
Q_MALLOC, F_MALLOC, HP_MALLOC, DBG_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: d2496fed5
main.c compiled on 16:17:53 Aug 24 2022 with gcc 9

This time server has some load but still it's not heavy at all plus 
I'm using async requests for REST queries.


This is my autoscaling section:

# Scaling section
auto_scaling_profile = PROFILE_UDP_PUB
     scale up to 16 on 70% for 4 cycles within 5
     scale down to 2 on 20% for 5 cycles

auto_scaling_profile = PROFILE_UDP_PRIV
     scale up to 16 on 70% for 4 cycles within 5
     scale down to 2 on 20% for 5 cycles

auto_scaling_profile = PROFILE_TCP
     scale up to 16 on 70% for 4 cycles within 5
     scale down to 2 on 20% for 10 cycles

And that's how I apply it to sockets, I'm not applying it to UDP 
workers at all:


socket=udp:10.x.x.x:5060 use_auto_scaling_

[OpenSIPS-Users] How to set auth_db module & db_mysql module work on opensips 3.3

2022-09-06 Thread SparkleZou
Hi All,


I'm just start to use OpenSips. Already checked the manual. Step by Step, here 
I need help. Thanks! ^_^


1. Already install Opensips 3.3 successfully refer to OpenSIPS 3.1/3.2 
Installation Instructions | VoIP School


2. apt install mariadb-server
opensips-cli -x database create opensips


root@opensips:/etc/opensips# mysql opensips -e "show tables" 
++ | Tables_in_opensips | ++ | acc | | 
address | | clusterer | | dbaliases | | dialog | | dialplan | | dispatcher | | 
domain | | dr_carriers | | dr_gateways | | dr_groups | | dr_partitions | | 
dr_rules | | grp | | load_balancer | | location | | missed_calls | | re_grp | | 
rtpengine | | rtpproxy_sockets | | silo | | speed_dial | | subscriber | | 
tls_mgm | | uri | | usr_preferences | | version | ++


MariaDB [opensips]> select * FROM subscriber; 
++--+--+--+---+--+--+--+--+
 | id | username | domain | password | email_address | ha1 | ha1_sha256 | 
ha1_sha512t256 | rpid | 
++--+--+--+---+--+--+--+--+
 | 1 | 1000 | 192.168.3.53 | | | 1c77bd7afa5414714be613363977341f | 
a821eb87519b53a8e505184a8798b9300dd1788c32ce59026c6f047d5f0eb717 | 
1947492ee9de11818d8a54cc5969bd87e5622f412e1b3e1a117ce8c44b936b5d | NULL | | 2 | 
1001 | 192.168.3.53 | | | c3d0ccc517e752190644392e7f0c5d93 | 
b4efb98003f1e5f75ad6ca5ce320a367a430415b9e304ef384e19b969e14ea44 | 
49a9a44fbb296fed9c7fe9b4e86ef113642d2e911fe34e93742cc249de261d5a | NULL | 
++--+--+--+---+--+--+--+--+
 2 rows in set (0.000 sec)


accounts 1000 & 1001 are already created in db.


run /usr/sbin/osipsconfig select ENABLE_TCP & USE_AUTH, generate the CFG file.
 | | | [*] ENABLE_TCP | | [ ] 
ENABLE_TLS | | [ ] USE_ALIASES | | [*] USE_AUTH | | [ ] USE_DBACC | | [ ] 
USE_DBUSRLOC | | [ ] USE_DIALOG | | [ ] USE_MULTIDOMAIN | | [ ] USE_NAT | | [ ] 
USE_PRESENCE | | [ ] USE_DIALPLAN | | [ ] VM_DIVERSION | | [ ] 
HAVE_INBOUND_PSTN | | [ ] HAVE_OUTBOUND_PSTN | | [ ] USE_DR_PSTN | | [ ] 
USE_HTTP_MANAGEMENT_INTERFACE | ||
Then start the opensips. But REGISTER get 401 fail message.



REGISTER sip:192.168.3.53 SIP/2.0

Via: SIP/2.0/UDP 
10.120.100.250:39720;branch=z9hG4bK-d87543-ec515058dd0d9227-1--d87543-;rport

Max-Forwards: 70

Contact: 

To: "1000"

From: "1000";tag=a16e1263

Call-ID: ZTY2NDZlYjc1ZTE3MGE4ZjI5YzhhZjA4M2IzYTIyZTc.

CSeq: 1 REGISTER

Expires: 3600

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, 
INFO

User-Agent: X-Lite release 1011s stamp 41150

Content-Length: 0




SIP/2.0 401 Unauthorized

Via: SIP/2.0/UDP 
10.120.100.250:39720;received=192.168.3.250;branch=z9hG4bK-d87543-ec515058dd0d9227-1--d87543-;rport=39720

To: "1000";tag=a42c.30207dd1fda47907656684ceecd519a5

From: "1000";tag=a16e1263

Call-ID: ZTY2NDZlYjc1ZTE3MGE4ZjI5YzhhZjA4M2IzYTIyZTc.

CSeq: 1 REGISTER

WWW-Authenticate: Digest realm="192.168.3.53", 
nonce="Tx723UFoxz9VG6/4szaVxWNyEKleCmoNQbbunbDRcdAA", qop="auth"

Server: OpenSIPS (3.3.1 (x86_64/linux))

Content-Length: 0




The opensips.cfg is attached. Please help check where is the problem. Thanks!




BR,

SparkleZou




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


Re: [OpenSIPS-Users] Autoscaler in 3.2.x

2022-09-06 Thread Yury Kirsanov
Hi Bogdan,
This has finally happened, OS is stuck again in 100% for one of its
processes. Here's the output of load: command:

opensips-cli -x mi get_statistics load:
{
"load:load-proc-1": 0,
"load:load1m-proc-1": 0,
"load:load10m-proc-1": 0,
"load:load-proc-2": 0,
"load:load1m-proc-2": 0,
"load:load10m-proc-2": 0,
"load:load-proc-3": 0,
"load:load1m-proc-3": 0,
"load:load10m-proc-3": 0,
"load:load-proc-4": 0,
"load:load1m-proc-4": 0,
"load:load10m-proc-4": 0,
"load:load-proc-5": 0,
"load:load1m-proc-5": 0,
"load:load10m-proc-5": 8,
"load:load-proc-6": 0,
"load:load1m-proc-6": 0,
"load:load10m-proc-6": 6,
"load:load-proc-13": 0,
"load:load1m-proc-13": 0,
"load:load10m-proc-13": 0,
"load:load-proc-14": 0,
"load:load1m-proc-14": 0,
"load:load10m-proc-14": 0,
"load:load-proc-21": 0,
"load:load1m-proc-21": 0,
"load:load10m-proc-21": 0,
"load:load-proc-22": 0,
"load:load1m-proc-22": 0,
"load:load10m-proc-22": 0,
"load:load-proc-23": 0,
"load:load1m-proc-23": 0,
"load:load10m-proc-23": 0,
"load:load-proc-24": 100,
"load:load1m-proc-24": 100,
"load:load10m-proc-24": 100,
"load:load": 12,
"load:load1m": 12,
"load:load10m": 14,
"load:load-all": 10,
"load:load1m-all": 10,
"load:load10m-all": 11,
"load:processes_number": 13
}

As you can see, process 24 is consuming 100% of time for more than a minute
already

Here's the output of process list, it's a UDP socket listener on internal
interface that's stuck at 100% load:

opensips-cli -x mi ps
{
"Processes": [
{
"ID": 0,
"PID": 5457,
"Type": "attendant"
},
{
"ID": 1,
"PID": 5463,
"Type": "HTTPD 10.x.x.x:"
},
{
"ID": 2,
"PID": 5464,
"Type": "MI FIFO"
},
{
"ID": 3,
"PID": 5465,
"Type": "time_keeper"
},
{
"ID": 4,
"PID": 5466,
"Type": "timer"
},
{
"ID": 5,
"PID": 5467,
"Type": "SIP receiver udp:10.x.x.x:5060"
},
{
"ID": 6,
"PID": 5470,
"Type": "SIP receiver udp:10.x.x.x:5060"
},
{
"ID": 13,
"PID": 5477,
"Type": "SIP receiver udp:103.x.x.x:7060"
},
{
"ID": 14,
"PID": 5478,
"Type": "SIP receiver udp:103.x.x.x:7060"
},
{
"ID": 21,
"PID": 5485,
"Type": "TCP receiver"
},
{
"ID": 22,
"PID": 5486,
"Type": "Timer handler"
},
{
"ID": 23,
"PID": 5487,
"Type": "TCP main"
},
{
"ID": 24,
"PID": 5759,
"Type": "SIP receiver udp:10.x.x.x:5060"
}
]
}

opensips -V
version: opensips 3.2.8 (x86_64/linux)
flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, Q_MALLOC,
F_MALLOC, HP_MALLOC, DBG_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: d2496fed5
main.c compiled on 16:17:53 Aug 24 2022 with gcc 9

This time server has some load but still it's not heavy at all plus I'm
using async requests for REST queries.

This is my autoscaling section:

# Scaling section
auto_scaling_profile = PROFILE_UDP_PUB
 scale up to 16 on 70% for 4 cycles within 5
 scale down to 2 on 20% for 5 cycles

auto_scaling_profile = PROFILE_UDP_PRIV
 scale up to 16 on 70% for 4 cycles within 5
 scale down to 2 on 20% for 5 cycles

auto_scaling_profile = PROFILE_TCP
 scale up to 16 on 70% for 4 cycles within 5
 scale down to 2 on 20% for 10 cycles

And that's how I apply it to sockets, I'm not applying it to UDP workers at
all:

socket=udp:10.x.x.x:5060 use_auto_scaling_profile PROFILE_UDP_PRIV
socket=udp:103.x.x.x:7060 use_auto_scaling_profile PROFILE_UDP_PUB

tcp_workers = 1 use_auto_scaling_profile PROFILE_TCP

I can't get this process unstuck until I restart OpenSIPS.

Just to add - if I turn off auto scaling and enable 16 UDP and 16 TCP
workers and just specify sockets without any parameters - load goes to 0,
see graph attached, load was at 25% all the time until I restarted OpenSIPS
in normal mode, then it's immediately 0:

[image: image.png]

Here's an output of load:

opensips-cli -x mi get_statistics load:
{
"load:load-proc-1": 0,
"load:load1m-proc-1": 0,
"load:load10m-proc-1": 0,
"load:load-proc-2": 0,
"load:load1m-proc-2": 0,
"load:load10m-proc-2": 0,
"load:load-proc-3": 0,
"load:load1m-proc-3": 0,
"load:load10m-proc-3": 0,
"load:load-proc-4": 

[OpenSIPS-Users] sip_trace with d option supplied not tracing OPTION messages

2022-09-06 Thread Babak Yakhchali
Hi
I'm using sip_trace to capture all traffic and logs to Homer, everything
works fine except for OPTIONS packets generated by the dialog module. How
can I capture those messages?
opensips version is 2.4 and I'm calling sip_trace like this:

if (is_method("INVITE")) {
sip_trace("$var(trace_id)", "d", "sip|xlog|rest", "$var(user)");
}

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


Re: [OpenSIPS-Users] How to set auth_db module & db_mysql module work on opensips 3.3

2022-09-06 Thread Bogdan-Andrei Iancu

Hi SparkleZou,

The issue here is how the password is stored in  DB. As per the sql 
dump, the pwd is in pre-computed HA1 format, while your opensips cfg 
expects the pwd in plain-text format, see the `calculate_ha1` and 
`password_column` modparams for auth_db module.


For more, see 
https://opensips.org/html/docs/modules/3.2.x/auth_db.html#param_calculate_ha1


Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Summit 27-30 Sept 2022, Athens
  https://www.opensips.org/events/Summit-2022Athens/

On 8/26/22 8:31 AM, SparkleZou wrote:

Hi All,

I'm just start to use OpenSips. Already checked the manual. Step by 
Step, here I need help. Thanks! ^_^


1. Already install Opensips 3.3 successfully refer to OpenSIPS 3.1/3.2 
Installation Instructions | VoIP School 



2. apt install mariadb-server
opensips-cli -x database create opensips
root@opensips:/etc/opensips# mysql opensips -e "show tables" 
++ | Tables_in_opensips | ++ | 
acc | | address | | clusterer | | dbaliases | | dialog | | dialplan | 
| dispatcher | | domain | | dr_carriers | | dr_gateways | | dr_groups 
| | dr_partitions | | dr_rules | | grp | | load_balancer | | location 
| | missed_calls | | re_grp | | rtpengine | | rtpproxy_sockets | | 
silo | | speed_dial | | subscriber | | tls_mgm | | uri | | 
usr_preferences | | version | ++
MariaDB [opensips]> select * FROM subscriber; 
++--+--+--+---+--+--+--+--+ 
| id | username | domain | password | email_address | ha1 | ha1_sha256 
| ha1_sha512t256 | rpid | 
++--+--+--+---+--+--+--+--+ 
| 1 | 1000 | 192.168.3.53 | | | 1c77bd7afa5414714be613363977341f | 
a821eb87519b53a8e505184a8798b9300dd1788c32ce59026c6f047d5f0eb717 | 
1947492ee9de11818d8a54cc5969bd87e5622f412e1b3e1a117ce8c44b936b5d | 
NULL | | 2 | 1001 | 192.168.3.53 | | | 
c3d0ccc517e752190644392e7f0c5d93 | 
b4efb98003f1e5f75ad6ca5ce320a367a430415b9e304ef384e19b969e14ea44 | 
49a9a44fbb296fed9c7fe9b4e86ef113642d2e911fe34e93742cc249de261d5a | 
NULL | 
++--+--+--+---+--+--+--+--+ 
2 rows in set (0.000 sec)

accounts 1000 & 1001 are already created in db.
run /usr/sbin/osipsconfig select ENABLE_TCP & USE_AUTH, generate the 
CFG file.
 | | | [*] ENABLE_TCP | | 
[ ] ENABLE_TLS | | [ ] USE_ALIASES | | [*] USE_AUTH | | [ ] USE_DBACC 
| | [ ] USE_DBUSRLOC | | [ ] USE_DIALOG | | [ ] USE_MULTIDOMAIN | | [ 
] USE_NAT | | [ ] USE_PRESENCE | | [ ] USE_DIALPLAN | | [ ] 
VM_DIVERSION | | [ ] HAVE_INBOUND_PSTN | | [ ] HAVE_OUTBOUND_PSTN | | 
[ ] USE_DR_PSTN | | [ ] USE_HTTP_MANAGEMENT_INTERFACE | 
||

Then start the opensips. But REGISTER get 401 fail message.

REGISTER sip:192.168.3.53 SIP/2.0

Via: SIP/2.0/UDP 
10.120.100.250:39720;branch=z9hG4bK-d87543-ec515058dd0d9227-1--d87543-;rport


Max-Forwards: 70

Contact: 

To: "1000"

From: "1000";tag=a16e1263

Call-ID: ZTY2NDZlYjc1ZTE3MGE4ZjI5YzhhZjA4M2IzYTIyZTc.

CSeq: 1 REGISTER

Expires: 3600

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, 
SUBSCRIBE, INFO


User-Agent: X-Lite release 1011s stamp 41150

Content-Length: 0


SIP/2.0 401 Unauthorized

Via: SIP/2.0/UDP 
10.120.100.250:39720;received=192.168.3.250;branch=z9hG4bK-d87543-ec515058dd0d9227-1--d87543-;rport=39720


To: 
"1000";tag=a42c.30207dd1fda47907656684ceecd519a5


From: "1000";tag=a16e1263

Call-ID: ZTY2NDZlYjc1ZTE3MGE4ZjI5YzhhZjA4M2IzYTIyZTc.

CSeq: 1 REGISTER

WWW-Authenticate: Digest realm="192.168.3.53", 
nonce="Tx723UFoxz9VG6/4szaVxWNyEKleCmoNQbbunbDRcdAA", qop="auth"


Server: OpenSIPS (3.3.1 (x86_64/linux))

Content-Length: 0


The opensips.cfg is attached. Please help check where is the problem. 
Thanks!



BR,

SparkleZou


___
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] sip_trace with d option supplied not tracing OPTION messages

2022-09-06 Thread Karsten Wemheuer
Hi,

Am Dienstag, dem 06.09.2022 um 12:35 +0430 schrieb Babak Yakhchali:
> Hi
> I'm using sip_trace to capture all traffic and logs to Homer,
> everything works fine except for OPTIONS packets generated by the
> dialog module. How can I capture those messages?
> opensips version is 2.4 and I'm calling sip_trace like this:
>
> if (is_method("INVITE")) {
> sip_trace("$var(trace_id)", "d", "sip|xlog|rest", "$var(user)");
> }
>
for OPTION packets You should call the trace function in the local
route section.

HTH,
Karsten


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


Re: [OpenSIPS-Users] Dispatcher within a K8s environment

2022-09-06 Thread David Villasmil
I believe you can also tweak k8s to make this scenario work. Use services
instead, I think is the best option. It’s been a while since I implemented
it.

On Tue, 6 Sep 2022 at 09:50, Bogdan-Andrei Iancu 
wrote:

> Hi Jon,
>
> just a feature request on github.
>
> Regards,
>
> Bogdan-Andrei Iancu
>
> OpenSIPS Founder and Developer
>   https://www.opensips-solutions.com
> OpenSIPS Summit 27-30 Sept 2022, Athens
>   https://www.opensips.org/events/Summit-2022Athens/
>
> On 9/1/22 9:01 PM, Jonathan Hunter wrote:
>
> Hi Bogdan,
>
>
>
> Ok cool shall whats the best way to do this?
>
>
>
> Is it just a change request in GitHub? Or request for feature?
>
>
>
> Also realistically when do you think something like this could be
> completed?
>
>
>
> Thanks!
>
>
>
> Jon
>
>
>
> Sent from Mail  for
> Windows
>
>
>
> *From: *Bogdan-Andrei Iancu 
> *Sent: *30 August 2022 08:52
> *To: *Jonathan Hunter ; OpenSIPS users mailling
> list 
> *Subject: *Re: [OpenSIPS-Users] Dispatcher within a K8s environment
>
>
>
> Hi Jonathan,
>
> You mean something similar to that option in drouting ? If so, yes, it
> would make sense IMO.
>
> Regards,
>
> Bogdan-Andrei Iancu
>
>
>
> OpenSIPS Founder and Developer
>
>   https://www.opensips-solutions.com 
> 
>
> OpenSIPS Summit 27-30 Sept 2022, Athens
>
>   https://www.opensips.org/events/Summit-2022Athens/ 
> 
>
> On 8/26/22 5:36 PM, Jonathan Hunter wrote:
>
> Hi Ben,
>
>
>
> Great thank you for that I may well switch for now to drouting.
>
>
>
> @Bogdan-Andrei Iancu  is it worth me raising
> anything against dispatcher in terms of a change request for dns behaviour?
>
>
>
> Many thanks both.
>
>
>
> Jon
>
>
>
> Sent from Mail
> 
> for Windows
>
>
>
> *From: *Ben Newlin 
> *Sent: *25 August 2022 18:57
> *To: *OpenSIPS users mailling list ; Bogdan-Andrei
> Iancu 
> *Subject: *Re: [OpenSIPS-Users] Dispatcher within a K8s environment
>
>
>
> The drouting module has a parameter that allows you to disable the DNS
> lookup.
>
>
>
> https://opensips.org/docs/modules/3.2.x/drouting.html#param_force_dns
> 
>
>
>
> Ben Newlin
>
>
>
> *From: *Users 
>  on behalf of Jonathan Hunter
>  
> *Date: *Thursday, August 25, 2022 at 4:54 AM
> *To: *Bogdan-Andrei Iancu  ,
> OpenSIPS users mailling list 
> 
> *Subject: *Re: [OpenSIPS-Users] Dispatcher within a K8s environment
>
> * EXTERNAL EMAIL - Please use caution with links and attachments *
>
>
>
> Hi Bogdan,
>
>
>
> Yes it would appear K8s implementations would be a very good topic at the
> Summit that is for sure!
>
>
>
> I understand your comments on dispatcher, its unfortunate as everything
> else is working fine.
>
>
>
> There was a suggestion to add a loopback address for example and then
> update  when DNS has updated and records resolve?
>
>
>
> Is there any benefit in using dr_routing instead or will this behaviour be
> the same in the event of a dns lookup failure?
>
>
>
> Thanks for the response!
>
>
>
> Jon
>
>
>
>
>
> Sent from Mail
> 

Re: [OpenSIPS-Users] Cannot get registration to work with v3.2.8??

2022-09-06 Thread Bogdan-Andrei Iancu

Hi Bob,

The key log is this one:
Aug 30 18:19:05 [17809] DBG:auth:pre_auth: credentials with given realm 
not found


Basically OpenSIPS says it does not find the "digilink.net" realm in the 
provided auth header in REGISTER. As a quick experiment, could you use 
the empty string "" for realm (instead of "digilink.net") in the 
www_authorize/challenge() functions ?


Best regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Summit 27-30 Sept 2022, Athens
  https://www.opensips.org/events/Summit-2022Athens/

On 8/31/22 4:31 AM, Bob Atkins wrote:

Hi.

Have been a long time OpenSER user in a production environment.
I managed to convert to OpenSIPS v3.2.8 on a CentOS 7 system and is 
working based on IP authentication however, I just cannot get sip 
registrations to work that used to work fine with OpenSER. I'm using a 
SPA112 running 1.4.1(SR5) as a test device. This device registers just 
fine with Asterisk and OpenSER v1.1 with exactly the same credentials 
but no matter what I have tried it just won't register with OpenSIPS 
v3.2.8.


I am using auth_db and mysql. I have verified that all sql data is 
correct.


I have been banging my head against the screen for hours to no avail.

In reviewing the debug and log output I can clearly see that something 
is wrong because the user name and domain are both ?


www_authorize returns [-4] which means (no credentials) - credentials 
were not found in request.


There is no reason why the credentials should not be there - they have 
certainly not been consumed before this point.


This same device registers just fine with /_*exactly *_/the same 
credentials to both OpenSER v1.1 and asterisk servers.


Would be grateful if anyone can shed some light on this because it 
seems to me that something inside auth or auth_db is broken and not 
extracting the registration credentials from the REGISTER message.


This code worked just fine in OpenSER v1.1

if (method=="REGISTER") {
   #xlog("L_INFO","[$rm][$ft][$tt] Processing registration");
   if (!www_authorize("digilink.net", "subscriber")) {
   #xlog("L_INFO","[$rm][$ft][$tt] Challenging peer");
    www_challenge("digilink.net", "0");
    exit;
};

xlog("L_INFO","[$rm][$ft][$tt] Registered $fu from $si");
save("location");
exit;
};

This is the code in the OpenSIPS 3.2.8 config that is failing:

Here are the module loads and various defines:

loadmodule "options.so"
loadmodule "textops.so"
 SIGNALING module
loadmodule "signaling.so"

 StateLess module
loadmodule "sl.so"

 Transaction Module
loadmodule "tm.so"
modparam("tm", "enable_stats", 1)
modparam("tm", "fr_timeout", 9)
modparam("tm", "fr_inv_timeout", 120)
modparam("tm", "restart_fr_on_each_reply", 0)
modparam("tm", "onreply_avp_mode", 1)

 Record Route Module
loadmodule "rr.so"
/* do not append from tag to the RR */
modparam("rr", "append_fromtag", 1)

loadmodule "uac.so"
#modparam("uac","restore_mode","auto")
modparam("uac","rr_from_store_param","dns_uac_param")
modparam("uac","restore_mode","none")

 MAX ForWarD module
loadmodule "maxfwd.so"

 SIP MSG OPerationS module
loadmodule "sipmsgops.so"

 FIFO Management Interface
loadmodule "mi_fifo.so"
modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")
modparam("mi_fifo", "fifo_mode", 0666)

 USeR LOCation module
loadmodule "usrloc.so"
modparam("usrloc", "nat_bflag", "NAT")
modparam("usrloc", "working_mode_preset", 
"single-instance-sql-write-back")

modparam("usrloc", "db_url", "mysql://opensips:??@localhost/opensips")

loadmodule "nathelper.so"
modparam("nathelper", "received_avp", "$avp(rcv)")
modparam("nathelper", "natping_interval", 30) # Ping interval 30 s
modparam("nathelper", "ping_nated_only", 1)    # Ping only clients 
behind NAT


 MYSQL module
loadmodule "db_mysql.so"

loadmodule "avpops.so"

 AUTH Db module
loadmodule "auth.so"
loadmodule "auth_db.so"
modparam("auth_db", "calculate_ha1", 1)
modparam("auth_db", "user_column", "username")
modparam("auth_db", "password_column", "password")
modparam("auth_db", "use_domain", 0)
modparam("auth_db", "db_url", 
"mysql://opensips:??@localhost/opensips")

modparam("auth_db", "load_credentials", "")

 REGISTRAR module
loadmodule "registrar.so"
modparam("registrar", "tcp_persistent_flag", "TCP_PERSISTENT")
modparam("registrar", "min_expires", 120)
modparam("registrar", "max_expires", 3600)
modparam("registrar", "default_expires", 3600)
modparam("registrar", "max_contacts", 5)
modparam("registrar", "received_avp", "$avp(rcv)")

 Pike DOS protection
loadmodule "pike.so"
modparam("pike", "sampling_time_unit", 3)
modparam("pike", "reqs_density_per_unit", 20)

 DIALOG module
loadmodule "dialog.so"
modparam("dialog", "dlg_match_mode", 1)
modparam("dialog", "default_timeout", 21600)  # 6 hours timeout
modparam("dialog", "db_mode", 0)
modparam("dialog", "profiles_with_value", "trunkCalls")

 ACCounting module
loadmodule "acc.so"
/* what special events

Re: [OpenSIPS-Users] OpenSIPS 3.2.7 tracer module for sip dialogs leads to an endless loop

2022-09-06 Thread Bogdan-Andrei Iancu

Hi Pavel,

The tracing part has nothing to do with the routing on the SIP side. And 
usually you end up with SIP loops if, without changing the RURI, you 
send the SIP request out, making OpenSIPS to send the request back to 
itself (as the destination in RURI still points to OpenSIPS).


I advice you to try to understand the execution flow via your script by 
using the script_trace[1] function and logging the RURI (as $ru)


[1] 
https://www.opensips.org/Documentation/Script-CoreFunctions-3-2#script_trace


Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Summit 27-30 Sept 2022, Athens
  https://www.opensips.org/events/Summit-2022Athens/

On 8/30/22 9:31 PM, Pavel Ekshin wrote:

Hi there,
I try very basic scenario with tracing sip dialogs in OpenSIPS 3.2.7, 
and this scenario leads in an endless loop inside Opensips for SIP 
messages.
Maybe someone is similarly affected or can point to the error on the 
route scenario? I use out of box residential configuration. I read the 
tracer module doc (https://opensips.org/docs/modules/devel/tracer.html 
), but dialog 
examples from doc also lead to loops.
I also tried with transactions, but they are looped too. Trace for 
messages works fine.  I think I miss some points.


MariaDB [opensips]> select method,COUNT(*) from sip_trace group by method;
++--+
| method | COUNT(*) |
++--+
| ACK    |     2625 |
| BYE    |     2270 |
| INVITE |      219 |
++--+

Below my config:

[...]

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


Re: [OpenSIPS-Users] sip_trace with d option supplied not tracing OPTION messages

2022-09-06 Thread Bogdan-Andrei Iancu

:+1:

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Summit 27-30 Sept 2022, Athens
  https://www.opensips.org/events/Summit-2022Athens/

On 9/6/22 11:33 AM, Karsten Wemheuer wrote:

Hi,

Am Dienstag, dem 06.09.2022 um 12:35 +0430 schrieb Babak Yakhchali:

Hi
I'm using sip_trace to capture all traffic and logs to Homer,
everything works fine except for OPTIONS packets generated by the
dialog module. How can I capture those messages?
opensips version is 2.4 and I'm calling sip_trace like this:

if (is_method("INVITE")) {
sip_trace("$var(trace_id)", "d", "sip|xlog|rest", "$var(user)");
}


for OPTION packets You should call the trace function in the local
route section.

HTH,
Karsten


___
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] dynamic routing failover ONLY ONCE on the provider and continue

2022-09-06 Thread David Villasmil
Hello folks,

I'm trying to route to the first provider and if the first gw attempted
fails, try the next gw on that provider, and if that fails THEN failover to
the next provider. NOTE ALL PROVIDERS CAN HAVE MULTIPLE gws.

Is this possible on 2.4.7?


I really appreciate your help!


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] dynamic routing failover ONLY ONCE on the provider and continue

2022-09-06 Thread Bogdan-Andrei Iancu

David,

Define the "provide" as carrier and set the "use only first gw from cr" 
flag for it, see 
https://www.opensips.org/Documentation/Install-DBSchema-3-2#GEN-DB-DR-CARRIERS


PS: no need for caps ;)

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Summit 27-30 Sept 2022, Athens
  https://www.opensips.org/events/Summit-2022Athens/

On 9/6/22 4:57 PM, David Villasmil wrote:

Hello folks,

I'm trying to route to the first provider and if the first gw 
attempted fails, try the next gw on that provider, and if that fails 
THEN failover to the next provider. NOTE ALL PROVIDERS CAN HAVE 
MULTIPLE gws.


Is this possible on 2.4.7?


I really appreciate your help!


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


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


Re: [OpenSIPS-Users] dynamic routing failover ONLY ONCE on the provider and continue

2022-09-06 Thread Ben Newlin
If I’m not mistaken, the functionality David is describing is the default 
behavior of the module and the use_next_gw function. All carriers are loaded on 
the call to do_routing, and use_next_gw will go through each gateway of each 
carrier in order, unless the flag Bogdan referenced below is set.

Ben Newlin

From: Users  on behalf of Bogdan-Andrei Iancu 

Date: Tuesday, September 6, 2022 at 10:06 AM
To: OpenSIPS users mailling list , David Villasmil 

Subject: Re: [OpenSIPS-Users] dynamic routing failover ONLY ONCE on the 
provider and continue
 EXTERNAL EMAIL - Please use caution with links and attachments


David,

Define the "provide" as carrier and set the "use only first gw from cr" flag 
for it, see 
https://www.opensips.org/Documentation/Install-DBSchema-3-2#GEN-DB-DR-CARRIERS

PS: no need for caps ;)

Regards,


Bogdan-Andrei Iancu



OpenSIPS Founder and Developer

  https://www.opensips-solutions.com

OpenSIPS Summit 27-30 Sept 2022, Athens

  
https://www.opensips.org/events/Summit-2022Athens/
On 9/6/22 4:57 PM, David Villasmil wrote:
Hello folks,

I'm trying to route to the first provider and if the first gw attempted fails, 
try the next gw on that provider, and if that fails THEN failover to the next 
provider. NOTE ALL PROVIDERS CAN HAVE MULTIPLE gws.

Is this possible on 2.4.7?


I really appreciate your help!


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

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


Re: [OpenSIPS-Users] dynamic routing failover ONLY ONCE on the provider and continue

2022-09-06 Thread David Villasmil
Is there anything like “use_next_carrier”? I.e.: decide when I want to stop
trying gws for the current carrier.

On Tue, 6 Sep 2022 at 18:04, David Villasmil 
wrote:

> I may not have been clear, I want to try the first _two_ (2) gws for each
> carrier.
>
> Is this possible?
>
> On Tue, 6 Sep 2022 at 17:14, David Villasmil <
> david.villasmil.w...@gmail.com> wrote:
>
>> Hey Bodgan,
>>
>> Sorry for the caps, was just trying to illustrate a very important point.
>>
>> That was a typo: it's provider.
>>
>> So what i mean is:
>>
>> - Provier1
>>   - gw1
>>   - gw2
>> - Provider2
>>   - gw1
>>   - gw2
>>
>> and so on.
>>
>> The providers could have more than 2 gws, but i only want it to attempt
>> the first 2.
>>
>> Is this possible?
>>
>> Regards,
>>
>> David Villasmil
>> email: david.villasmil.w...@gmail.com
>> phone: +34669448337
>>
>>
>> On Tue, Sep 6, 2022 at 4:05 PM Bogdan-Andrei Iancu 
>> wrote:
>>
>>> David,
>>>
>>> Define the "provide" as carrier and set the "use only first gw from cr"
>>> flag for it, see
>>> https://www.opensips.org/Documentation/Install-DBSchema-3-2#GEN-DB-DR-CARRIERS
>>>
>>> PS: no need for caps ;)
>>>
>>> Regards,
>>>
>>> Bogdan-Andrei Iancu
>>>
>>> OpenSIPS Founder and Developer
>>>   https://www.opensips-solutions.com
>>> OpenSIPS Summit 27-30 Sept 2022, Athens
>>>   https://www.opensips.org/events/Summit-2022Athens/
>>>
>>> On 9/6/22 4:57 PM, David Villasmil wrote:
>>>
>>> Hello folks,
>>>
>>> I'm trying to route to the first provider and if the first gw attempted
>>> fails, try the next gw on that provider, and if that fails THEN failover to
>>> the next provider. NOTE ALL PROVIDERS CAN HAVE MULTIPLE gws.
>>>
>>> Is this possible on 2.4.7?
>>>
>>>
>>> I really appreciate your help!
>>>
>>>
>>> David Villasmil
>>> email: david.villasmil.w...@gmail.com
>>> phone: +34669448337
>>>
>>> ___
>>> Users mailing 
>>> listUsers@lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>>>
>>> --
> Regards,
>
> David Villasmil
> email: david.villasmil.w...@gmail.com
> phone: +34669448337
>
-- 
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] dynamic routing failover ONLY ONCE on the provider and continue

2022-09-06 Thread David Villasmil
Hey Bodgan,

Sorry for the caps, was just trying to illustrate a very important point.

That was a typo: it's provider.

So what i mean is:

- Provier1
  - gw1
  - gw2
- Provider2
  - gw1
  - gw2

and so on.

The providers could have more than 2 gws, but i only want it to attempt the
first 2.

Is this possible?

Regards,

On Tue, 6 Sep 2022 at 16:41, Ben Newlin  wrote:

> If I’m not mistaken, the functionality David is describing is the default
> behavior of the module and the use_next_gw function. All carriers are
> loaded on the call to do_routing, and use_next_gw will go through each
> gateway of each carrier in order, unless the flag Bogdan referenced below
> is set.
>
>
>
> Ben Newlin
>
>
>
> *From: *Users  on behalf of
> Bogdan-Andrei Iancu 
> *Date: *Tuesday, September 6, 2022 at 10:06 AM
> *To: *OpenSIPS users mailling list , David
> Villasmil 
> *Subject: *Re: [OpenSIPS-Users] dynamic routing failover ONLY ONCE on the
> provider and continue
>
> * EXTERNAL EMAIL - Please use caution with links and attachments *
>
>
> --
>
> David,
>
> Define the "provide" as carrier and set the "use only first gw from cr"
> flag for it, see
> https://www.opensips.org/Documentation/Install-DBSchema-3-2#GEN-DB-DR-CARRIERS
>
> PS: no need for caps ;)
>
> Regards,
>
> Bogdan-Andrei Iancu
>
>
>
> OpenSIPS Founder and Developer
>
>   https://www.opensips-solutions.com
>
> OpenSIPS Summit 27-30 Sept 2022, Athens
>
>   https://www.opensips.org/events/Summit-2022Athens/
>
> On 9/6/22 4:57 PM, David Villasmil wrote:
>
> Hello folks,
>
>
>
> I'm trying to route to the first provider and if the first gw attempted
> fails, try the next gw on that provider, and if that fails THEN failover to
> the next provider. NOTE ALL PROVIDERS CAN HAVE MULTIPLE gws.
>
>
>
> Is this possible on 2.4.7?
>
>
>
>
>
> I really appreciate your help!
>
>
>
>
>
> 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
>
>
>
-- 
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] dynamic routing failover ONLY ONCE on the provider and continue

2022-09-06 Thread Ben Newlin
Ah, I see now in my response I did misunderstand the problem.

There is no use_next_carrier function, however the AVP that contains the 
carrier list is accessible to you [1]. Our implementation has a similar 
requirement that we should skip to the next carrier rather than next gateway on 
certain response codes.

What we do is after calling do_routing, we copy the carrier_id_avp contents 
into our own AVP and then we call route_to_carrier on each carrier in that 
list. So then use_next_gw will only failover on the gateways on a specific 
carrier. When there are no more gateways, or whenever we decide based on our 
needs, then we can skip to the next carrier by calling route_to_carrier with 
the next carrier in our list.

A use_next_carrier function does seem like a very useful feature enhancement 
though.

Ben Newlin

From: Users  on behalf of David Villasmil 

Date: Tuesday, September 6, 2022 at 12:09 PM
To: users@lists.opensips.org 
Subject: Re: [OpenSIPS-Users] dynamic routing failover ONLY ONCE on the 
provider and continue
 EXTERNAL EMAIL - Please use caution with links and attachments


Is there anything like “use_next_carrier”? I.e.: decide when I want to stop 
trying gws for the current carrier.

On Tue, 6 Sep 2022 at 18:04, David Villasmil 
mailto:david.villasmil.w...@gmail.com>> wrote:
I may not have been clear, I want to try the first _two_ (2) gws for each 
carrier.

Is this possible?

On Tue, 6 Sep 2022 at 17:14, David Villasmil 
mailto:david.villasmil.w...@gmail.com>> wrote:
Hey Bodgan,

Sorry for the caps, was just trying to illustrate a very important point.

That was a typo: it's provider.

So what i mean is:

- Provier1
  - gw1
  - gw2
- Provider2
  - gw1
  - gw2

and so on.

The providers could have more than 2 gws, but i only want it to attempt the 
first 2.

Is this possible?

Regards,

David Villasmil
email: david.villasmil.w...@gmail.com
phone: +34669448337


On Tue, Sep 6, 2022 at 4:05 PM Bogdan-Andrei Iancu 
mailto:bog...@opensips.org>> wrote:
David,

Define the "provide" as carrier and set the "use only first gw from cr" flag 
for it, see 
https://www.opensips.org/Documentation/Install-DBSchema-3-2#GEN-DB-DR-CARRIERS

PS: no need for caps ;)

Regards,


Bogdan-Andrei Iancu



OpenSIPS Founder and Developer

  https://www.opensips-solutions.com

OpenSIPS Summit 27-30 Sept 2022, Athens

  
https://www.opensips.org/events/Summit-2022Athens/
On 9/6/22 4:57 PM, David Villasmil wrote:
Hello folks,

I'm trying to route to the first provider and if the first gw attempted fails, 
try the next gw on that provider, and if that fails THEN failover to the next 
provider. NOTE ALL PROVIDERS CAN HAVE MULTIPLE gws.

Is this possible on 2.4.7?


I really appreciate your help!


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

--
Regards,

David Villasmil
email: david.villasmil.w...@gmail.com
phone: +34669448337
--
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] dynamic routing failover ONLY ONCE on the provider and continue

2022-09-06 Thread Ben Newlin
Sorry, forgot the link for my reference.

[1] - https://opensips.org/docs/modules/2.4.x/drouting.html#param_carrier_id_avp

Ben Newlin

From: Users  on behalf of Ben Newlin 

Date: Tuesday, September 6, 2022 at 12:24 PM
To: OpenSIPS users mailling list 
Subject: Re: [OpenSIPS-Users] dynamic routing failover ONLY ONCE on the 
provider and continue
 EXTERNAL EMAIL - Please use caution with links and attachments


Ah, I see now in my response I did misunderstand the problem.

There is no use_next_carrier function, however the AVP that contains the 
carrier list is accessible to you [1]. Our implementation has a similar 
requirement that we should skip to the next carrier rather than next gateway on 
certain response codes.

What we do is after calling do_routing, we copy the carrier_id_avp contents 
into our own AVP and then we call route_to_carrier on each carrier in that 
list. So then use_next_gw will only failover on the gateways on a specific 
carrier. When there are no more gateways, or whenever we decide based on our 
needs, then we can skip to the next carrier by calling route_to_carrier with 
the next carrier in our list.

A use_next_carrier function does seem like a very useful feature enhancement 
though.

Ben Newlin

From: Users  on behalf of David Villasmil 

Date: Tuesday, September 6, 2022 at 12:09 PM
To: users@lists.opensips.org 
Subject: Re: [OpenSIPS-Users] dynamic routing failover ONLY ONCE on the 
provider and continue
 EXTERNAL EMAIL - Please use caution with links and attachments


Is there anything like “use_next_carrier”? I.e.: decide when I want to stop 
trying gws for the current carrier.

On Tue, 6 Sep 2022 at 18:04, David Villasmil 
mailto:david.villasmil.w...@gmail.com>> wrote:
I may not have been clear, I want to try the first _two_ (2) gws for each 
carrier.

Is this possible?

On Tue, 6 Sep 2022 at 17:14, David Villasmil 
mailto:david.villasmil.w...@gmail.com>> wrote:
Hey Bodgan,

Sorry for the caps, was just trying to illustrate a very important point.

That was a typo: it's provider.

So what i mean is:

- Provier1
  - gw1
  - gw2
- Provider2
  - gw1
  - gw2

and so on.

The providers could have more than 2 gws, but i only want it to attempt the 
first 2.

Is this possible?

Regards,

David Villasmil
email: david.villasmil.w...@gmail.com
phone: +34669448337


On Tue, Sep 6, 2022 at 4:05 PM Bogdan-Andrei Iancu 
mailto:bog...@opensips.org>> wrote:
David,

Define the "provide" as carrier and set the "use only first gw from cr" flag 
for it, see 
https://www.opensips.org/Documentation/Install-DBSchema-3-2#GEN-DB-DR-CARRIERS

PS: no need for caps ;)

Regards,



Bogdan-Andrei Iancu



OpenSIPS Founder and Developer

  https://www.opensips-solutions.com

OpenSIPS Summit 27-30 Sept 2022, Athens

  
https://www.opensips.org/events/Summit-2022Athens/
On 9/6/22 4:57 PM, David Villasmil wrote:
Hello folks,

I'm trying to route to the first provider and if the first gw attempted fails, 
try the next gw on that provider, and if that fails THEN failover to the next 
provider. NOTE ALL PROVIDERS CAN HAVE MULTIPLE gws.

Is this possible on 2.4.7?


I really appreciate your help!


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

--
Regards,

David Villasmil
email: david.villasmil.w...@gmail.com
phone: +34669448337
--
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] Cannot get registration to work with v3.2.8??

2022-09-06 Thread Bogdan-Andrei Iancu

Hi Bob,

Well, the logs cover only the challenge part, the handling of the 
REGISTER without any credentials - this is the first normal step in the 
digest auth process.


As per log, no Auth hdrs are found in the incoming REGISTER and a 
challenge reply is built and sent back (see the last log line below):


Sep  6 11:34:42 [4299] DBG:core:pv_get_authattr: no 
[Proxy-]Authorization header
Sep  6 11:34:42 [4299] [e5f4a8407663e4f7a3970][]@[] - 
Processing registrationSep  6 11:34:42 [4299] DBG:core:parse_headers: 
flags=4000
Sep  6 11:34:42 [4299] DBG:auth:pre_auth: credentials with given realm 
not found
Sep  6 11:34:42 [4299] DBG:auth:reserve_nonce_index: second= 19, 
sec_monit= 22,  index= 36

Sep  6 11:34:42 [4299] DBG:auth:challenge: nonce index= 36
Sep  6 11:34:42 [4299] DBG:auth:build_auth_hf: 'WWW-Authenticate: Digest 
realm="23.253.166.155", 
nonce="945VEH4DrBNkbwzJOMTyiEbNih+ChrtOdEF1sn9J0QAA", qop="auth", 
algorithm=MD5


But normally it should be a second incoming REGISTER (as response to the 
challenge) with credentials this time. Do you have the logs from both 
REGISTER requests and eventually the SIP capture for them?


Best regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Summit 27-30 Sept 2022, Athens
  https://www.opensips.org/events/Summit-2022Athens/

On 9/6/22 9:47 PM, Bob Atkins wrote:

Hi Iancu,

Thank you very much for your reply. Please ignore my previous message 
- it got sent prematurely.


Like you, I am mystified by the fact that it says that it cannot find 
the domain realm when it is actually in the table.


Keep in mind that I changed the code to specifically see the return 
result from www_authorize in my earlier tests and found that 
www_authorize returns [-4] which means (no credentials) - credentials 
were not found in request. WHy is it returning a -4?? Why is that -4 
being passing the if (!www_authorize("", "subscriber")) { statement in 
the first place. It should not fall through to the challenge with a -4 
return.


There is also no reason why the credentials should not be there - they 
have certainly not been consumed before this point.


Here is the subscriber table entry for reference:

id;username;domain;password;cr_preferred_carrier;first_name;last_name;phone;email_address;datetime_created;datetime_modified;confirmation;flag;sendnotification;greeting;allow_find;timezone;customerID;customerName;ha1;ha1_sha256;ha1_sha512t256;rpid
1;3105738133;sip.rs.digidial.net;xxx;\N;PPC 
Home;Fax;3105738133;b...@planeparts.com;2012-07-05 16:36:13;2021-11-07 
13:58:34;;0;72;DigiLink Internet Services\N


I would like to point out that the /_*exact same configuration*_/ 
works properly in OpenSER v1.1 with exactly the same database table 
and entry


I tried your suggestion (see code snipet below) and still no joy... 
All that was accomplished was the realm got set to the ip server's SRV 
name 'sip.rs.digidial.net' (see debug output below).


        if (!www_authorize("", "subscriber")) {
            #xlog("L_INFO","CHALLENGE: [$ft][$tt]");
            www_challenge("", "auth,auth-int", 
"MD5,MD5-sess,SHA-256,SHA-256-sess");

            exit;
        } else {
            #xlog("L_ALERT", "REGISTER: URI [$tu] - FAILED");
            xlog("L_ALERT", "REGISTER: URI [$tu][$rU]$ru 
credential from [$si] - FAILED!");

            sl_send_reply(403, "Not Authorized!");
            exit;
        }

I left the subscriber table entry as above and the test failed. I 
changed the domain of the subscriber to sip.rs.digidial.net and it 
still failed with exactly the same message - see below.


Debug output:

Sep  6 11:34:42 [4299] DBG:core:parse_msg: SIP Request:
Sep  6 11:34:42 [4299] DBG:core:parse_msg:  method: 
Sep  6 11:34:42 [4299] DBG:core:parse_msg:  uri: 
Sep  6 11:34:42 [4299] DBG:core:parse_msg:  version: 
Sep  6 11:34:42 [4299] DBG:core:parse_headers: flags=
Sep  6 11:34:42 [4299] DBG:core:_parse_to: end of header reached, state=10
Sep  6 11:34:42 [4299] DBG:core:_parse_to: display={}, 
ruri={sip:3970@23.253.166.155}
Sep  6 11:34:42 [4299] DBG:core:get_hdr_field:  [27]; 
uri=[sip:3970@23.253.166.155]
Sep  6 11:34:42 [4299] DBG:core:get_hdr_field: to body 
[

]
Sep  6 11:34:42 [4299] DBG:core:parse_via_param: found param type 232, 
 = ; state=6
Sep  6 11:34:42 [4299] DBG:core:parse_via_param: found param type 235, 
 = ; state=17

Sep  6 11:34:42 [4299] DBG:core:parse_via: end of header reached, state=5
Sep  6 11:34:42 [4299] DBG:core:parse_headers: via found, 
flags=

Sep  6 11:34:42 [4299] DBG:core:parse_headers: this is the first via
Sep  6 11:34:42 [4299] DBG:core:get_hdr_field: cseq : <1> 
Sep  6 11:34:42 [4299] DBG:core:get_hdr_field: content_length=0
Sep  6 11:34:42 [4299] DBG:core:get_hdr_field: found end of header
Sep  6 11:34:42 [4299] DBG:core:receive_msg: After parse_msg...
Sep  6 11:34:42 [4299] DBG:core:receive_msg: preparing 

Re: [OpenSIPS-Users] dynamic routing failover ONLY ONCE on the provider and continue

2022-09-06 Thread Bogdan-Andrei Iancu

Hi Ben, David,

Yes, by default the module can use either the first-only GW, either all 
the GWs from a carrier definition. But it cannot do the first 2. Still, 
as Ben said, you can implement your logic at script level - loop on 
"use_next_gw" until the carrier ID changes, so you can skip the GWs 
after the first two.


Best regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Summit 27-30 Sept 2022, Athens
  https://www.opensips.org/events/Summit-2022Athens/

On 9/6/22 7:35 PM, Ben Newlin wrote:


Sorry, forgot the link for my reference.

[1] - 
https://opensips.org/docs/modules/2.4.x/drouting.html#param_carrier_id_avp 



Ben Newlin

*From: *Users  on behalf of Ben 
Newlin 

*Date: *Tuesday, September 6, 2022 at 12:24 PM
*To: *OpenSIPS users mailling list 
*Subject: *Re: [OpenSIPS-Users] dynamic routing failover ONLY ONCE on 
the provider and continue


* EXTERNAL EMAIL - Please use caution with links and attachments *



Ah, I see now in my response I did misunderstand the problem.

There is no use_next_carrier function, however the AVP that contains 
the carrier list is accessible to you [1]. Our implementation has a 
similar requirement that we should skip to the next carrier rather 
than next gateway on certain response codes.


What we do is after calling do_routing, we copy the carrier_id_avp 
contents into our own AVP and then we call route_to_carrier on each 
carrier in that list. So then use_next_gw will only failover on the 
gateways on a specific carrier. When there are no more gateways, or 
whenever we decide based on our needs, then we can skip to the next 
carrier by calling route_to_carrier with the next carrier in our list.


A use_next_carrier function does seem like a very useful feature 
enhancement though.


Ben Newlin

*From: *Users  on behalf of David 
Villasmil 

*Date: *Tuesday, September 6, 2022 at 12:09 PM
*To: *users@lists.opensips.org 
*Subject: *Re: [OpenSIPS-Users] dynamic routing failover ONLY ONCE on 
the provider and continue


* EXTERNAL EMAIL - Please use caution with links and attachments *



Is there anything like “use_next_carrier”? I.e.: decide when I want to 
stop trying gws for the current carrier.


On Tue, 6 Sep 2022 at 18:04, David Villasmil 
> wrote:


I may not have been clear, I want to try the first _two_ (2) gws
for each carrier.

Is this possible?

On Tue, 6 Sep 2022 at 17:14, David Villasmil
mailto:david.villasmil.w...@gmail.com>> wrote:

Hey Bodgan,

Sorry for the caps, was just trying to illustrate a very
important point.

That was a typo: it's provider.

So what i mean is:

- Provier1

  - gw1

  - gw2

- Provider2

  - gw1

  - gw2

and so on.

The providers could have more than 2 gws, but i only want it
to attempt the first 2.

Is this possible?


Regards,

David Villasmil

email: david.villasmil.w...@gmail.com


phone: +34669448337

On Tue, Sep 6, 2022 at 4:05 PM Bogdan-Andrei Iancu
mailto:bog...@opensips.org>> wrote:

David,

Define the "provide" as carrier and set the "use only
first gw from cr" flag for it, see

https://www.opensips.org/Documentation/Install-DBSchema-3-2#GEN-DB-DR-CARRIERS



PS: no need for caps ;)

Regards,


Bogdan-Andrei Iancu

  


OpenSIPS Founder and Developer

   https://www.opensips-solutions.com  


OpenSIPS Summit 27-30 Sept 2022, Athens

   https://www.opensips.org/events/Summit-2022Athens/  


On 9/6/22 4:57 PM, David Villasmil wrote:

Hello folks,

I'm trying to route to the first provider and if the
first gw attempted fails, try the next gw on that
provider, and if that fails THEN failover to the next
provider. NOTE ALL PROVIDERS CAN HAVE MULTIPLE gws.

Is this possible on 2.4.7?

I really appreciate your help!

David Villasmil

email: david.villasmil.w...@gmail.com


phone: +34669448337




___

Users mailing list

Users@lists.opensips.org  

Re: [OpenSIPS-Users] How to set auth_db module & db_mysql module work on opensips 3.3

2022-09-06 Thread Bogdan-Andrei Iancu

Hi Sparkle Zou,

If you created the users with the "sip-server.com" domain, then you must 
be sure your opensips is recognizing that domain by adding it into the 
"domain" table. So add the FQDN, not the IP.


And about the error, note you have a typo there in the name of the table 
:) - it is "domain", not "domian" :)


BTW, maybe you should try to use OpenSIPS Control Panel for doing the DB 
provisioning  http://controlpanel.opensips.org/


Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Summit 27-30 Sept 2022, Athens
  https://www.opensips.org/events/Summit-2022Athens/

On 9/7/22 6:31 AM, SparkleZou wrote:



Hi Bogdan-Andrei,
Really thanks! It works now.

Here I'm trying to go further steps.

Try to set the domain name.

only add "opensips-cli -x user add 1...@sip-server.com S3cureP4s$"

sip-server.com already set to 192.168.3.53 at dns side.
Change at X-lite to use 1...@sip-server.com 
 failed to log in.
Then try to use the USE_MULTIDOMAIN . Generate the script. And set 
according to domain Module (opensips.org) 
 as following:


 DOMAIN module
loadmodule "domain.so"
modparam("domain", "db_url",
"mysql://opensips:opensipsrw@localhost/opensips") # CUSTOMIZE ME
modparam("domain", "db_mode", 0)   # Use caching
modparam("auth_db|usrloc", "use_domain", 1)
modparam("domain", "domain_table", "domain")
modparam("domain", "domain_col", "domain")
modparam("domain", "attrs_col", "attrs")

But got the error "483 Too Many Hops". seems should run command 
"insert into domian(domain) values('192.168.3.53');" to add the domain 
info in the table domain.


But got the following error.

MariaDB [opensips]> insert into domian(domain) values('192.168.3.53);
ERROR 1146 (42S02): Table 'opensips.domian' doesn't exist


Puzzled me.

Please help me. Thanks!

BR,
Sparkle Zou



At 2022-09-06 16:27:10, "Bogdan-Andrei Iancu"  wrote:

Hi SparkleZou,

The issue here is how the password is stored in  DB. As per the
sql dump, the pwd is in pre-computed HA1 format, while your
opensips cfg expects the pwd in plain-text format, see the
`calculate_ha1` and `password_column` modparams for auth_db module.

For more, see

https://opensips.org/html/docs/modules/3.2.x/auth_db.html#param_calculate_ha1

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com
OpenSIPS Summit 27-30 Sept 2022, Athens
   https://www.opensips.org/events/Summit-2022Athens/

On 8/26/22 8:31 AM, SparkleZou wrote:

Hi All,

I'm just start to use OpenSips. Already checked the manual. Step
by Step, here I need help. Thanks! ^_^

1. Already install Opensips 3.3 successfully refer to OpenSIPS
3.1/3.2 Installation Instructions | VoIP School


2. apt install mariadb-server
opensips-cli -x database create opensips
root@opensips:/etc/opensips# mysql opensips -e "show tables"
++ | Tables_in_opensips |
++ | acc | | address | | clusterer | |
dbaliases | | dialog | | dialplan | | dispatcher | | domain | |
dr_carriers | | dr_gateways | | dr_groups | | dr_partitions | |
dr_rules | | grp | | load_balancer | | location | | missed_calls
| | re_grp | | rtpengine | | rtpproxy_sockets | | silo | |
speed_dial | | subscriber | | tls_mgm | | uri | | usr_preferences
| | version | ++
MariaDB [opensips]> select * FROM subscriber;

++--+--+--+---+--+--+--+--+
| id | username | domain | password | email_address | ha1 |
ha1_sha256 | ha1_sha512t256 | rpid |

++--+--+--+---+--+--+--+--+
| 1 | 1000 | 192.168.3.53 | | | 1c77bd7afa5414714be613363977341f
|
a821eb87519b53a8e505184a8798b9300dd1788c32ce59026c6f047d5f0eb717
|
1947492ee9de11818d8a54cc5969bd87e5622f412e1b3e1a117ce8c44b936b5d
| NULL | | 2 | 1001 | 192.168.3.53 | | |
c3d0ccc517e752190644392e7f0c5d93 |
b4efb98003f1e5f75ad6ca5ce320a367a430415b9e304ef384e19b969e14ea44
|
49a9a44fbb296fed9c7fe9b4e86ef113642d2e911fe34e93742cc249de261d5a
| NULL |

++--+--+--+---+--+--+--+--+
2 rows in set (0.000 sec)
accounts 1000 & 1001 are already created

Re: [OpenSIPS-Users] Cannot get registration to work with v3.2.8??

2022-09-06 Thread Bob Atkins

Hi Iancu,

Thank you very much for your reply. Please ignore my previous message - 
it got sent prematurely.


Like you, I am mystified by the fact that it says that it cannot find 
the domain realm when it is actually in the table.


Keep in mind that I changed the code to specifically see the return 
result from www_authorize in my earlier tests and found that 
www_authorize returns [-4] which means (no credentials) - credentials 
were not found in request. WHy is it returning a -4?? Why is that -4 
being passing the if (!www_authorize("", "subscriber")) { statement in 
the first place. It should not fall through to the challenge with a -4 
return.


There is also no reason why the credentials should not be there - they 
have certainly not been consumed before this point.


Here is the subscriber table entry for reference:

id;username;domain;password;cr_preferred_carrier;first_name;last_name;phone;email_address;datetime_created;datetime_modified;confirmation;flag;sendnotification;greeting;allow_find;timezone;customerID;customerName;ha1;ha1_sha256;ha1_sha512t256;rpid
1;3105738133;sip.rs.digidial.net;xxx;\N;PPC 
Home;Fax;3105738133;b...@planeparts.com;2012-07-05 16:36:13;2021-11-07 
13:58:34;;0;72;DigiLink Internet Services\N


I would like to point out that the /_*exact same configuration*_/ works 
properly in OpenSER v1.1 with exactly the same database table and entry


I tried your suggestion (see code snipet below) and still no joy... All 
that was accomplished was the realm got set to the ip server's SRV name 
'sip.rs.digidial.net' (see debug output below).


        if (!www_authorize("", "subscriber")) {
            #xlog("L_INFO","CHALLENGE: [$ft][$tt]");
            www_challenge("", "auth,auth-int", 
"MD5,MD5-sess,SHA-256,SHA-256-sess");

            exit;
        } else {
            #xlog("L_ALERT", "REGISTER: URI [$tu] - FAILED");
            xlog("L_ALERT", "REGISTER: URI [$tu][$rU]$ru credential 
from [$si] - FAILED!");

            sl_send_reply(403, "Not Authorized!");
            exit;
        }

I left the subscriber table entry as above and the test failed. I 
changed the domain of the subscriber to sip.rs.digidial.net and it still 
failed with exactly the same message - see below.


Debug output:

Sep  6 11:34:42 [4299] DBG:core:parse_msg: SIP Request:
Sep  6 11:34:42 [4299] DBG:core:parse_msg:  method: 
Sep  6 11:34:42 [4299] DBG:core:parse_msg:  uri: 
Sep  6 11:34:42 [4299] DBG:core:parse_msg:  version: 
Sep  6 11:34:42 [4299] DBG:core:parse_headers: flags=
Sep  6 11:34:42 [4299] DBG:core:_parse_to: end of header reached, state=10
Sep  6 11:34:42 [4299] DBG:core:_parse_to: display={}, 
ruri={sip:3970@23.253.166.155}
Sep  6 11:34:42 [4299] DBG:core:get_hdr_field:  [27]; 
uri=[sip:3970@23.253.166.155]
Sep  6 11:34:42 [4299] DBG:core:get_hdr_field: to body 
[

]
Sep  6 11:34:42 [4299] DBG:core:parse_via_param: found param type 232, 
 = ; state=6
Sep  6 11:34:42 [4299] DBG:core:parse_via_param: found param type 235, 
 = ; state=17

Sep  6 11:34:42 [4299] DBG:core:parse_via: end of header reached, state=5
Sep  6 11:34:42 [4299] DBG:core:parse_headers: via found, 
flags=

Sep  6 11:34:42 [4299] DBG:core:parse_headers: this is the first via
Sep  6 11:34:42 [4299] DBG:core:get_hdr_field: cseq : <1> 
Sep  6 11:34:42 [4299] DBG:core:get_hdr_field: content_length=0
Sep  6 11:34:42 [4299] DBG:core:get_hdr_field: found end of header
Sep  6 11:34:42 [4299] DBG:core:receive_msg: After parse_msg...
Sep  6 11:34:42 [4299] DBG:core:receive_msg: preparing to run routing 
scripts...
Sep  6 11:34:42 [4299] DBG:pike:mark_node: search on branch 128 
(top=0x7f6aba91fb08)

Sep  6 11:34:42 [4299] DBG:pike:mark_node: only first 1 were matched!
Sep  6 11:34:42 [4299] DBG:pike:pike_check_req: src IP 
[128.90.81.216],node=0x7f6aba91fb08; hits=[0,1],[0,0] node_flags=2 
func_flags=8

Sep  6 11:34:42 [4299] DBG:maxfwd:is_maxfwd_present: value = 70
Sep  6 11:34:42 [4299] DBG:core:comp_scriptvar: int 27: 501 / 2048
Sep  6 11:34:42 [4299] DBG:core:parse_to_param: tag=e5f4a8407663e4f7a3970
Sep  6 11:34:42 [4299] DBG:core:parse_to_param: end of header reached, 
state=11

Sep  6 11:34:42 [4299] DBG:core:_parse_to: end of header reached, state=29
Sep  6 11:34:42 [4299] DBG:core:_parse_to: display={}, 
ruri={sip:3970@23.253.166.155}

Sep  6 11:34:42 [4299] DBG:core:parse_headers: flags=78
Sep  6 11:34:42 [4299] DBG:core:parse_headers: flags=200
Sep  6 11:34:42 [4299] DBG:rr:find_first_route: No Route headers found
Sep  6 11:34:42 [4299] DBG:rr:loose_route: There is no Route HF
Sep  6 11:34:42 [4299] DBG:core:comp_scriptvar: ip 20: 128.90.81.216
Sep  6 11:34:42 [4299] DBG:core:comp_scriptvar: ip 20: 128.90.81.216
Sep  6 11:34:42 [4299] DBG:core:comp_scriptvar: ip 20: 128.90.81.216
Sep  6 11:34:42 [4299] DBG:core:comp_scriptvar: ip 20: 128.90.81.216
Sep  6 11:34:42 [4299] DBG:core:comp_scriptvar: ip 20: 128.90.81.216
Sep  6 11:34:42 [4299] D

Re: [OpenSIPS-Users] How to set auth_db module & db_mysql module work on opensips 3.3

2022-09-06 Thread SparkleZou



Hi Bogdan-Andrei,


Really thanks! It works now.


Here I'm trying to go further steps.


Try to set the domain name.


only add "opensips-cli -x user add 1...@sip-server.com S3cureP4s$"


sip-server.com already set to 192.168.3.53 at dns side.


Change at X-lite to use 1...@sip-server.com failed to log in.


Then try to use the USE_MULTIDOMAIN . Generate the script. And set according to 
domain Module (opensips.org) as following:


 DOMAIN module
loadmodule "domain.so"
modparam("domain", "db_url",
"mysql://opensips:opensipsrw@localhost/opensips") # CUSTOMIZE ME
modparam("domain", "db_mode", 0)   # Use caching
modparam("auth_db|usrloc", "use_domain", 1)
modparam("domain", "domain_table", "domain")
modparam("domain", "domain_col", "domain")
modparam("domain", "attrs_col", "attrs")


But got the error "483 Too Many Hops". seems should run command "insert into 
domian(domain) values('192.168.3.53');" to add the domain info in the table 
domain.


But got the following error.


MariaDB [opensips]> insert into domian(domain) values('192.168.3.53);
ERROR 1146 (42S02): Table 'opensips.domian' doesn't exist




Puzzled me.


Please help me. Thanks!


BR,
Sparkle Zou







At 2022-09-06 16:27:10, "Bogdan-Andrei Iancu"  wrote:

Hi SparkleZou,

The issue here is how the password is stored in  DB. As per the sql dump, the 
pwd is in pre-computed HA1 format, while your opensips cfg expects the pwd in 
plain-text format, see the `calculate_ha1` and `password_column` modparams for 
auth_db module.

For more, see 
https://opensips.org/html/docs/modules/3.2.x/auth_db.html#param_calculate_ha1

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
  https://www.opensips-solutions.com
OpenSIPS Summit 27-30 Sept 2022, Athens
  https://www.opensips.org/events/Summit-2022Athens/
On 8/26/22 8:31 AM, SparkleZou wrote:

Hi All,


I'm just start to use OpenSips. Already checked the manual. Step by Step, here 
I need help. Thanks! ^_^


1. Already install Opensips 3.3 successfully refer to OpenSIPS 3.1/3.2 
Installation Instructions | VoIP School


2. apt install mariadb-server
opensips-cli -x database create opensips
root@opensips:/etc/opensips# mysql opensips -e "show tables" 
++ | Tables_in_opensips | ++ | acc | | 
address | | clusterer | | dbaliases | | dialog | | dialplan | | dispatcher | | 
domain | | dr_carriers | | dr_gateways | | dr_groups | | dr_partitions | | 
dr_rules | | grp | | load_balancer | | location | | missed_calls | | re_grp | | 
rtpengine | | rtpproxy_sockets | | silo | | speed_dial | | subscriber | | 
tls_mgm | | uri | | usr_preferences | | version | ++
MariaDB [opensips]> select * FROM subscriber; 
++--+--+--+---+--+--+--+--+
 | id | username | domain | password | email_address | ha1 | ha1_sha256 | 
ha1_sha512t256 | rpid | 
++--+--+--+---+--+--+--+--+
 | 1 | 1000 | 192.168.3.53 | | | 1c77bd7afa5414714be613363977341f | 
a821eb87519b53a8e505184a8798b9300dd1788c32ce59026c6f047d5f0eb717 | 
1947492ee9de11818d8a54cc5969bd87e5622f412e1b3e1a117ce8c44b936b5d | NULL | | 2 | 
1001 | 192.168.3.53 | | | c3d0ccc517e752190644392e7f0c5d93 | 
b4efb98003f1e5f75ad6ca5ce320a367a430415b9e304ef384e19b969e14ea44 | 
49a9a44fbb296fed9c7fe9b4e86ef113642d2e911fe34e93742cc249de261d5a | NULL | 
++--+--+--+---+--+--+--+--+
 2 rows in set (0.000 sec)
accounts 1000 & 1001 are already created in db.
run /usr/sbin/osipsconfig select ENABLE_TCP & USE_AUTH, generate the CFG file.
 | | | [*] ENABLE_TCP | | [ ] 
ENABLE_TLS | | [ ] USE_ALIASES | | [*] USE_AUTH | | [ ] USE_DBACC | | [ ] 
USE_DBUSRLOC | | [ ] USE_DIALOG | | [ ] USE_MULTIDOMAIN | | [ ] USE_NAT | | [ ] 
USE_PRESENCE | | [ ] USE_DIALPLAN | | [ ] VM_DIVERSION | | [ ] 
HAVE_INBOUND_PSTN | | [ ] HAVE_OUTBOUND_PSTN | | [ ] USE_DR_PSTN | | [ ] 
USE_HTTP_MANAGEMENT_INTERFACE | ||
Then start the opensips. But REGISTER get 401 fail message.

REGISTER sip:192.168.3.53 SIP/2.0

Via: SIP/2.0/UDP 
10.120.100.250:39720;branch=z9hG4bK-d87543-ec515058dd0d9227-1--d87543-;rport

Max-Forwards: 70

Contact: 

To: "1000"

From: "1000";tag=a16e1263

Call-ID: ZTY2NDZlYjc1ZTE3MGE4ZjI5YzhhZjA4M2IzYTIyZTc.

CSeq: 1 REGISTER

Expires: 3600

Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, 
INFO

User-Age