Re: [OpenSIPS-Users] OpenSips as simple frontend to Asterisk to deal with NAT

2014-02-18 Thread Bogdan-Andrei Iancu

Hello,

yes, you can do all of those with OpenSIPS  - it is just a matter of 
scripting logic and using the one of the nat handling modules:
nathelper - 
http://www.opensips.org/html/docs/modules/1.10.x/nathelper.html
nat_traversal - 
http://www.opensips.org/html/docs/modules/1.10.x/nat_traversal.html


Both modules will help you with mangling the SIP messages and with doing 
SIP pinging.


Regards,

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

On 18.02.2014 12:57, Rudy Eschauzier wrote:

My Asterisk appliance works poorly with NATed clients. Now I'd like to run 
OpenSips on my internet-facing router to help the NAT performance. Although I 
understand that OpenSips is the preferred choice for registrating clients, the 
fact that the Asterisk appliance is a closed box forces me to find an 
alternative.

What I would like is the following:

-Run OpenSips on the router
-Have OpenSips act as a stateless proxy, only forwarding and mangling messages
-Handle all registration requests on the Asterisk box
-Make sure NATed clients can be are kept alive & can be reached
-Avoid OpenSips database use (not to overload the router)
-Not use a RTP proxy (the public RTP ports can be forwarded to Asterisk, so 
clients can talk directly to the PBX)

This way, from a user perspective nothing will change in the setup, except that 
OpenSips takes care of NAT.

Is this at all possible?




___
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] CDRTool - Rating Origination and Termination differently

2014-02-18 Thread Tijmen de Mes
Hi All,

Already sent it to David  in private, but will post it here to be complete.

We have trouble with the patch for call control. We get:

Feb 18 12:51:09 node04 call-control[19257]: error: 'Request' object has no 
attribute ‘application'

I looked into in and the call_control module of OpenSIPS seems to be not 
passing the application type. So is this module also patched ?  

-- 
Tijmen de Mes
AG-Projects

On 12 februari 2014 at 21:05:32, David M. Lee (d...@digium.com) wrote:

For everyone following along at home:

I’ve updated my CDRTool patch (again) to fix MaxSessionTime and ShowPrice 
commands, and fix some minor issues that cropped up with DebitBalance.

CDRTool patch - https://gist.github.com/leedm777/8585690

I’ve also discovered that the call_control daemon also needs to be patched to 
pass through the SIP Application Type from the call_control module onto the 
CDRTool prepaid engine.

callcontrol patch - https://gist.github.com/leedm777/8926025

I’ll be sending both patches to de...@ag-projects.com. Feedback welcome on both!

-- 
David M. Lee
Digium, Inc. | Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at:  www.digium.com  & www.asterisk.org

On Feb 6, 2014, at 9:29 AM, David M. Lee  wrote:

I figured that out. I’ve updated the patch on my gist, and updated the rating 
doc to include a description of how the subtypes work.

I’m sending the patch to de...@ag-projects.com now.

Thanks!
-- 
David M. Lee
Digium, Inc. | Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at:  www.digium.com  & www.asterisk.org

On Jan 28, 2014, at 6:12 AM, Tijmen de Mes  wrote:

Hi,

I run into trouble and reversed the patch. In the rating engine (telnet) 
DebitBalance function does not return anything anymore with the patch applied, 
so something goes wrong.

-- 
Tijmen de Mes
AG-Projects

On 27 januari 2014 at 17:55:01, Tijmen de Mes (tij...@ag-projects.com) wrote:

Hi

I tested the patch and for now I don’t see any problem with it. Before adding 
it to trunk, can you update the rating docs and record all changes in 1 patch 
using darcs? After that I can apply it directly on trunk with your credentials.

These instructions to submit the patch also apply on CDRTool:

http://sipsimpleclient.org/projects/sipsimpleclient/wiki/SipSupport

You don’t need to open a ticket however, just tell me after you send the patch.
 
-- 
Tijmen de Mes
AG-Projects

On 26 januari 2014 at 02:08:50, Duane Larson (duane.lar...@gmail.com) wrote:

Ugh Nevermind.  My "Max Duration" was set to 6 on the Destinations rate 
setup.  I set it to zero and I think things are looking better now.  Think I'm 
done for the day.  Good work David!  Really appreciate the patch.


On Sat, Jan 25, 2014 at 6:56 PM, Duane Larson  wrote:
Not sure my "price" is being calculated correctly.

My audio.outbound should be $0.005
My audio.inbound should be $0.0035

