[OpenSIPS-Users] Running OpenSIPS on same box as Asterisk/FreeSwitch

John Quick john.quick at smartvox.co.uk
Tue May 19 07:55:08 EST 2020


Hi James and others,

James, I have provided some explanation and guidance specific to you at the end of this post. First, I need to retract some of the explanation I gave in my original post because it was wrong. The basic problem is as described - handling of loose routed sequential requests goes wrong when OpenSIPS is running on the same host server as Asterisk or FreeSwitch, using the same IP but different ports.

I think the correct explanation for what is happening is this: 
Where the address in the R-URI is the same as its local address, OpenSIPS copies the URI (and parameters) from a Route header to the R-URI which, in this use-case, causes the request to loop back to itself. It should instead delete the two Route headers and leave the original R-URI value unchanged.

James, what you describe is not identical to my issue, although you may have my issue plus another.
It should be fairly easy for you to fix the problem of private LAN addresses being used where you want external IP's to be used.
OpenSIPS handles this issue through the "advertised address". This allows it to listen on one interface, but to populate SIP headers such as Via and Record-Route with another.
Various mechanisms are available to add to your script including the following:
1) Define it for each interface in the listen statement: e.g.  listen = tls:10.x.x.x:5091 as <External IP>:5091
2) Global settings at the top of your script:  advertised_address and advertised_port
3) Within the main body of your script, e.g. just before the call to record_route(), insert a line like: set_advertised_address(<External IP>);
4) Instead of calling record_route(), call record_route_preset(<address1:port>,<address2:port>); 
The first two are described in the section called 'Global Parameters' in the documentation
The third one is described in 'Core Functions' (In v2.4, they are items 45 and 46)
The fourth is documented in the RR module notes

John Quick
Smartvox Limited


> From: James Hogbin <james at ip-sentinel.com> 
> Sent: 18 May 2020 17:24
> To: john quick <john.quick at smartvox.co.uk>; OpenSIPS users mailling list <users at lists.opensips.org>
> Subject: Re: [OpenSIPS-Users] Running OpenSIPS on same box as Asterisk/FreeSwitch
>
> I thought I had just done some bad config. I have almost exactly the same thing.
>
> I have Freeswitch And Opensips on Azure VM’s
>
> Freeswitch = 10.0.0.4 + External IP
> Opensips = 10.0.0.5 + External IP
>
> Both are configured to use the external addresses
>
> Freeswitch will start the conversation on its external Gateway IP address with the Opensips external IP address
>
> However the moment I put the Record_Route in the message to Teams Freeswitch starts using the local 10.x.x.x. address on opensips rather than the external address for ACK and BYE which rogers the whole thing up.
>
> I’m sure there is probably some way to fix it in the opensips plan as the dialog/transaction ID’s are still there but it’s beyond me.
>
> James
> James Hogbin 
> Director 




More information about the Users mailing list