Re: [OpenSIPS-Users] Fwd: Opensips as outbound proxy to Freeswitch

2016-02-05 Thread Bogdan-Andrei Iancu

Hi David,

Between 1 and 2, you need to decide what should be the relation between 
opensips and freeswitch.


If you consider opensips "serving" the SIP domain of FS (and have the 
aliasing), then you need to configure the logic for handling 
registrations into OpenSIPS - instead of locally processing the 
REGISTER's, it should simply forward them to FS. Also, all the calls 
targeting the served / local domains should be relayed to FS.


If you want opensips to see FS as an external entity (and consider the 
SIP domain of FS an something remote), you need to re-configure the call 
routing logic - to recognize the SIP domain used by FS and to accept to 
do relay for it (as a trusted peer).


Regards,

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

On 02.02.2016 10:44, David Wafula wrote:


-- Forwarded message --
From: *David Wafula* mailto:david...@gmail.com>>
Date: Tue, Feb 2, 2016 at 10:43 AM
Subject: Re: [OpenSIPS-Users] Opensips as outbound proxy to Freeswitch
To: Bogdan-Andrei Iancu mailto:bog...@opensips.org>>


Yes, the opensips.cfg was indeed  messed up. i was tinkering with it. 
Anyway, i regenerated a clean one, put in the the alias, and happily 
got registrations going through. And one way audio. Except that i 
think am missing the big picture.

My goal is to have Opensips front Freeswitch:

Client  <->  OpenSips  <-> Freeswitch


To act as outbound proxy at this stage. As i learn more about it, i 
hope to get into NATing, loadbalancing etc. Am afraid  i have not 
 succeeded in achieving this goal unfortunately, yet, though i think 
am very close. This is what i have done.


1. Added the alias as advised. The registrations fail. Then when i 
create  users in opensips, registration work perfectly, and one of the 
users can call the other. Except that in this case it appears all is 
happening in Opensips and freeswitch is not in the loop here. Infact, 
i verified, that obviously registrationds are done on Opensips and not 
freeswitch.


2. I removed the alias, deleted the users from opensips. This time the 
registrations goes through successfully onto freeswitch. Very happy, 
as this is what i want. But now obviously INVITES fail with 403   Rely 
forbidden.


It appears to me, there is more configuration that i must do, beyond 
setting alias, to get Opensips to act as outboundproxy to freeswitch. 
I need  registrations and calls to happen on Freeswitch, but via Opensips.


