[SR-Users] Routing calls to Asterisk using dispatch

2014-07-12 Thread Olli Heiskanen
Hello,

I've started playing with an idea to add multiple asterisk servers and
using dispatcher to balance the sip load between them. I added the code
according to dispatcher module documentation (
http://www.kamailio.org/docs/modules/4.2.x/modules/dispatcher.html), but I
think there's something off in my setup:

kamctl ul output shows 2 AORs for one client:

AOR:: 7...@testers.com
Contact:: sip:770@2.2.2.2:64340;rinstance=c634da314e12385f;transport=UDP Q=
Expires:: 3221
Callid:: ZTE1MWYwYzM3NGNjNjMxMmEzM2JjYWNmNzQyZTdiNGI.
Cseq:: 2
User-agent:: Z 3.2.21357 r21367
State:: CS_SYNC
Flags:: 0
Cflag:: 0
Socket:: udp:1.1.1.1:5060
Methods:: 5087
Ruid:: uloc-53bfe447-35ae-2a2
Reg-Id:: 0
Last-Keepalive:: 1405174150
Last-Modified:: 1405174150
AOR:: 770@1.1.1.1
Contact:: sip:770@1.1.1.1:5070 Q=
Expires:: 68
Callid:: 327fcf07641f80006e962821112a6...@testers.com
Cseq:: 754
User-agent:: Asterisk PBX 11.10.2
State:: CS_SYNC
Flags:: 0
Cflag:: 0
Socket:: udp:1.1.1.1:5060
Methods:: 4294967295
Ruid:: uloc-53bfe447-35af-a82
Reg-Id:: 0
Last-Keepalive:: 1405174477
Last-Modified:: 1405174477


I don't think I should be seeing an AOR for 770 where Contact is the public
address of my server (here 1.1.1.1) and User-Agent which is Asterisk.

I'm using Asterisk Realtime integration, and by what I can tell the sip
messages are going nicely, client authenticates with Kamailio and sends
this message to Asterisk (which is on the same machine; Kamailio at 5060
and Asterisk at 5070):

1.1.1.1.sip  1.1.1.1.vtsas: SIP, length: 374
REGISTER sip:1.1.1.1:5070 SIP/2.0
Via: SIP/2.0/UDP
1.1.1.1;branch=z9hG4bKbc8a.f4473947.0
To: sip:770@1.1.1.1
From: sip:770@1.1.1.1;tag=4a9c3f1c98b9f1c5704acfd1770d93d2-d0c1
CSeq: 10 REGISTER
Call-ID: 7ffa0191-13742@1.1.1.1
Max-Forwards: 70
Content-Length: 0
Contact: sip:770@1.1.1.1:5060
Expires: 3600


Currently I can make calls from 770 to 123 which is an Asterisk extension
that answers, plays hello world and hangs up. However I can't call another
sip clients when I route calls through Asterisk, they do work fine if I
don't use Asterisk for handling calls, but I'd like Kamailio to be in the
role of proxy/loadbalancer and Asterisk to handle calls.

My config is the simple default config, added with realtime stuff and then
dispatcher according to the documentation. I wonder if there's something
wrong in the REGISTER that Kamailio sends to Asterisk, or maybe something
else going wrong?

Has anyone seen results like this and do you spot something here that needs
fixing?

Thanks,
Olli
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Unknown caller gets online user's identity

2014-07-12 Thread Muhammad Shahzad
Well, this

*if (from_uri!=myself  uri!=myself)*

Means neither source nor destination is our user. Which implies that if our
domain is A, then call from domain B to C is not possible. However, calls
from B or C to A and A to B or C are possible. That is way an
unauthorized user gets passed and reaches asterisk. Asterisk accepts it
since call is coming from kamailio and tries to route it back to kamailio,
where kamailio finds user online and thus it goes through.

You should really break down this,

*if (from_uri!=myself  uri!=myself)*

into something like this for clarity,


*if (from_uri!=myself) { *
*   if (uri!=myself) {*
*   # neither source nor destination is our user*
*   } else {*
*   # source is not our user but destination is our user*
*   };*
*} else {*
*   if (uri!=myself) {*
*   # source is our user but destination is not our user*
*   } else {*
*  # both source and destination are our users*
*   };*
*};*

Hope this helps.

Thank you.




On Fri, Jul 11, 2014 at 5:36 PM, g.aloi...@gmail.com wrote:

 Hello,

 I'm using Kamailio version 4.1.4+precise (amd64).

 I have followed Kamailio 4.0.x and Asterisk 11.3.0 Realtime Integration
 using Asterisk Database (http://kb.asipto.com/
 asterisk:realtime:kamailio-4.0.x-asterisk-11.3.0-astdb). One main
 difference in my setup compared to that one is that I continued use of
 Kamailio's database.

 The problem is as follows:

 I decided to put Kamailio and through it Asterisk reachable from internet.
 I have tried to configure Asterisk so that only calls of registered users
 would be possible, and they could only call to other registered users or
 conference rooms and echo test number.

 Then I took the following steps:

 I ensured that there was no online users with kamctl online. Then I
 launched MicroSIP (www.microsip.org), but I did not defined account, I
 simply set the protocol to tls and media encryption to mandatory, because
 I'm using these.

 I called to extension with x...@my.public.ip.address (where xxx is
 extension) getting unauthorized. And that was what I wanted.

 But if there is online users, calls go through, and incoming call is
 coming from Asterisk (in syslog I can find out that src_user=asterisk).

 Kamailio and Asterisk are listening the same IP address, but different
 port. I have refused connections to the Asterisk's port with iptables.

 I have defined my public IP address as domain in sip.conf. There is also
 other domain defined which corresponds to users' domain I am using in
 Kamailio's database.

 In kamailio.cfg there is if statement which prevents Kamailio not to be
 open relay:

 if (from_uri!=myself  uri!=myself)
 ...

 If I change this for example:

 if (from_uri!=myself || uri!=myself)

 I get what I want this time: no calls from outside, but I somewhat think
 that this is not a final solution.

 I have not found from log files such information which would have helped
 me. I have not yet investigated this problem so much that I could tell the
 logic behind the selection of online user's identity which is used.
 However, if I make a call to conference room I notice that Asterisk is
 thinking that one of online users has joined the conference.

 If I can recall correctly, I started with Kamailio version 3.2, and
 integrated it with Asterisk 11 (currently 11.10.2). Is there something
 which has changed in Kamailio, but what I have not changed in my setup
 which could explain this.

 Best,

 Teijo

 ___
 SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
 sr-users@lists.sip-router.org
 http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Groups in Kamailio vs Freeswitch

2014-07-12 Thread Peter Villeneuve
Hi guys,

I'm designing a new service for a client and I was wondering what your
opinion is of the 2 options I'm considering to separate users on the
server. Basically I want to create closed groups where each user can only
call and receive calls from members of the same group (single  domain
install).
Initially I was thinking of just forwarding all the invites to FS and using
the dialplan to enforce this segregation, but now I realize there is a
groups module in kamailio too.

Which 2 courses of action do people recommend? I'm more familiar with FS
than Kamailio, so it would be easier for me to just forward everything to
FS, although that will be more expensive and probably unnecessary if I
could do it all in Kamailio with Siremis.

Would kamailio's group module do the trick? Are there any tutorials out
there I can follow?

Cheers,

Peter
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Rtpengine vs. TURN?

2014-07-12 Thread Peter Villeneuve
Hi,

On my server, I have the option of using either Rtpengine for NAT traversal
or pure TURN without rtpengine.
Rtpengine has the obvious plus that it only needs 1 public IP, while TURN
(with STUN) will need 2 public IPs, although that's not a problem in my
case.

Having said that, I'd like to take advantage of the huge experience that
users of this list have in real world deployments. in your experience,
which option is more reliable in a real world deployment?

Cheers,
Peter
___
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users