Re: [OpenSIPS-Users] Working with a dataset larger than dialplan will load.

2019-04-22 Thread John Kiniston
Thanks guys, I was moving down the path of using redis as an alternative to
the dialplan module and it sounds like that is the right direction to go.

Liviu, There were not any additional errors, I'll see if I saved a copy of
the VM I was exploring using dialplan on and look at the MySQL side of
things.

On Sun, Apr 21, 2019 at 11:51 PM Liviu Chircu  wrote:

> I second this -- strictly discussing implementation, dialplan performs a
> simple (and costly) iteration over up-to-all matching rules for each
> lookup, while drouting builds an internal trie structure which will
> dramatically improve lookup latencies.
>
> Still, regarding the original problem:  are there no additional errors
> which may be relevant?  If yes, then you may have a MySQL server
> configuration issue (notice how it's not able to return the data).  Tuning
> settings like "max_allowed_packet" might fix this.
>
> Liviu Chircu
> OpenSIPS Developerhttp://www.opensips-solutions.com
>
> On 17.04.2019 15:59, Jon Abrams wrote:
>
> If that's the LCAD or LERG databases, I'd put the data in Redis and query
> that. That will give you faster startup times, and won't add much of any
> noticeable latency.
>
> Alternatively you could try to do something with the drouting module,
> which is designed for very large data sets.
>
> - Jon Abrams
>
> On Mon, Apr 8, 2019 at 12:58 PM John Kiniston 
> wrote:
>
>> Good Morning,
>>
>> I am attempting to use dialplan to lookup rate centers on dialed calls to
>> determine if a caller is dialing outside it's local area.
>>
>> If I attempt to use the full data set with 167424 rows opensips fails to
>> start with a failure to query the database.
>>
>> When I use a smaller data set of only 500 rows I'm able to start opensips
>> without errors.
>>
>> I'm not seeing the query time out, if I run the query by hand I get
>> results back from MySQL?
>>
>> Is there a different module I should be attempting to do this with? I was
>> planning to look up the NPANXX pairing for the source and destination of
>> the call and check against the attrs column where I stored the ratecenter.
>>
>>
>> pr  8 13:37:50 federated-sip /sbin/opensips[4666]:
>> INFO:db_mysql:connect_with_retry: re-connected successful for
>> 0x7f33bef25a18
>> Apr  8 13:37:50 federated-sip /sbin/opensips[4666]:
>> DBG:db_mysql:mysql_raise_event: MySQL status has not changed: connected
>> Apr  8 13:37:50 federated-sip /sbin/opensips[4666]:
>> CRITICAL:db_mysql:db_mysql_submit_query: too many mysql server reconnection
>> failures
>> Apr  8 13:37:50 federated-sip /sbin/opensips[4666]:
>> ERROR:core:db_do_query: error while submitting query - [select
>> dpid,pr,match_op,match_exp,match_flags,subst_exp,repl_exp,attrs,timerec
>> from dialplan where disabled=0 order by pr]
>> Apr  8 13:37:50 federated-sip /sbin/opensips[4666]:
>> ERROR:dialplan:dp_load_db: failed to query database!
>> Apr  8 13:37:50 federated-sip /sbin/opensips[4666]:
>> ERROR:dialplan:dp_load_all_db: unable to load dialplan table
>> Apr  8 13:37:50 federated-sip /sbin/opensips[4666]:
>> ERROR:dialplan:mi_reload_rules: failed to reload database
>> Apr  8 13:39:44 federated-sip /sbin/opensips[4666]:
>> DBG:mi_fifo:mi_parse_tree: adding node <> ; val <9>
>> Apr  8 13:39:44 federated-sip /sbin/opensips[4666]:
>> DBG:mi_fifo:mi_parse_node: end of input tree
>> Apr  8 13:39:44 federated-sip /sbin/opensips[4666]:
>> DBG:mi_fifo:mi_fifo_server: done parsing the mi tree
>> Apr  8 13:39:57 federated-sip /sbin/opensips[4666]:
>> DBG:mi_fifo:mi_parse_node: end of input tree
>> Apr  8 13:39:57 federated-sip /sbin/opensips[4666]:
>> DBG:mi_fifo:mi_fifo_server: done parsing the mi tree
>> Apr  8 13:39:59 federated-sip /sbin/opensips[4666]:
>> INFO:db_mysql:switch_state_to_disconnected: disconnect event for
>> 0x7f33bef25a18
>> Apr  8 13:39:59 federated-sip /sbin/opensips[4666]:
>> INFO:db_mysql:reset_all_statements: resetting all statements on
>> connection: (0x7f33bef26538) 0x7f33bef25a18
>> Apr  8 13:39:59 federated-sip /sbin/opensips[4666]:
>> DBG:db_mysql:db_mysql_connect: opening connection: mysql://
>> :@172.16.52.35/opensips
>> Apr  8 13:39:59 federated-sip /sbin/opensips[4666]:
>> DBG:db_mysql:db_mysql_connect: connection type is 172.16.52.35 via TCP/IP
>> Apr  8 13:39:59 federated-sip /sbin/opensips[4666]:
>> DBG:db_mysql:db_mysql_connect: protocol version is 10
>> Apr  8 13:39:59 federated-sip /sbin/opensips[4666]:
>> DBG:db_mysql:db_mysql_connect: server version is 5.5.60-MariaDB
>> Apr  8 13:39:59 federated-sip /sbin/opensips[4666]:
>> INFO:db_mysql:connect_with_retry: re-connected successful for
>> 0x7f33bef25a18
>> Apr  8 13:40:01 federated-sip /sbin/opensips[4666]:
>> INFO:db_mysql:switch_state_to_disconnected: disconnect event for
>> 0x7f33bef25a18
>> Apr  8 13:40:01 federated-sip /sbin/opensips[4666]:
>> INFO:db_mysql:reset_all_statements: resetting all statements on
>> connection: (0x7f33bef26538) 0x7f33bef25a18
>> Apr  8 13:40:01 federated-sip /sbin/opensips[4666]:
>> 

[OpenSIPS-Users] opensips-cp 8.2.4 MI page and drop-down Servers

2019-04-22 Thread Albary Franco Pimpao Junior

Hi people,Recently I did a git clone of cp for opensips 2.4.x and setup for just one server with MI conn via json. In order to be successfull in the connection my collegue Frederico helped me and did a workaround in ... mi/lib/functions.inc.php. In function show_boxes it was included before foreach statement:if ( empty( $_SESSION['mi_current_box'] ) )   echo '- select -';Maybe others have already passed into the same problem. I don't know if there's a better way to do it.Thanks and Best RegardsAlbary - Celepar




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


Re: [OpenSIPS-Users] OpenSIPS 2.4.5 stops responding

2019-04-22 Thread Alexey Kazantsev via Users

And warnings related to memory...

  WARNING:core:init_reactor_size: shrinking reactor size from 262144 
(autodetected via rlimit) to 13107 (limited by memory of 10% from 4Mb)
  WARNING:core:init_reactor_size: use 'open_files_limit' to enforce other limit 
or increase pkg memory

---
BR, Alexey
http://alexeyka.zantsev.com/
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] OpenSIPS 2.4.5 stops responding