So after again searching the internet, i can  see that  may be 
something like dynamic routing  can be done 
(http://www.taitclarridge.com/techlog/2012/02/opensips-dynamic-routing.html), 
or i can see whole lot of other  way of doing it 
(http://www.opensips.org/Documentation/Tutorials-OpenSIPSFreeSwitchIntegration).


What is the recommended, possibly simplest way to do this: to get 
opensips proxy registrations, invites , messaging to freeswitch.


Many thanks.







On Mon, Feb 1, 2016 at 5:30 PM, Bogdan-Andrei Iancu 
mailto:bog...@opensips.org>> wrote:


David,

Your opensips cfg is bogus - the test for the presence of username
in RURI should not be done for a REGISTER requests (as they do not
have a username part).

Where have you taken the script from ? have you changed it by
yourself ?

Regards,

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

On 01.02.2016 15:06, David Wafula wrote:

Thank you Bogdan. Ok  i made the alias change, and now am getting
"Address Incomplete"  reply.  Please see the log below, am not
sure what could be now causing this:

REQUEST

02-01 14:58:53.144: I/System.out(14726): REGISTER
sip:192.168.0.46 SIP/2.0
02-01 14:58:53.144: I/System.out(14726): Via: SIP/2.0/UDP
10.0.1.175:30802;rport;branch=z9hG4bKPjGfzHRCN4S.QyGFhBBv9njI9Amj2oU7ko
02-01 14:58:53.144: I/System.out(14726): Route:

02-01 14:58:53.144: I/System.out(14726): Max-Forwards: 70
02-01 14:58:53.144: I/System.out(14726): From:
;tag=eNVm.45KTH3OkXAjSikua1cwsZ.XdeRE
02-01 14:58:53.144: I/System.out(14726): To: 
02-01 14:58:53.144: I/System.out(14726): Call-ID:
9TVBTDFtUPz05axr9qvyynhFWhJetb6m
02-01 14:58:53.144: I/System.out(14726): CSeq: 64838 REGISTER
02-01 14:58:53.144: I/System.out(14726): User-Agent: Pjsua2
Android 2.4.5
02-01 14:58:53.144: I/System.out(14726): Contact:

02-01 14:58:53.144: I/System.out(14726): Expires: 300
02-01 14:58:53.144: I/System.out(14726): Allow: PRACK, INVITE,
ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER,
MESSAGE, OPTIONS
02-01 14:58:53.144: I/System.out(14726): Content-Length: 0
02-01 14:58:53.144: I/System.out(14726):
02-01 14:58:53.144: I/System.out(14726): --end msg--

REPLY
=


02-01 14:58:53.585: I/System.out(14726): SIP/2.0 484 Address
Incomplete
02-01 14:58:53.585: I/System.out(14726): Via: SIP/2.

[OpenSIPS-Users] Fwd: Opensips as outbound proxy to Freeswitch

2016-02-02 Thread David Wafula
-- Forwarded message --
From: David Wafula 
Date: Tue, Feb 2, 2016 at 10:43 AM
Subject: Re: [OpenSIPS-Users] Opensips as outbound proxy to Freeswitch
To: Bogdan-Andrei Iancu 


Yes, the opensips.cfg was indeed  messed up. i was tinkering with it.
Anyway, i regenerated a clean one, put in the the alias, and happily got
registrations going through. And one way audio. Except that i think am
missing the big picture.
My goal is to have Opensips front Freeswitch:

Client  <->  OpenSips  <-> Freeswitch


To act as outbound proxy at this stage. As i learn more about it, i hope to
get into NATing, loadbalancing etc. Am afraid  i have not  succeeded in
achieving this goal unfortunately, yet, though i think am very close. This
is what i have done.

1. Added the alias as advised. The registrations fail. Then when i create
 users in opensips, registration work perfectly, and one of the users can
call the other. Except that in this case it appears all is happening in
Opensips and freeswitch is not in the loop here. Infact, i verified, that
obviously registrationds are done on Opensips and not freeswitch.

2. I removed the alias, deleted the users from opensips. This time the
registrations goes through successfully onto freeswitch. Very happy, as
this is what i want. But now obviously INVITES fail with 403   Rely
forbidden.

It appears to me, there is more configuration that i must do, beyond
setting alias, to get Opensips to act as outboundproxy to freeswitch. I
need  registrations and calls to happen on Freeswitch, but via Opensips.

So after again searching the internet, i can  see that  may be something
like dynamic routing  can be done (
http://www.taitclarridge.com/techlog/2012/02/opensips-dynamic-routing.html),
or i can see whole lot of other  way of doing it (
http://www.opensips.org/Documentation/Tutorials-OpenSIPSFreeSwitchIntegration
).

What is the recommended, possibly simplest way to do this: to get opensips
proxy registrations, invites , messaging to freeswitch.

Many thanks.







On Mon, Feb 1, 2016 at 5:30 PM, Bogdan-Andrei Iancu 
wrote:

> David,
>
> Your opensips cfg is bogus - the test for the presence of username in RURI
> should not be done for a REGISTER requests (as they do not have a username
> part).
>
> Where have you taken the script from ? have you changed it by yourself ?
>
> Regards,
>
> Bogdan-Andrei Iancu
> OpenSIPS Founder and Developerhttp://www.opensips-solutions.com
>
> On 01.02.2016 15:06, David Wafula wrote:
>
> Thank you Bogdan. Ok  i made the alias change, and now am getting "Address
> Incomplete"  reply.  Please see the log below, am not sure what could be
> now causing this:
>
> REQUEST
> 
> 02-01 14:58:53.144: I/System.out(14726): REGISTER sip:192.168.0.46 SIP/2.0
> 02-01 14:58:53.144: I/System.out(14726): Via: SIP/2.0/UDP 10.0.1.175:30802
> ;rport;branch=z9hG4bKPjGfzHRCN4S.QyGFhBBv9njI9Amj2oU7ko
> 02-01 14:58:53.144: I/System.out(14726): Route: 
> 02-01 14:58:53.144: I/System.out(14726): Max-Forwards: 70
> 02-01 14:58:53.144: I/System.out(14726): From:  >;tag=eNVm.45KTH3OkXAjSikua1cwsZ.XdeRE
> 02-01 14:58:53.144: I/System.out(14726): To: 
> 02-01 14:58:53.144: I/System.out(14726): Call-ID: 9
> TVBTDFtUPz05axr9qvyynhFWhJetb6m
> 02-01 14:58:53.144: I/System.out(14726): CSeq: 64838 REGISTER
> 02-01 14:58:53.144: I/System.out(14726): User-Agent: Pjsua2 Android 2.4.5
> 02-01 14:58:53.144: I/System.out(14726): Contact:  34708;ob>
> 02-01 14:58:53.144: I/System.out(14726): Expires: 300
> 02-01 14:58:53.144: I/System.out(14726): Allow: PRACK, INVITE, ACK, BYE,
> CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
> 02-01 14:58:53.144: I/System.out(14726): Content-Length:  0
> 02-01 14:58:53.144: I/System.out(14726):
> 02-01 14:58:53.144: I/System.out(14726): --end msg--
>
> REPLY
> =
>
>
> 02-01 14:58:53.585: I/System.out(14726): SIP/2.0 484 Address Incomplete
> 02-01 14:58:53.585: I/System.out(14726): Via: SIP/2.0/UDP 10.0.1.175:30802
> ;received=10.0.1.175;rport=30802
> ;branch=z9hG4bKPjGfzHRCN4S.QyGFhBBv9njI9Amj2oU7ko
> 02-01 14:58:53.585: I/System.out(14726): From:  >;tag=eNVm.45KTH3OkXAjSikua1cwsZ.XdeRE
> 02-01 14:58:53.585: I/System.out(14726): To:  >;tag=a0a925d2eca49498ea7382b7b1f63f38.d365
> 02-01 14:58:53.585: I/System.out(14726): Call-ID: 9
> TVBTDFtUPz05axr9qvyynhFWhJetb6m
> 02-01 14:58:53.585: I/System.out(14726): CSeq: 64838 REGISTER
> 02-01 14:58:53.585: I/System.out(14726): Server: OpenSIPS (2.1.2
> (x86_64/linux))
> 02-01 14:58:53.585: I/System.out(14726): Content-Length: 0
>
> On Mon, Feb 1, 2016 at 1:07 PM, Bogdan-Andrei Iancu <
> bog...@opensips.org> wrote:
>
>> Hi David,
>>
>> I see. The problem is all the SIP traffic contains references to this 
>> 192.168.0.46,
>> but opensips has no idea how to handle consider this IP (like local or
>> foreign domain).
>>
>> It should handle it as local domain, so add in your cfg:
>> alias="192.168.0.46"
>>
>> Regards,
>>
>> Bogdan-Andrei Iancu
>> OpenSIPS Founder and D