Here is an example of a call that lasted 2:06 minutes and is audio.outbound
Increment=6 MinDuration=6 MaxDuration=6 ConnectFee=0. 
CallId=dc1e32b1ba18ff91a3
67aa8df81e8e3c@0:0:0:0:0:0:0:0 Span=1 Duration=6 DestId=1 default 
Profile=USA_Default Period=weekend Rate=USA_Default Interval=0-24 Cos
t=0.0050/60 Price=0.0005 PriceIn=0.

Here is an example of a call that lasted 1:33 minutes and is audio.inbound
Increment=6 MinDuration=6 MaxDuration=6 ConnectFee=0. 
CallId=2e0334513a34964e7c0
a18cd3be449dd@108.166.97.17:5060 Span=1 Duration=6 DestId=1 default 
Profile=USA_Default Period=weekend Rate=USA_Default Interval=0-24 C
ost=0.0035/60 Price=0.0003 PriceIn=0.

Looks like no matter what the duration is for the inbound calls it costs 
$0.0003 and the outbound calls all cost $0.0005.




On Sat, Jan 25, 2014 at 6:24 PM, Duane Larson  wrote:
David/Tijmen/Adrian,

It is working for me too.  Both inbound and outbound are being recognized and 
the different rates are being applied.  I will keep looking at it while more 
calls are being made to make sure there are no unforeseen issues. 


On Fri, Jan 24, 2014 at 5:35 AM, Tijmen de Mes  wrote:
Hi David,

Thanks for the patch. If have some time Monday I will analyze it and give you 
some feedback so we include this in CDRTool.

Besides the rating, I’ve to check if the code that now sets the the ‘route’ for 
the CDRs and if there are no problems.

  
-- 
Tijmen de Mes
AG-Projects

On 23 januari 2014 at 21:21:26, David M. Lee (d...@digium.com) wrote:

I’ve got a first attempt at a patch:
https://gist.github.com/leedm777/8585690

To get this to work, your CDR’s will have to record the application
subtype. For me, I set $avp(s:call_class) = “audio.inbound” or
“audio.outbound” as appropriate in the routes, and added
Sip-Application-Type=$avp(s:call_class) to “radius_extra”.

Billing rates will be matched on the full application, allowing
different rates depending on the application subtype.

It works with the simple testing I’ve been able to do on my desktop.
Feedback, of course, is gr

[OpenSIPS-Users] OpenSips as simple frontend to Asterisk to deal with NAT

2014-02-18 Thread Rudy Eschauzier
My Asterisk appliance works poorly with NATed clients. Now I'd like to run 
OpenSips on my internet-facing router to help the NAT performance. Although I 
understand that OpenSips is the preferred choice for registrating clients, the 
fact that the Asterisk appliance is a closed box forces me to find an 
alternative.

What I would like is the following:

-Run OpenSips on the router
-Have OpenSips act as a stateless proxy, only forwarding and mangling messages
-Handle all registration requests on the Asterisk box
-Make sure NATed clients can be are kept alive & can be reached
-Avoid OpenSips database use (not to overload the router)
-Not use a RTP proxy (the public RTP ports can be forwarded to Asterisk, so 
clients can talk directly to the PBX)

This way, from a user perspective nothing will change in the setup, except that 
OpenSips takes care of NAT.

Is this at all possible?




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


Re: [OpenSIPS-Users] Pre-load different routes after DNS NAPTR/SRV lookup

2014-02-18 Thread Bogdan-Andrei Iancu

Hello Leon,

The branch route is specially design to map over the SIP branch concept 
- still you are looking for something lower (almost network level)  - in 
branch route, the destination is still a SIP URI, you do not know yet 
the IP behind it; the DNS lookup is done after branch route.


If we invent a new type of route to be triggered after DNS lookup, it 
will be difficult to allow changes over the RURI, as you may change 
again the destination (the domain part). But I'm open to any suggestion 
on finding a solution for this - the second instance solution is a bit 
ugly, I have to admit.


Regards,

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

On 18.02.2014 10:24, Leon de Rooij wrote:

Hi Bogdan,

Alright, that's clear. I was hoping to get the information from the 
branch_route[]. A second instance did cross my mind but I don't want 
to make it overly complex :)


Thanks & best regards,

Leon


On Mon, Feb 17, 2014 at 10:38 PM, Bogdan-Andrei Iancu 
mailto:bog...@opensips.org>> wrote:


Hello,

The DNS lookups and the serial forking is transparently done for
the script. What I mean is, from script level, you will not see
what "foo.bar.com " is resolved to (as IPs);
neither when the next IP is tried.  There is no type of route to
give you access to the requests at that time in the routing
process (the outbound edge).

Have you consider having a second instance of OpenSIPS (as
outbound proxy, after the one doing the DNS) to see the
destination IP and do the prefixing or so ?

Regards,

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