2019-04-22 Thread Alexey Kazantsev via Users
Guys helped me to find, but still any ideas are welcome

https://opensips.org/pipermail/users/2008-December/001872.html

---
BR, Alexey
http://alexeyka.zantsev.com/
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] OpenSIPS 2.4.5 stops responding

2019-04-22 Thread Alexey Kazantsev via Users
I noticed also that these errors appear in log suddenly, maybe this is the cause
of OpenSIPS restart? But I haven't examined SIP traffic yet. Just watch the 
logs.

   ERROR:core:forward_reply: no 2nd via found in reply

---
BR, Alexey
http://alexeyka.zantsev.com/
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] OpenSIPS 2.4.5 stops responding

2019-04-22 Thread Alexey Kazantsev via Users

I noticed also that these errors appear in log suddenly, maybe this is the cause
of OpenSIPS restart? But I haven't examined SIP traffic yet. Just watch the 
logs.

   ERROR:core:forward_reply: no 2nd via found in reply

---
BR, Alexey
http://alexeyka.zantsev.com/
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Integrating with Asterisk in the same box

2019-04-22 Thread David Villasmil
How can it mess up your dns? It’s supposed to be in its own DB. Did you put
it all (asterisk and opensips) in the same dB schema?

On Mon, 22 Apr 2019 at 12:08, John Tuxies  wrote:

