uac registrant module issue

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

uac registrant module issue

jehanzaibkiani
Hi folks, 

I am facing a weird issue. can anyone help me please?

opensips 2.2.2 with the below config. Trying to register my sip provider trunk on our opensips.

loadmodule "uac_registrant.so"
modparam("uac_registrant", "hash_size", 2)
modparam("uac_registrant", "timer_interval", 120)
modparam("uac_registrant", "db_url", "mysql://mydbuser:pass@databasename/mydb")
modparam("uac_registrant", "table_name", "registrant")
modparam("uac_registrant", "username_column", "username")
modparam("uac_registrant", "password_column", "password")
modparam("uac_registrant", "expiry_column", "expiry")
modparam("uac_registrant", "aor_column", "aor")
modparam("uac_registrant", "proxy_column", "proxy")

Here is the table structure.
| id | registrar | proxy   | aor | third_party_registrant | username | password| binding_URI | binding_params | expiry | forced_socket
When i reload: opensipsctl fifo reg_reload
Feb 18 20:39:56 sbc1 /usr/sbin/opensips[14223]: DBG:db_mysql:db_mysql_str2val: converting INT [180]
Feb 18 20:39:56 sbc1 /usr/sbin/opensips[14223]: INFO:uac_registrant:load_reg_info_from_db: loading [1] records from db
Feb 18 20:39:56 sbc1 /usr/sbin/opensips[14223]: ERROR:core:parse_uri: bad uri, state 0 parsed: <test01> (4) / <test0102-p01.mytestprovider.com> (22)
Feb 18 20:39:56 sbc1 /usr/sbin/opensips[14223]: ERROR:uac_registrant:load_reg_info_from_db: cannot parse registrar uri [test0102-p01.mytestprovider.com]


Regards,
Jehanzaib

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Thanks,

Jehanzaib
Reply | Threaded
Open this post in threaded view
|

Re: uac registrant module issue

Johan De Clercq
where is @ ?

Op ma 18 feb. 2019 om 09:14 schreef J E H A N Z A I B <[hidden email]>:
Hi folks, 

I am facing a weird issue. can anyone help me please?

opensips 2.2.2 with the below config. Trying to register my sip provider trunk on our opensips.

loadmodule "uac_registrant.so"
modparam("uac_registrant", "hash_size", 2)
modparam("uac_registrant", "timer_interval", 120)
modparam("uac_registrant", "db_url", "mysql://mydbuser:pass@databasename/mydb")
modparam("uac_registrant", "table_name", "registrant")
modparam("uac_registrant", "username_column", "username")
modparam("uac_registrant", "password_column", "password")
modparam("uac_registrant", "expiry_column", "expiry")
modparam("uac_registrant", "aor_column", "aor")
modparam("uac_registrant", "proxy_column", "proxy")

Here is the table structure.
| id | registrar | proxy   | aor | third_party_registrant | username | password| binding_URI | binding_params | expiry | forced_socket
When i reload: opensipsctl fifo reg_reload
Feb 18 20:39:56 sbc1 /usr/sbin/opensips[14223]: DBG:db_mysql:db_mysql_str2val: converting INT [180]
Feb 18 20:39:56 sbc1 /usr/sbin/opensips[14223]: INFO:uac_registrant:load_reg_info_from_db: loading [1] records from db
Feb 18 20:39:56 sbc1 /usr/sbin/opensips[14223]: ERROR:core:parse_uri: bad uri, state 0 parsed: <test01> (4) / <test0102-p01.mytestprovider.com> (22)
Feb 18 20:39:56 sbc1 /usr/sbin/opensips[14223]: ERROR:uac_registrant:load_reg_info_from_db: cannot parse registrar uri [test0102-p01.mytestprovider.com]


Regards,
Jehanzaib
_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: uac registrant module issue

jehanzaibkiani
Hi Johan,

This is a registrar field which does not have @ do you want me to change it to username@host?

On Mon, Feb 18, 2019 at 9:32 PM Johan De Clercq <[hidden email]> wrote:
where is @ ?

Op ma 18 feb. 2019 om 09:14 schreef J E H A N Z A I B <[hidden email]>:
Hi folks, 

I am facing a weird issue. can anyone help me please?

opensips 2.2.2 with the below config. Trying to register my sip provider trunk on our opensips.

loadmodule "uac_registrant.so"
modparam("uac_registrant", "hash_size", 2)
modparam("uac_registrant", "timer_interval", 120)
modparam("uac_registrant", "db_url", "mysql://mydbuser:pass@databasename/mydb")
modparam("uac_registrant", "table_name", "registrant")
modparam("uac_registrant", "username_column", "username")
modparam("uac_registrant", "password_column", "password")
modparam("uac_registrant", "expiry_column", "expiry")
modparam("uac_registrant", "aor_column", "aor")
modparam("uac_registrant", "proxy_column", "proxy")

Here is the table structure.
| id | registrar | proxy   | aor | third_party_registrant | username | password| binding_URI | binding_params | expiry | forced_socket
When i reload: opensipsctl fifo reg_reload
Feb 18 20:39:56 sbc1 /usr/sbin/opensips[14223]: DBG:db_mysql:db_mysql_str2val: converting INT [180]
Feb 18 20:39:56 sbc1 /usr/sbin/opensips[14223]: INFO:uac_registrant:load_reg_info_from_db: loading [1] records from db
Feb 18 20:39:56 sbc1 /usr/sbin/opensips[14223]: ERROR:core:parse_uri: bad uri, state 0 parsed: <test01> (4) / <test0102-p01.mytestprovider.com> (22)
Feb 18 20:39:56 sbc1 /usr/sbin/opensips[14223]: ERROR:uac_registrant:load_reg_info_from_db: cannot parse registrar uri [test0102-p01.mytestprovider.com]


