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

2022-09-07 Thread Bogdan-Andrei Iancu

Hi Yury,

Thanks for the details info here - let me do a review of some code and 
run some tests, as at this point I have a good idea on the direction to 
dig into.


I will update here.

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 11:24 AM, Yury Kirsanov wrote:

Hi Bogdan,
Yes, I'm listening on all types of sockets including UDP, TCP and TLS 
on the outside public interface and then forward traffic into internal 
LAN via UDP only.


Previously it was getting stuck quite easily, now I had to wait for a 
while before this actually happened. I've routed part of my customers 
to this server to obtain this result so I will have to do that again.


As soon as I see one of the processes stuck I'll dot the trap command 
and send you all the details including processes load, ps output and 
so on.


For now I had to switch autoscaling off and just create many 
listeners. Do I understand correctly that I need to restart OpenSIPS 
in order to apply autoscaling profiles and reload-routes is not 
sufficient?


Also, do I need separate UDP profiles for public and private 
interfaces? And do I need to apply autoscaling profile just to a 
socket or I need to specify udp or tcp_workers with autoscaler too?


Thanks and best regards,
Yury.

On Tue, 6 Sept 2022, 18:18 Bogdan-Andrei Iancu, > wrote:


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:



___
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-07 Thread Bogdan-Andrei Iancu

Hi,

If not using the multi-domain stuff, use the "alias" global param to let 
opensips know about the SIP domains to handle.

https://www.opensips.org/Documentation/Script-CoreParameters-3-2#alias

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 11:52 AM, SparkleZou wrote:

Hi Bogdan-Andrei,
Thanks! small mistake :-( "insert into domain(domain) 
values('sip-server.com ');"
I want to know opensips inside. So currently I would like to use the 
last version and set manually.
One more question here, if I not enable the USE_MULTIDOMAIN, is there 
a way to set the domain name as "sip-server.com 
". instead of IP "192.168.3.53"?


BR,
Sparkle Zou



At 2022-09-07 14:49:20, "Bogdan-Andrei Iancu"  wrote:

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;


Re: [OpenSIPS-Users] RTP proxy RE-INVITE with late SDP (ACK cannot have SDP body)

2022-09-07 Thread David Villasmil
Hello Callum,

Can you share how you are doing late negotiation?

Regards,

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


On Wed, May 15, 2019 at 6:37 PM Callum Guy  wrote:

> Hi All,
>
> I am working on a problem where for a few destinations my OpenSIPs is
> receiving RE-INVITE messages with late SDP. This is causing a breakdown in
> the rtpproxy engagement and causing the audio to fail mid call.
>
> The OpenSIPs deployment is acting as a SIP proxy which traverses NAT and
> rtpproxy is used in bridging mode. I am using rtpproxy_engage to tie the
> integration to the dialog session and this is for all other purposes
> working as expected.
>
> My failure scenario is when the remote system sends a RE-INVITE message
> which includes no SDP. This passes through to my FreeSWITCH server which
> responds with a 200 including SDP. This message is processed fine and
> interacts with rtpproxy as expected and provides the remote with the
> correct public IP and port for RTP (the same as returned during call
> setup). In response the remote system returns an ACK with SDP which
> triggers an OpenSIPs error message (below) which results in the remotes
> public IP being passed through in SDP which causes the FreeSWITCH to start
> sending RTP direct resulting in one way audio as the media server is not
> publicly accessible.
>
> *ERROR:rtpproxy:engage_force_rtpproxy: not a late negotiation - ACK cannot
> have SDP body*
>
> As I understand it the FreeSWITCH behaviour is OK, although I am not clear
> why it feels the need to resend the SDP. All I want to happen in this
> scenario is for rtpproxy module to re-write the SDP in the way it has for
> all previous messages. I am very interested to hear if there is any reason
> for rtpproxy to disallow late negotiation in this scenario, if anyone can
> point to a relevant RFC that would be interesting!
>
> Is there any way around this other than some sort of manual SDP re-write
> (not helpful to me as I am using a pool of rtpproxy instances)? Might I
> have more luck with offer/answer or indeed rtpengine?
>
> I've illustrated the scenario better on the following link (sngrep paste):
>
>
> https://gist.githubusercontent.com/spacetourist/ef0478c0bf4e2d736f9b5663042087dd/raw/6f0a984a1a2838e7e2c4539f059fd68935a3b0b1/gistfile1.txt
>
> Thanks, looking forward to any advice!
>
> Best regards,
>
> Callum
>
>
>
>
> *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
>
___
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-07 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


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

2022-09-07 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] 

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

2022-09-07 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 

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

2022-09-07 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] Cannot get registration to work with v3.2.8??

2022-09-07 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