> This is the first thing that i started with. Tried it in opensips 2.4 with
> asterisk 16 but it messed all the db schemas in Mysql. Updates on this page
> to newer versions it will help a lot
>
>
>
> On Monday, April 22, 2019, Alexey Kazantsev via Users <
> users@lists.opensips.org> wrote:
>
>> Hello John,
>>
>> have you read this tutorial?
>>
>> https://www.opensips.org/Documentation/Tutorials-OpenSIPSAsteriskIntegration-1-8
>>
>> I hope it has a plenty of information you need.
>>
>> ---
>> BR, Alexey
>> http://alexeyka.zantsev.com/
>> ___
>> 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
>
-- 
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] Integrating with Asterisk in the same box

2019-04-22 Thread John Tuxies
This is the first thing that i started with. Tried it in opensips 2.4 with
asterisk 16 but it messed all the db schemas in Mysql. Updates on this page
to newer versions it will help a lot



On Monday, April 22, 2019, Alexey Kazantsev via Users <
users@lists.opensips.org> wrote:

> Hello John,
>
> have you read this tutorial?
> https://www.opensips.org/Documentation/Tutorials-
> OpenSIPSAsteriskIntegration-1-8
>
> I hope it has a plenty of information you need.
>
> ---
> BR, Alexey
> http://alexeyka.zantsev.com/
> ___
> 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] Integrating with Asterisk in the same box

2019-04-22 Thread Alexey Kazantsev via Users
Hello John,

have you read this tutorial?
https://www.opensips.org/Documentation/Tutorials-OpenSIPSAsteriskIntegration-1-8

I hope it has a plenty of information you need.

---
BR, Alexey
http://alexeyka.zantsev.com/
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Integrating with Asterisk in the same box

2019-04-22 Thread John Tuxies
i am looking to have a single box where asterisk and opensips live side by
side, but in different ports. Opensips will be in port 5060 and everybody
will register to Opensips, while Asterisk will be in a different port and
have all the services. The available services on asterisk will be
conference, voicemail, sip trunks, etc.
This is what i am trying to do and i am lost with the configuration.


On Mon, Apr 22, 2019 at 10:54 AM Liviu Chircu  wrote:

> On 22.04.2019 10:04, John Tuxies wrote:
> > Thanks for your reply. Since i am stuck in the integration of Opensips
> > with Asterisk how do i proceed then?
> > If i create a user to Opensips, do i have to create the same user to
> > Asterisk as well?
>
> It much depends on the setup that you want to achieve.  For example, if
> you're just using OpenSIPS as a means to scale out, then you can keep it
> dumber and have users strictly reside on Asterisk, which will do all
> authentication.
>
> Liviu Chircu
> OpenSIPS Developer
> http://www.opensips-solutions.com
>
>
> ___
> 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] Integrating with Asterisk in the same box

2019-04-22 Thread Liviu Chircu

On 22.04.2019 10:04, John Tuxies wrote:
Thanks for your reply. Since i am stuck in the integration of Opensips 
with Asterisk how do i proceed then?
If i create a user to Opensips, do i have to create the same user to 
Asterisk as well?


It much depends on the setup that you want to achieve.  For example, if 
you're just using OpenSIPS as a means to scale out, then you can keep it 
dumber and have users strictly reside on Asterisk, which will do all 
authentication.


Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com


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


Re: [OpenSIPS-Users] Integrating with Asterisk in the same box