Regards,
Jehanzaib
_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


--
Regards,
Jehanzaib

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Thanks,

Jehanzaib
Reply | Threaded
Open this post in threaded view
|

Re: uac registrant module issue

OpenSIPS - Users mailing list
Hi, Jehanzaib!

Could you paste here the SELECT from your DB?

Please set vertical oputput in your DB if possible
( \x for PGSQL, \G for MySQL).

Here's a working example:

opensips=> select * from sipgw01_registrant ORDER BY id DESC LIMIT 1;
-[ RECORD 1 ]----------+-------------------------------
id                     | 186
registrar              | sip:999.201.888.35
proxy                  |
aor                    | sip:[hidden email]
third_party_registrant |
username               | 7xxxzzz3333
password               | mEgApAsS
binding_uri            | sip:7xxxzzz3333@999.209.888.74
binding_params         |
expiry                 | 180
forced_socket          |


-----------------------------------------------
BR, Alexey
http://alexeyka.zantsev.com/
_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: uac registrant module issue

OpenSIPS - Users mailing list
Oh, it seems that either webserver/browsers
change the 'at' sign to 'at' word (preposition).

In my DB output there is no 'at' word, there's a
proper sign like in e-mail address.

Maybe you faced the same here in list and the actual
problem is somewhere else.

A screenshot/SIP debug can also be useful.

-----------------------------------------------
BR, Alexey
http://alexeyka.zantsev.com/
_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: uac registrant module issue

jehanzaibkiani
In reply to this post by OpenSIPS - Users mailing list
Thank you ALex.

I actually did not have sip: at the start in the registrar. 
Let me update the values in the database and test it out. Will get back to you shortly.

Ty

On Tue, Feb 19, 2019 at 12:11 AM Alexey Kazantsev via Users <[hidden email]> wrote:
Hi, Jehanzaib!

Could you paste here the SELECT from your DB?

Please set vertical oputput in your DB if possible
( \x for PGSQL, \G for MySQL).

Here's a working example:

opensips=> select * from sipgw01_registrant ORDER BY id DESC LIMIT 1;
-[ RECORD 1 ]----------+-------------------------------
id                     | 186
registrar              | sip:999.201.888.35
proxy                  |
aor                    | [hidden email]
third_party_registrant |
username               | 7xxxzzz3333
password               | mEgApAsS
binding_uri            | sip:7xxxzzz3333@999.209.888.74
binding_params         |
expiry                 | 180
forced_socket          |


-----------------------------------------------
BR, Alexey
http://alexeyka.zantsev.com/
_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


--
Regards,
Jehanzaib

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Thanks,

Jehanzaib
Reply | Threaded
Open this post in threaded view
|

Re: uac registrant module issue

jehanzaibkiani
Hi Alex,

I have made this work by adding sip: in the registrar. Awesome. thank you. 
One more thing, do you know how to route the call to this registered trunk ?

I usually change the $duri but not sure how to route for this registered sip trunk.

Ty

Thank you

On Tue, Feb 19, 2019 at 12:45 AM J E H A N Z A I B <[hidden email]> wrote:
Thank you ALex.

I actually did not have sip: at the start in the registrar. 
Let me update the values in the database and test it out. Will get back to you shortly.

Ty

On Tue, Feb 19, 2019 at 12:11 AM Alexey Kazantsev via Users <[hidden email]> wrote:
Hi, Jehanzaib!

Could you paste here the SELECT from your DB?

Please set vertical oputput in your DB if possible
( \x for PGSQL, \G for MySQL).

Here's a working example:

opensips=> select * from sipgw01_registrant ORDER BY id DESC LIMIT 1;
-[ RECORD 1 ]----------+-------------------------------
id                     | 186
registrar              | sip:999.201.888.35
proxy                  |
aor                    | [hidden email]
third_party_registrant |
username               | 7xxxzzz3333
password               | mEgApAsS
binding_uri            | sip:7xxxzzz3333@999.209.888.74
binding_params         |
expiry                 | 180
forced_socket          |


-----------------------------------------------
BR, Alexey
http://alexeyka.zantsev.com/
_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


--
Regards,
Jehanzaib


--
Regards,
Jehanzaib

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Thanks,

Jehanzaib
Reply | Threaded
Open this post in threaded view
|

Re: uac registrant module issue

OpenSIPS - Users mailing list
Hi Jehanzaib,

I never used such scenarios, I just receive inbound calls
via registered connections.

I think you should form request-URI using $ru [1] variable
before sending your INVITE. 

But I'm almost absolutely sure that your VoIP provider
will check either From user or smth like that in your INVITEs,
so be ready to use functions like uac_replace_from [2] 
before calling t_relay.

In the simplest case 
it may be something like:

  ...
  $ru = "sip:xyz@1.2.3.4"
  uac_replace_from("...","...");
  ...
  t_relay();



[1]  https://www.opensips.org/Documentation/Script-CoreVar-2-4#toc75
[2]  https://opensips.org/html/docs/modules/2.4.x/uac.html#func_uac_replace_from_2

-----------------------------------------------
BR, Alexey
http://alexeyka.zantsev.com/
_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users