On 17.02.2014 22:21, Leon de Rooij wrote:

Hi Bogdan,

Thanks for your answer, the automatic failover is clear, but I'd
like to achieve something extra, namely:

* I set the RURI domain-part to foo.bar.com 
* After t_relay() OpenSIPS resolves (NAPTR) it to
_sip._udp.bar.com  and after that (SRV) to
gw1.bar.com  (prio 1) and after that (A) to
1.1.1.1
* Now when this 1.1.1.1 is found I'd like to look it up in a
database and for example see that all hosts within 1.0.0.0/8
 should have a preloaded route-set X, and add
the appropriate route header(s)
* Let's say this 1.1.1.1 is down, then OpenSIPS will do a second
lookup (or is lookup done only once and are all possible records
saved in some AVP?), but anyway, let say it does a second lookup,
which resolves to 2.2.2.2 (prio 2), then I'd like to lookup that
IP in my db and maybe preload some other routes.

Is this possible ?

Thanks & best regards,

Leon de Rooij


On Mon, Feb 17, 2014 at 7:35 PM, Bogdan-Andrei Iancu
mailto:bog...@opensips.org>> wrote:

Hello,

OpenSIPS automatically does DNS-based failover (using the
NATPR, SRV and A records for the domain) - there is not need
to do it manually from script. Using the same principal
(serial forking), transparent for you, OpenSIPS TM module
will do it for you.

See the "disable_dns_failover" param -
http://www.opensips.org/Documentation/Script-CoreParameters-1-10#toc39

Regards,

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

On 14.02.2014 17:37, Leon de Rooij wrote:

Hi all,

I'd like to route a call to a domain, perform NAPTR,SRV,A
lookups and in each serial failure_route, use the resolved
destination IP to set a custom pre-loaded route.

I've been trying to fix it like this:

* put fqdn in ruri
* t_on_failure("1")
* t_on_branch("1")
* t_relay()

Should I then be able to get the resolved destination IP
address in the branch_route[1] ? How should I then get the
second, third, etc ip adress ? I tried to put another
t_on_branch("1") in the failure_route but that results in an

ERROR:tm:t_forward_nonack: failure to add branches

Anybody know how this should work ?

Thanks & best regards,

Leon de Rooij


___
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] OpenSIPS CP Dialplan Edit

2014-02-18 Thread James Palic
Using OpenSIPS Control Panel 5.0, I am unable to edit entries made in
the dialplan module.  Adding works fine.  Clicking the pencil icon to
edit and then saving results in losing any text in the matching
expression, substitution expression and replacement expression fields.
(Bogdan this issue was identified during the OpenSIPS eBootcamp that
began Nov 2013)

 

In dialplan.php (dated 2011-10-20), after if ($action=="modify") (line
253) there are three instances where the PHP function
my_real_escape_string is used.  Line 289 processes $match_exp, line 317
is $subst_exp and line 319 is $repl_exp.  

 

In each instance, the format is:  mysql_real_escape_string( $var,
$link).  This function (in my case) seems to always return an empty
string thus explaining why saving loses the value of these three
variables.  If the function is called without the $link parameter:
mysql_real_escape_string( $var ) then the return value is not an empty
string and the values are retained.

 

When I add a debug statement to see what the value of the $link variable
is I get: MDB2_Driver_mysql: (phptype = mysql, dbsyntax = mysql)
[connected] .  I don't know enough about how PHP is connecting to the
database to say whether or not this is the problem but not using $link
results in the edits saving as expected.  

 

Jim

 

 

 

 

 

 

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


Re: [OpenSIPS-Users] Adjusting Headers

2014-02-18 Thread Muhammad Shahzad
TO header contains DNIS, so be careful when editing it. Anyways, the
easiest way is to use textops module,

http://www.opensips.org/html/docs/modules/1.10.x/textops.html#id249986

You can also use uac module, (recommended)

http://www.opensips.org/html/docs/modules/1.10.x/uac.html#id250102

Thank you.




On Thu, Feb 6, 2014 at 1:38 AM, Alectronic wrote:

> Hi All,
> Thanks my device is now able to register with other device.
>
> However I now have another problem which is the other end does not trying
> to
> authenticate when I send an Invite (It just hang there) I have compared a
> trace call of a freepbx and a SIP phone over wireshark connecting to the
> other endpoint and it would seem I need to manipulate the header so that
> the To header is that of the register IP/domain.
>
> What would it take to be able to do this manipulation?
>
> Thanks
>
> Alec
>
>
>
> --
> View this message in context:
> http://opensips-open-sip-server.1449251.n2.nabble.com/no-subject-tp7589434p7589472.html
> Sent from the OpenSIPS - Users mailing list archive at Nabble.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