2019-04-22 Thread John Tuxies
Thanks for your reply. Since i am stuck in the integration of Opensips with
Asterisk how do i proceed then?
If i create a user to Opensips, do i have to create the same user to
Asterisk as well?



On Monday, April 22, 2019, Liviu Chircu  wrote:

> Hi all. I have an installation of opensips 2.4 with control panel, in a
>> Debian 8 server.
>> I would like to integrate my Opensips installation with an Asterisk 16.
>> For the time being it has to be in the same box. So it would enhance with
>> Incoming/outgoing Trunks, IVR, Voicemail, Conference,etc.
>> The system at the moment has this setup
>> https://www.powerpbx.org/content/opensips-v24-debian-v8-mariadb-apache-v1
>> and i have installed a simple asterisk (Chan_SIP) as simple as possible,
>> without anything fancy. As an example of the Asterisk config i used the
>> guide
>> https://computingforgeeks.com/how-to-install-asterisk-16-lts
>> -on-ubuntu-18-04-16-04-debian-9/.
>> I have left the default 5060 port to Opensips and the port 5090 to
>> Asterisk.
>>
> So far, so good.  OpenSIPS in front, Asterisk in the back -- you're on the
> right path.
>
>> I am looking what other config do i have to do, so i could create users
>> in the Opensips control panel and created automatically in the Asterisk's
>> database to read from.
>> Also what other do i have to do to make them interact seamlessly, please?
>>
> Here is when it gets dicy -- there is no such software available yet.  In
> order to achieve this, one idea would be to fork the Control Panel and
> start hacking away at extending it in order to also work with Asterisk
> (additional GUI interactions?  additional server-side PHP logic for the
> Asterisk DB handling?
>
> ___
> 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] Working with a dataset larger than dialplan will load.

2019-04-22 Thread Liviu Chircu
I second this -- strictly discussing implementation, dialplan performs a 
simple (and costly) iteration over up-to-all matching rules for each 
lookup, while drouting builds an internal trie structure which will 
dramatically improve lookup latencies.


Still, regarding the original problem:  are there no additional errors 
which may be relevant?  If yes, then you may have a MySQL server 
configuration issue (notice how it's not able to return the data).  
Tuning settings like "max_allowed_packet" might fix this.


Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 17.04.2019 15:59, Jon Abrams wrote:
If that's the LCAD or LERG databases, I'd put the data in Redis and 
query that. That will give you faster startup times, and won't add 
much of any noticeable latency.


Alternatively you could try to do something with the drouting module, 
which is designed for very large data sets.


- Jon Abrams

On Mon, Apr 8, 2019 at 12:58 PM John Kiniston > wrote:


Good Morning,

I am attempting to use dialplan to lookup rate centers on dialed
calls to determine if a caller is dialing outside it's local area.

If I attempt to use the full data set with 167424 rows opensips
fails to start with a failure to query the database.

When I use a smaller data set of only 500 rows I'm able to start
opensips without errors.

I'm not seeing the query time out, if I run the query by hand I
get results back from MySQL?

Is there a different module I should be attempting to do this
with? I was planning to look up the NPANXX pairing for the source
and destination of the call and check against the attrs column
where I stored the ratecenter.


pr  8 13:37:50 federated-sip /sbin/opensips[4666]:
INFO:db_mysql:connect_with_retry: re-connected successful for
0x7f33bef25a18
Apr  8 13:37:50 federated-sip /sbin/opensips[4666]:
DBG:db_mysql:mysql_raise_event: MySQL status has not changed:
connected
Apr  8 13:37:50 federated-sip /sbin/opensips[4666]:
CRITICAL:db_mysql:db_mysql_submit_query: too many mysql server
reconnection failures
Apr  8 13:37:50 federated-sip /sbin/opensips[4666]:
ERROR:core:db_do_query: error while submitting query - [select
dpid,pr,match_op,match_exp,match_flags,subst_exp,repl_exp,attrs,timerec
from dialplan where disabled=0 order by pr]
Apr  8 13:37:50 federated-sip /sbin/opensips[4666]:
ERROR:dialplan:dp_load_db: failed to query database!
Apr  8 13:37:50 federated-sip /sbin/opensips[4666]:
ERROR:dialplan:dp_load_all_db: unable to load dialplan table
Apr  8 13:37:50 federated-sip /sbin/opensips[4666]:
ERROR:dialplan:mi_reload_rules: failed to reload database
Apr  8 13:39:44 federated-sip /sbin/opensips[4666]:
DBG:mi_fifo:mi_parse_tree: adding node <> ; val <9>
Apr  8 13:39:44 federated-sip /sbin/opensips[4666]:
DBG:mi_fifo:mi_parse_node: end of input tree
Apr  8 13:39:44 federated-sip /sbin/opensips[4666]:
DBG:mi_fifo:mi_fifo_server: done parsing the mi tree
Apr  8 13:39:57 federated-sip /sbin/opensips[4666]:
DBG:mi_fifo:mi_parse_node: end of input tree
Apr  8 13:39:57 federated-sip /sbin/opensips[4666]:
DBG:mi_fifo:mi_fifo_server: done parsing the mi tree
Apr  8 13:39:59 federated-sip /sbin/opensips[4666]:
INFO:db_mysql:switch_state_to_disconnected: disconnect event for
0x7f33bef25a18
Apr  8 13:39:59 federated-sip /sbin/opensips[4666]:
INFO:db_mysql:reset_all_statements: resetting all statements on
connection: (0x7f33bef26538) 0x7f33bef25a18
Apr  8 13:39:59 federated-sip /sbin/opensips[4666]:
DBG:db_mysql:db_mysql_connect: opening connection:
mysql://:@172.16.52.35/opensips

Apr  8 13:39:59 federated-sip /sbin/opensips[4666]:
DBG:db_mysql:db_mysql_connect: connection type is 172.16.52.35 via
TCP/IP
Apr  8 13:39:59 federated-sip /sbin/opensips[4666]:
DBG:db_mysql:db_mysql_connect: protocol version is 10
Apr  8 13:39:59 federated-sip /sbin/opensips[4666]:
DBG:db_mysql:db_mysql_connect: server version is 5.5.60-MariaDB
Apr  8 13:39:59 federated-sip /sbin/opensips[4666]:
INFO:db_mysql:connect_with_retry: re-connected successful for
0x7f33bef25a18
Apr  8 13:40:01 federated-sip /sbin/opensips[4666]:
INFO:db_mysql:switch_state_to_disconnected: disconnect event for
0x7f33bef25a18
Apr  8 13:40:01 federated-sip /sbin/opensips[4666]:
INFO:db_mysql:reset_all_statements: resetting all statements on
connection: (0x7f33bef26538) 0x7f33bef25a18
Apr  8 13:40:01 federated-sip /sbin/opensips[4666]:
DBG:db_mysql:db_mysql_connect: opening connection:
mysql://:@172.16.52.35/opensips

Apr  8 13:40:01 federated-sip /sbin/opensips[4666]:
DBG:db_mysql:db_mysql_connect: connection type is 172.16.52.35 via

Re: [OpenSIPS-Users] async and event handlers

2019-04-22 Thread Liviu Chircu

Hi, John!

Some answers below:


My question is this: Can I use async() or launch() as a wrapper for a
cache_store() function call made from within an event handler?
Calling async() or launch() from an event handler SHOULD work (see 
below).  Unfortunately, the "cache_" family of functions do not have 
async support.

Is there any
advantage to doing so or can I regard event handlers as a safe place to
initiate blocking operations because, I assume, events must already have
their own queue.


This is where it gets interesting -- in many cases, which include the 
usrloc save() operation, the event handlers are ran inline with the SIP 
processing, by the same process!  So performing a blocking operation in 
that context still has the unpleasant potential to bog down your SIP 
processing responsiveness/latencies.


Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com




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


Re: [OpenSIPS-Users] async() and config actions call stack

2019-04-22 Thread Liviu Chircu

Hi Vitalii,

Indeed - we have thought about this alternative ever since we introduced 
"resume route".  However, the amount of work required to make this 
happen is immense, and would retard the development of other, 
potentially much more useful features.  It is our belief that, for the 
moment, having to break down the logic into "before" and "after" 
sections is not that much of a deal-breaker (I can personally attest to 
that!).  Here are two tips to make your script more readable:


* try breaking it down into multiple files, grouped by business logic

* try to have a naming convention for the resume routes, for example: 
"resume_lnp_dip"


Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 09.04.2019 18:28, Vitalii Aleksandrov wrote:

Hi opensips team and community,

    Want to share one headache I have which might be converted into a 
feature request. It's about async() implementation. I use it, like 
probably many of us, for db operations and http requests and it's so 
complicated to insert an async() call so some already written and 
tested config. The requirement to set a "resume_route" and continue 
request processing in it forces to break a script into "before async" 
and "after async" parts. If you have only one async() call during 
request processing it's more or less manageable and when it comes to 
many async() operations it becomes a nightmare.


    I'm dreaming about the way to just "return" from a "resume_route" 
and continue script execution from the instruction next to the place 
were async() was called. Frankly speaking I didn't check how it's 
implemented and config execution part of opensips is a blackbox for 
me. So I assume there might be some architectural reasons and 
obstacles which don't allow to make it this way.


    Haven't found anything related in 3.0 roadmap. I'm sure this would 
be very beneficial for all opensips users.


Feedback and comments are appreciated.


___
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] Integrating with Asterisk in the same box

2019-04-22 Thread Liviu Chircu
Hi all. I have an installation of opensips 2.4 with control panel, in 
a Debian 8 server.
I would like to integrate my Opensips installation with an Asterisk 
16. For the time being it has to be in the same box. So it would 
enhance with Incoming/outgoing Trunks, IVR, Voicemail, Conference,etc.

The system at the moment has this setup
https://www.powerpbx.org/content/opensips-v24-debian-v8-mariadb-apache-v1
and i have installed a simple asterisk (Chan_SIP) as simple as 
possible, without anything fancy. As an example of the Asterisk config 
i used the guide

https://computingforgeeks.com/how-to-install-asterisk-16-lts-on-ubuntu-18-04-16-04-debian-9/.
I have left the default 5060 port to Opensips and the port 5090 to 
Asterisk.
So far, so good.  OpenSIPS in front, Asterisk in the back -- you're on 
the right path.
I am looking what other config do i have to do, so i could create 
users in the Opensips control panel and created automatically in the 
Asterisk's database to read from.

Also what other do i have to do to make them interact seamlessly, please?
Here is when it gets dicy -- there is no such software available yet.  
In order to achieve this, one idea would be to fork the Control Panel 
and start hacking away at extending it in order to also work with 
Asterisk (additional GUI interactions?  additional server-side PHP logic 
for the Asterisk DB handling?


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


Re: [OpenSIPS-Users] WebRTC and mid_registrar issue

2019-04-22 Thread Liviu Chircu

Hi Terry,


Currently, mid-registrar is incompatible with topology hiding, as they 
both attempt to edit the "Contact" header field.


Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 09.04.2019 14:01, Terry Walters wrote:
I have a working OpenSIPS deployment running as a PSTN proxy and am 
trying to add in support for WebRTC which will forward requests to an 
internal SIP PBX. Currently the registrations appear to be passing 
through the mid_registrar correctly and the initial invite from my PBX 
is correctly routed to the websocket client.


The PBX receives messages up to the 180 ringing correctly, but on the 
200 OK from the websocket client the r.uri contains a d.id rather than 
the ctid, this then results in the calling timing out and the ACK from 
the PBX not routing to the websocket client. I believe this is the 
script area that is falling over once the has_totag function is checked.


if (loose_route())
  {
   if (is_method("INVITE"))
   {
    # even if in most of the cases is useless, do RR for
    # re-INVITEs alos, as some buggy clients do change route set
    # during the dialog.
    record_route();
   }
   else if (is_method("ACK"))
   {
    if (has_body("application/sdp"))
    {
     # check if destination is WS
     if ($du != NULL)
      $var(proto) = $dP;
     else
      $var(proto) = $rP;
     if ($var(proto) == "WS" || $var(proto) == "WSS")
      setbflag(DST_WS);

     route(rtpengine_answer);
    }
   }

   # route it out to whatever destination was set by loose_route()
   # in $du (destination URI).
   route(websocket);
  }
  else
  {
   if ( is_method("ACK") )
   {
    if ( t_check_trans() )
    {
     # non loose-route, but stateful ACK; must be an ACK after
     # a 487 or e.g. 404 from upstream server
     t_relay();
     exit;
    }
    else
    {
     # ACK without matching transaction ->
     # ignore and discard
     exit;
    }
   }
   sl_send_reply("404","Not here");

The route[websocket] is using force send socket to remove the NAT 
address that cannot be accessed internally:


route[webscoket]
{
xlog("L_INFO","Entered websocket route");
# for each branch we will call the function below
t_on_branch("per_branch_ops");

# for each reply we will call the function below
t_on_reply("handle_nat");
# initial invites from the main registrar - need to look them up!
if (is_method("INVITE"))
 if($Ri == "1.1.1.1" and $Rp == 5070)
 {
  xlog("L_INFO","Call received for a websocket client");
  if (!mid_registrar_lookup("location"))
  {
   t_reply("404", "Not Found");
   exit;
  }

 }
 else  if($Ri=="1.1.1.1" && $Rp == "8080")
 {
  xlog("L_INFO","Inbound call received on port 8080");
  route("ToInternal");
  t_on_failure("int_invites");
 }

if((is_method("REGISTER"))&&($Ri=="1.1.1.1")&&($Rp =="8080"))
{
 xlog("L_INFO","Register received - mid-registrar actions");
 fix_nated_register();
 mid_registrar_save("location");
 switch ($retcode)
 {
 case 1:
  xlog("L_INFO", "forwarding REGISTER to main registrar...\n");
  $ru = "sip:2.2.2.2:5060";
  force_send_socket(UDP:1.1.1.1:5070);
 if (!t_relay()) {
  send_reply("500", "Server Internal Error 1");
 }
  t_on_failure("int_invites");
  break;
 case 2:
  xlog("L_INFO", "REGISTER has been absorbed!\n");
  break;
 default:
  xlog("L_ERR", "mid-registrar error!\n");
  send_reply("500", "Server Internal Error 2");
 }

 exit;
}

# removing the rtpproxy session
if(is_method("CANCEL|BYE"))
{
 rtpengine_delete();
}

    # try to send the request on its way, if it fails send back a
    # stateless error to the requestor
    if (t_relay())
    {
        xlog("L_INFO", "$ci|pass|$rd:$rp");
    }
    else
    {
        xlog("L_ERR", "$ci|end|unable to relay message");

        sl_reply_error();
    }


}

___
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] Fwd: Opensips SNGTC Module

2019-04-22 Thread Liviu Chircu

Hi Angel,

Sorry for missing out on this one -- the sngtc_server daemon should be 
aware of all cards present on the network (IIRC, it auto-detects them).  
Similarly, the sngtc library and OpenSIPS module will auto-detect 
sngtc_server and make requests to it.


It may sound like too good to be true, but it's how it actually works -- 
that's how I developed/tested the module in the first place.


Liviu Chircu
OpenSIPS Developer
http://www.opensips-solutions.com

On 05.04.2019 20:15, Angel Fernández Sánchez wrote:



Hello all,

I'm trying to test the SNGTC module.
I have setup an installation of opensips in a machine and a sngtc 
server in the same machine, in port 9000 with a sangoma D150 
configured in it which is connected to the same LAN via ethernet port.


I get no clear idea about how to specify to sngtc module how to 
connect to the sngtc server. ¿Should I hardcode server data in the 
library and compile?


Could you help me with this test configuration?

Best regards.

___
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