Discussion:
[SR-Users] Kamailio - Separated Servers
Bruno Emer
2014-09-17 12:13:03 UTC
Permalink
Hello!

I am relatively new to Kamailio and I'm trying to create a new enviroment
using it in my company. I am thinking about use Amazon to host the servers
and use OpsWorks to automatically escalate then if necessary. To accomplish
this, my idea is to separate the servers, using one dedicated server to run
as WebSocket, one to run as proxy and one as a Registrar. I'll be using
just one database to store informations to all of my servers. With this, if
I need more resources later, I can just create new servers with the
specific roles (WebSockets, Proxy, Registrar).

By now, the idea is clear, but the point is that I don't know how to
separate the WebSockets server from the proxy server. Actually, I can do
this, but when I have one agent using a regular softphone and one agent
using WebSockets (with JSSIP) they are not able to establish a session if
the softphone user starts it. Now, I want to know if is there a way to use
two websockets servers, register users using both of then and start
sessions between then, with a separated proxy and registrar.

Has anyone done this before? Is possible to use kamailio like this?


Thanks.



*Bruno Emer*

Mobile: +55 11 96540-0044
email: brunoemer-***@public.gmane.org
<https://www.facebook.com/bruno.emer.5>
<https://www.linkedin.com/profile/view?id=86461237&trk=spm_pic>
<https://twitter.com/brunoemer_>
<https://www.flickr.com/photos/***@N03/>
<http://google.com/+BrunoEmer> <http://instagram.com/brunoemer_>
Frank Carmickle
2014-09-17 15:50:15 UTC
Permalink
Post by Bruno Emer
Hello!
I am relatively new to Kamailio and I'm trying to create a new enviroment using it in my company. I am thinking about use Amazon to host the servers and use OpsWorks to automatically escalate then if necessary. To accomplish this, my idea is to separate the servers, using one dedicated server to run as WebSocket, one to run as proxy and one as a Registrar. I'll be using just one database to store informations to all of my servers. With this, if I need more resources later, I can just create new servers with the specific roles (WebSockets, Proxy, Registrar).
By now, the idea is clear, but the point is that I don't know how to separate the WebSockets server from the proxy server. Actually, I can do this, but when I have one agent using a regular softphone and one agent using WebSockets (with JSSIP) they are not able to establish a session if the softphone user starts it. Now, I want to know if is there a way to use two websockets servers, register users using both of then and start sessions between then, with a separated proxy and registrar.
Has anyone done this before? Is possible to use kamailio like this?
Most things are possible. There are a few questions you'll want to ask. How reliable does this need to be? How many endpoints and of which type, sip or webrtc?

You mention that you have something half working, calls can go one direction. You didn't talk about rtp here. How do you want to handle relaying rtp or will that not be needed and why do you think so?

Kamailio is very reliable and can scale vertically before needing to scale horizontally. If you have a small number of clients say less than thousands, I wouldn't bother separating the different functions except for what you need to give you redundancy which isn't happening in the system you describe.

Collocating all functions on two servers is a good way to start. You would use srv records for both sip and webrtc endpoints to load balance and failover. The complexity is quite high for a setup like this so one server may offer you enough availability for a time and that time might even be counted in months or years.

--FC
Bruno Emer
2014-09-18 15:12:19 UTC
Permalink
Hello!

I am relatively new to Kamailio and I'm trying to create a new enviroment
using it in my company. I am thinking about use Amazon to host the servers
and use OpsWorks to automatically escalate then if necessary. To accomplish
this, my idea is to separate the servers, using one dedicated server to run
as WebSocket, one to run as proxy and one as a Registrar. I'll be using
just one database to store informations to all of my servers. With this, if
I need more resources later, I can just create new servers with the
specific roles (WebSockets, Proxy, Registrar).

By now, the idea is clear, but the point is that I don't know how to
separate the WebSockets server from the proxy server. Actually, I can do
this, but when I have one agent using a regular softphone and one agent
using WebSockets (with JSSIP) they are not able to establish a session if
the softphone user starts it. Now, I want to know if is there a way to use
two websockets servers, register users using both of then and start
sessions between then, with a separated proxy and registrar.

Has anyone done this before? Is possible to use kamailio like this?


Thanks.

Bruno Emer
Daniel-Constantin Mierla
2014-09-18 15:32:18 UTC
Permalink
Hello,
Post by Bruno Emer
Hello!
I am relatively new to Kamailio and I'm trying to create a new
enviroment using it in my company. I am thinking about use Amazon to
host the servers and use OpsWorks to automatically escalate then if
necessary. To accomplish this, my idea is to separate the servers,
using one dedicated server to run as WebSocket, one to run as proxy
and one as a Registrar. I'll be using just one database to store
informations to all of my servers. With this, if I need more resources
later, I can just create new servers with the specific roles
(WebSockets, Proxy, Registrar).
you must have in mind that you need to route between these servers as
well or share the data between them. However, sometime sharing registrar
data is not going to work if you have devices behind symmetric nat. In
the same situation, the proxy has to stay behind the registrar, so it
might be better not to split them, but keep one instance. Or, add an
edge proxy in front of registrar and proxy. That is because of very
restrictive rules with symmetric nat, where the node on public internet
can communicate with the node behind nat only if it has received a
packet from it.
Post by Bruno Emer
By now, the idea is clear, but the point is that I don't know how to
separate the WebSockets server from the proxy server. Actually, I can
do this, but when I have one agent using a regular softphone and one
agent using WebSockets (with JSSIP) they are not able to establish a
session if the softphone user starts it.
This seems to be a problem in your config, this case should be easy to
handle.

A bit more complex will be when the calls comes from webrtc and you
don't know if it is going to return back to webrtc. See the recent
discussion on this mailing list with the subject "NO_DTLS_FINGERPRINT
when calling from webrtc to webrtc client".

Cheers,
Daniel
Post by Bruno Emer
Now, I want to know if is there a way to use two websockets servers,
register users using both of then and start sessions between then,
with a separated proxy and registrar.
Has anyone done this before? Is possible to use kamailio like this?
Thanks.
Bruno Emer
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany
Bruno Emer
2014-09-18 21:04:07 UTC
Permalink
Ok, Daniel!

I am trying exactly what you said, but for some reason the proxy server
can't forward the message back to the WebSocket server. I am getting
"487 Unresolvable destination". Appears that my Proxy Server can't get data
from usrloc.

When I register an user using WebRTC I can see that the system stores the
information in kamailio database and in the field "contact" it puts a
string. The Proxy server is looking in database and just find this
information. Actually, I'm trying to understand the entire process that
envolves passing information from an Edge Server to a Proxy server that
sends the Register information to another Registrar server (as I described
before). The database is shared between all the servers, and they are in
the same network.

I just read the information in another topic, as you said, but I think that
my case is a lil bit different from it. I you agree, I can post my
configuration files here. Maybe this can help another users with the same
problem!

Thanks again!!!



*Bruno Emer*

Mobile: +55 11 96540-0044
email: brunoemer-***@public.gmane.org
<https://www.facebook.com/bruno.emer.5>
<https://www.linkedin.com/profile/view?id=86461237&trk=spm_pic>
<https://twitter.com/brunoemer_>
<https://www.flickr.com/photos/***@N03/>
<http://google.com/+BrunoEmer> <http://instagram.com/brunoemer_>
Post by Bruno Emer
Hello!
I am relatively new to Kamailio and I'm trying to create a new enviroment
using it in my company. I am thinking about use Amazon to host the servers
and use OpsWorks to automatically escalate then if necessary. To accomplish
this, my idea is to separate the servers, using one dedicated server to run
as WebSocket, one to run as proxy and one as a Registrar. I'll be using
just one database to store informations to all of my servers. With this, if
I need more resources later, I can just create new servers with the
specific roles (WebSockets, Proxy, Registrar).
By now, the idea is clear, but the point is that I don't know how to
separate the WebSockets server from the proxy server. Actually, I can do
this, but when I have one agent using a regular softphone and one agent
using WebSockets (with JSSIP) they are not able to establish a session if
the softphone user starts it. Now, I want to know if is there a way to use
two websockets servers, register users using both of then and start
sessions between then, with a separated proxy and registrar.
Has anyone done this before? Is possible to use kamailio like this?
Thanks.
*Bruno Emer*
Mobile: +55 11 96540-0044
<https://www.facebook.com/bruno.emer.5>
<https://www.linkedin.com/profile/view?id=86461237&trk=spm_pic>
<https://twitter.com/brunoemer_>
<http://google.com/+BrunoEmer> <http://instagram.com/brunoemer_>
Daniel-Constantin Mierla
2014-09-19 13:43:34 UTC
Permalink
You need to add path with received on the websocket server between
browser and register. Also, on the websocket server you need to do
processing as for nat traversal.

Cheers,
Daniel
Post by Bruno Emer
Ok, Daniel!
I am trying exactly what you said, but for some reason the proxy
server can't forward the message back to the WebSocket server. I am
getting "487 Unresolvable destination". Appears that my Proxy Server
can't get data from usrloc.
When I register an user using WebRTC I can see that the system stores
the information in kamailio database and in the field "contact" it
puts a string. The Proxy server is looking in database and just find
this information. Actually, I'm trying to understand the entire
process that envolves passing information from an Edge Server to a
Proxy server that sends the Register information to another Registrar
server (as I described before). The database is shared between all the
servers, and they are in the same network.
I just read the information in another topic, as you said, but I think
that my case is a lil bit different from it. I you agree, I can post
my configuration files here. Maybe this can help another users with
the same problem!
Thanks again!!!
*_
_*
*_
_*
*_Bruno Emer_*
Mobile: +55 11 96540-0044
Hello!
I am relatively new to Kamailio and I'm trying to create a new
enviroment using it in my company. I am thinking about use Amazon
to host the servers and use OpsWorks to automatically escalate
then if necessary. To accomplish this, my idea is to separate the
servers, using one dedicated server to run as WebSocket, one to
run as proxy and one as a Registrar. I'll be using just one
database to store informations to all of my servers. With this, if
I need more resources later, I can just create new servers with
the specific roles (WebSockets, Proxy, Registrar).
By now, the idea is clear, but the point is that I don't know how
to separate the WebSockets server from the proxy server. Actually,
I can do this, but when I have one agent using a regular softphone
and one agent using WebSockets (with JSSIP) they are not able to
establish a session if the softphone user starts it. Now, I want
to know if is there a way to use two websockets servers, register
users using both of then and start sessions between then, with a
separated proxy and registrar.
Has anyone done this before? Is possible to use kamailio like this?
Thanks.
*_
_*
*_
_*
*_Bruno Emer_*
Mobile: +55 11 96540-0044 <tel:%2B55%2011%2096540-0044>
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany
Bruno Emer
2014-09-22 15:40:13 UTC
Permalink
Hi, Daniel and Frank!

Thanks for your support!
Now, I changed my scenario just a lil bit to make it easy to understand and
deploy. I'm doing the following:

1. Created a server using the "Outbound" module configuration example,
but add WebSocket support in it. (IP Address 192.168.1.16)
2. Created a server running as Proxy and Registrar with WebSockets
support. (IP Address 192.168.1.15)
3. Registered two users (bob and alice-Pa7mVGAsjv8j5TC/***@public.gmane.org) using WebRTC.
These users sent they Register requests to the Oubount server
(192.168.1.16).
4. I'm also using an external postgres database to store the user
informations. In my proxy/registrar server, I've configurated
"modparam("usrloc", "db_mode", 3)", so it will not store data in memory.


After register the users in my scenario, I can see the following
information stored in my database (output of kamctl db show location):

id | ruid | username | domain |
contact | received | path | expires
| q | callid | cseq | last_modified | flags |
cflags | user_agent | socket | methods |
instance | reg_id
-----+----------------------+----------+----------------+------------------------------------------------+-----------------------+------+---------------------+----+------------------------+------+---------------------+-------+--------+-------------------+---------------------+---------+-------------------------------------------------+--------
277 | uloc-54203f71-10bd-2 | alice | enterprise.com |
sip:v4s0prah-HqZCAvZH/***@public.gmane.org;transport=ws | sip:192.168.1.16:5060 |
| 2014-09-22 15:31:21 | -1 | udb4shpe4dnm1jsl6016s5 | 82 | 2014-09-22
15:26:21 | 0 | 0 | JsSIP 0.4.0-devel | udp:192.168.1.15:80 |
783 | <urn:uuid:75c837d1-740a-4c62-baa0-56a06149699e> | 1
278 | uloc-54203f71-10bc-2 | bob | enterprise.com |
sip:lr78s270-hLFq6+***@public.gmane.org;transport=ws | sip:192.168.1.16:5060 |
| 2014-09-22 15:34:02 | -1 | 5mpl9q4bkuqsnpk8r316j5 | 82 | 2014-09-22
15:29:02 | 0 | 0 | JsSIP 0.4.0-devel | udp:192.168.1.15:80 |
783 | <urn:uuid:e92ef911-1ae4-45b1-bfc9-b5752b0f2fe1> | 1


So, I can assume that both users are registered and ready to start sessions.

Now, when I try to start a new session between then (let's say bob calling
alice) what I get in the endpoint is the following message:

SIP/2.0 500 I'm terribly sorry, server error occurred (1/SL)
Via: SIP/2.0/WS
0mkf6fgtprlh.invalid;rport=33154;received=192.168.1.11;branch=z9hG4bK7711221
To: <sip:alice-Pa7mVGAsjv8j5TC/***@public.gmane.org>;tag=94c1b96a0e6eb467885b5057e1e49f9e.1970
From: <sip:bob-Pa7mVGAsjv8j5TC/***@public.gmane.org>;tag=on056iipql
Call-ID: 5e1pmj2fppbgg13doi4k
CSeq: 3989 INVITE
Server: kamailio (4.1.5 (x86_64/linux))
Content-Length: 0

What I understood about this problem is that the Proxy server is trying to
forward the INVITE to the Outbound server and this server does not know
that to do with this message - like forward it to alice.

I'm stucked in this step.

Here you can find the configuration files that I'm using:

Outbound Server:
https://mega.co.nz/#!Wlw2RL7S!G2YOP-1QbSCeNQddaAe3kyQMqz8yteZlZsAUpjZX4v4

Proxy Server:
https://mega.co.nz/#!qxAXTbbb!4zBjRtmADdl3rPCN2Yidd3xnZEjFahW3GSMb00w41xc



Thanks again!

Bruno Emer



*Bruno Emer*

Mobile: +55 11 96540-0044
email: brunoemer-***@public.gmane.org
<https://www.facebook.com/bruno.emer.5>
<https://www.linkedin.com/profile/view?id=86461237&trk=spm_pic>
<https://twitter.com/brunoemer_>
<https://www.flickr.com/photos/***@N03/>
<http://google.com/+BrunoEmer> <http://instagram.com/brunoemer_>
Post by Bruno Emer
Ok, Daniel!
I am trying exactly what you said, but for some reason the proxy server
can't forward the message back to the WebSocket server. I am getting
"487 Unresolvable destination". Appears that my Proxy Server can't get data
from usrloc.
When I register an user using WebRTC I can see that the system stores the
information in kamailio database and in the field "contact" it puts a
string. The Proxy server is looking in database and just find this
information. Actually, I'm trying to understand the entire process that
envolves passing information from an Edge Server to a Proxy server that
sends the Register information to another Registrar server (as I described
before). The database is shared between all the servers, and they are in
the same network.
I just read the information in another topic, as you said, but I think
that my case is a lil bit different from it. I you agree, I can post my
configuration files here. Maybe this can help another users with the same
problem!
Thanks again!!!
*Bruno Emer*
Mobile: +55 11 96540-0044
<https://www.facebook.com/bruno.emer.5>
<https://www.linkedin.com/profile/view?id=86461237&trk=spm_pic>
<https://twitter.com/brunoemer_>
<http://google.com/+BrunoEmer> <http://instagram.com/brunoemer_>
Hello!
Post by Bruno Emer
I am relatively new to Kamailio and I'm trying to create a new enviroment
using it in my company. I am thinking about use Amazon to host the servers
and use OpsWorks to automatically escalate then if necessary. To accomplish
this, my idea is to separate the servers, using one dedicated server to run
as WebSocket, one to run as proxy and one as a Registrar. I'll be using
just one database to store informations to all of my servers. With this, if
I need more resources later, I can just create new servers with the
specific roles (WebSockets, Proxy, Registrar).
By now, the idea is clear, but the point is that I don't know how to
separate the WebSockets server from the proxy server. Actually, I can do
this, but when I have one agent using a regular softphone and one agent
using WebSockets (with JSSIP) they are not able to establish a session if
the softphone user starts it. Now, I want to know if is there a way to use
two websockets servers, register users using both of then and start
sessions between then, with a separated proxy and registrar.
Has anyone done this before? Is possible to use kamailio like this?
Thanks.
*Bruno Emer*
Mobile: +55 11 96540-0044
<https://www.facebook.com/bruno.emer.5>
<https://www.linkedin.com/profile/view?id=86461237&trk=spm_pic>
<https://twitter.com/brunoemer_>
<http://google.com/+BrunoEmer> <http://instagram.com/brunoemer_>
Bruno Emer
2014-09-23 21:07:17 UTC
Permalink
Hello Guys!

Good news about my tests here!
I found some configurations relative to Outbound proxy and I get this
working. Now, I can have two outbound proxies, one registrar and one
database. I can register one user in the Outbound Proxy1 and one user in
Outbound Proxy 2 and place a call between these users.

But now I'm facing another problem! The ACK messages are not being
delivered, so the session is being dropped after a few seconds. I think
that the problem is in the Contact field. Trying to investigate it now!

I'm not sure about how to change the message to deliver the ACK. Did
someone had this problem before?

In anycase, here is the routing configuration that I'm using in my Oubound
proxy:


request_route {
if (($Rp == MY_WS_PORT || $Rp == MY_WSS_PORT)
&& !(proto == WS || proto == WSS)) {
xlog("L_WARN", "SIP request received on $Rp\n");
sl_send_reply("403", "Forbidden");
exit;
}

route(REQINIT);

if (is_method("CANCEL")) {
if (t_check_trans()) {
route(RELAY);
}
exit;
}

route(WITHINDLG);

t_check_trans();

if (is_method("REGISTER")) {
remove_hf("Route");
add_path();
$du = "sip:REGISTRAR_IP:REGISTRAR_PORT";
} else {
if (is_method("INVITE|SUBSCRIBE|ACK"))
record_route();

if (@via[2] == "") {
# From client so route to registrar...

if ($rU == $null) {
sl_send_reply("484", "Address Incomplete");
exit;
}
remove_hf("Route");
$du = "sip:REGISTRAR_IP:REGISTRAR_PORT";
} else {
# From registrar so route using "Route:" headers...

if (!loose_route()) {
switch($rc) {
case -2:
sl_send_reply("403", "Forbidden");
exit;
default:
xlog("L_ERR", "in request_route\n");
sl_reply_error();
exit;
}
}

t_on_failure("FAIL_OUTBOUND");
}
}

route(RELAY);
}

route[RELAY] {
if (!t_relay()) {
sl_reply_error();
}
exit;
}

route[REQINIT] {
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
}

if(!sanity_check("1511", "7"))
{
xlog("Malformed SIP message from $si:$sp\n");
exit;
}
}

route[WITHINDLG] {
if (has_totag()) {
if (!loose_route()) {
switch($rc) {
case -2:
sl_send_reply("403", "Forbidden");
exit;
default:
if (is_method("ACK")) {
if ( t_check_trans() ) {
record_route();
route(RELAY);
exit;
} else {
exit;
}
}
sl_send_reply("404","Not Found");
}
} else {
if (is_method("NOTIFY")) {
record_route();
}
route(RELAY);
}
exit;
}
}

onreply_route {
if (($Rp == MY_WS_PORT || $Rp == MY_WSS_PORT)
&& !(proto == WS || proto == WSS)) {
xlog("L_WARN", "SIP response received on $Rp\n");
drop;
}

if (!t_check_trans()) {
drop;
}

if ($rm == "REGISTER" && $rs >= 200 && $rs <= 299) {
remove_hf("Flow-Timer");
if ($(hdr(Require)[*])=~"outbound")
insert_hf("Flow-Timer: FLOW_TIMER\r\n", "Call-ID");
}
}

failure_route[FAIL_OUTBOUND] {
if (t_branch_timeout() || !t_branch_replied()) {
send_reply("430", "Flow Failed");
}
}

event_route[xhttp:request] {
set_reply_close();
set_reply_no_connect();

if ($Rp != MY_WS_PORT
#!ifdef WITH_TLS
&& $Rp != MY_WSS_PORT
#!endif
) {
xlog("L_WARN", "HTTP request received on $Rp\n");
xhttp_reply("403", "Forbidden", "", "");
exit;
}

xlog("L_DBG", "HTTP Request Received\n");

if ($hdr(Upgrade)=~"websocket"
&& $hdr(Connection)=~"Upgrade"
&& $rm=~"GET") {

# Validate Host - make sure the client is using the correct
# alias for WebSockets
if ($hdr(Host) == $null || !is_myself("sip:" + $hdr(Host))) {
xlog("L_WARN", "Bad host $hdr(Host)\n");
xhttp_reply("403", "Forbidden", "", "");
exit;
}

# Optional... validate Origin - make sure the client is from an
# authorised website. For example,
#
# if ($hdr(Origin) != "http://communicator.MY_DOMAIN"
# && $hdr(Origin) != "https://communicator.MY_DOMAIN") {
# xlog("L_WARN", "Unauthorised client $hdr(Origin)\n");
# xhttp_reply("403", "Forbidden", "", "");
# exit;
# }

# Optional... perform HTTP authentication

# ws_handle_handshake() exits (no further configuration file
# processing of the request) when complete.
if (ws_handle_handshake())
{
# Optional... cache some information about the
# successful connection
exit;
}
}

xhttp_reply("404", "Not Found", "", "");
}

event_route[websocket:closed] {
xlog("L_INFO", "WebSocket connection from $si:$sp has closed\n");
}




Thanks again!!!



*Bruno Emer*

Mobile: +55 11 96540-0044
email: brunoemer-***@public.gmane.org
<https://www.facebook.com/bruno.emer.5>
<https://www.linkedin.com/profile/view?id=86461237&trk=spm_pic>
<https://twitter.com/brunoemer_>
<https://www.flickr.com/photos/***@N03/>
<http://google.com/+BrunoEmer> <http://instagram.com/brunoemer_>
Post by Bruno Emer
Hi, Daniel and Frank!
Thanks for your support!
Now, I changed my scenario just a lil bit to make it easy to understand
1. Created a server using the "Outbound" module configuration example,
but add WebSocket support in it. (IP Address 192.168.1.16)
2. Created a server running as Proxy and Registrar with WebSockets
support. (IP Address 192.168.1.15)
These users sent they Register requests to the Oubount server
(192.168.1.16).
4. I'm also using an external postgres database to store the user
informations. In my proxy/registrar server, I've configurated
"modparam("usrloc", "db_mode", 3)", so it will not store data in memory.
After register the users in my scenario, I can see the following
id | ruid | username | domain |
contact | received | path |
expires | q | callid | cseq | last_modified |
flags | cflags | user_agent | socket | methods |
instance | reg_id
-----+----------------------+----------+----------------+------------------------------------------------+-----------------------+------+---------------------+----+------------------------+------+---------------------+-------+--------+-------------------+---------------------+---------+-------------------------------------------------+--------
277 | uloc-54203f71-10bd-2 | alice | enterprise.com |
| 2014-09-22 15:31:21 | -1 | udb4shpe4dnm1jsl6016s5 | 82 |
192.168.1.15:80 | 783 |
<urn:uuid:75c837d1-740a-4c62-baa0-56a06149699e> | 1
278 | uloc-54203f71-10bc-2 | bob | enterprise.com |
| 2014-09-22 15:34:02 | -1 | 5mpl9q4bkuqsnpk8r316j5 | 82 |
192.168.1.15:80 | 783 |
<urn:uuid:e92ef911-1ae4-45b1-bfc9-b5752b0f2fe1> | 1
So, I can assume that both users are registered and ready to start
sessions.
Now, when I try to start a new session between then (let's say bob calling
SIP/2.0 500 I'm terribly sorry, server error occurred (1/SL)
Via: SIP/2.0/WS
0mkf6fgtprlh.invalid;rport=33154;received=192.168.1.11;branch=z9hG4bK7711221
Call-ID: 5e1pmj2fppbgg13doi4k
CSeq: 3989 INVITE
Server: kamailio (4.1.5 (x86_64/linux))
Content-Length: 0
What I understood about this problem is that the Proxy server is trying to
forward the INVITE to the Outbound server and this server does not know
that to do with this message - like forward it to alice.
I'm stucked in this step.
https://mega.co.nz/#!Wlw2RL7S!G2YOP-1QbSCeNQddaAe3kyQMqz8yteZlZsAUpjZX4v4
https://mega.co.nz/#!qxAXTbbb!4zBjRtmADdl3rPCN2Yidd3xnZEjFahW3GSMb00w41xc
Thanks again!
Bruno Emer
*Bruno Emer*
Mobile: +55 11 96540-0044
<https://www.facebook.com/bruno.emer.5>
<https://www.linkedin.com/profile/view?id=86461237&trk=spm_pic>
<https://twitter.com/brunoemer_>
<http://google.com/+BrunoEmer> <http://instagram.com/brunoemer_>
Ok, Daniel!
Post by Bruno Emer
I am trying exactly what you said, but for some reason the proxy server
can't forward the message back to the WebSocket server. I am getting
"487 Unresolvable destination". Appears that my Proxy Server can't get data
from usrloc.
When I register an user using WebRTC I can see that the system stores the
information in kamailio database and in the field "contact" it puts a
string. The Proxy server is looking in database and just find this
information. Actually, I'm trying to understand the entire process that
envolves passing information from an Edge Server to a Proxy server that
sends the Register information to another Registrar server (as I described
before). The database is shared between all the servers, and they are in
the same network.
I just read the information in another topic, as you said, but I think
that my case is a lil bit different from it. I you agree, I can post my
configuration files here. Maybe this can help another users with the same
problem!
Thanks again!!!
*Bruno Emer*
Mobile: +55 11 96540-0044
<https://www.facebook.com/bruno.emer.5>
<https://www.linkedin.com/profile/view?id=86461237&trk=spm_pic>
<https://twitter.com/brunoemer_>
<http://google.com/+BrunoEmer> <http://instagram.com/brunoemer_>
Hello!
Post by Bruno Emer
I am relatively new to Kamailio and I'm trying to create a new
enviroment using it in my company. I am thinking about use Amazon to host
the servers and use OpsWorks to automatically escalate then if necessary.
To accomplish this, my idea is to separate the servers, using one dedicated
server to run as WebSocket, one to run as proxy and one as a Registrar.
I'll be using just one database to store informations to all of my servers.
With this, if I need more resources later, I can just create new servers
with the specific roles (WebSockets, Proxy, Registrar).
By now, the idea is clear, but the point is that I don't know how to
separate the WebSockets server from the proxy server. Actually, I can do
this, but when I have one agent using a regular softphone and one agent
using WebSockets (with JSSIP) they are not able to establish a session if
the softphone user starts it. Now, I want to know if is there a way to use
two websockets servers, register users using both of then and start
sessions between then, with a separated proxy and registrar.
Has anyone done this before? Is possible to use kamailio like this?
Thanks.
*Bruno Emer*
Mobile: +55 11 96540-0044
<https://www.facebook.com/bruno.emer.5>
<https://www.linkedin.com/profile/view?id=86461237&trk=spm_pic>
<https://twitter.com/brunoemer_>
<http://google.com/+BrunoEmer> <http://instagram.com/brunoemer_>
Daniel-Constantin Mierla
2014-09-24 07:02:30 UTC
Permalink
Hello,

I haven't time to look at the traces and code, but be sure that you
don't do any fixing to contact address when receiving traffic from the
other proxy. The first proxy should do that.

Cheers,
Daniel
Post by Bruno Emer
Hello Guys!
Good news about my tests here!
I found some configurations relative to Outbound proxy and I get this
working. Now, I can have two outbound proxies, one registrar and one
database. I can register one user in the Outbound Proxy1 and one user
in Outbound Proxy 2 and place a call between these users.
But now I'm facing another problem! The ACK messages are not being
delivered, so the session is being dropped after a few seconds. I
think that the problem is in the Contact field. Trying to investigate
it now!
I'm not sure about how to change the message to deliver the ACK. Did
someone had this problem before?
In anycase, here is the routing configuration that I'm using in my
request_route {
if (($Rp == MY_WS_PORT || $Rp == MY_WSS_PORT)
&& !(proto == WS || proto == WSS)) {
xlog("L_WARN", "SIP request received on $Rp\n");
sl_send_reply("403", "Forbidden");
exit;
}
route(REQINIT);
if (is_method("CANCEL")) {
if (t_check_trans()) {
route(RELAY);
}
exit;
}
route(WITHINDLG);
t_check_trans();
if (is_method("REGISTER")) {
remove_hf("Route");
add_path();
$du = "sip:REGISTRAR_IP:REGISTRAR_PORT";
} else {
if (is_method("INVITE|SUBSCRIBE|ACK"))
record_route();
# From client so route to registrar...
if ($rU == $null) {
sl_send_reply("484", "Address Incomplete");
exit;
}
remove_hf("Route");
$du = "sip:REGISTRAR_IP:REGISTRAR_PORT";
} else {
# From registrar so route using "Route:" headers...
if (!loose_route()) {
switch($rc) {
sl_send_reply("403", "Forbidden");
exit;
xlog("L_ERR", "in request_route\n");
sl_reply_error();
exit;
}
}
t_on_failure("FAIL_OUTBOUND");
}
}
route(RELAY);
}
route[RELAY] {
if (!t_relay()) {
sl_reply_error();
}
exit;
}
route[REQINIT] {
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
}
if(!sanity_check("1511", "7"))
{
xlog("Malformed SIP message from $si:$sp\n");
exit;
}
}
route[WITHINDLG] {
if (has_totag()) {
if (!loose_route()) {
switch($rc) {
sl_send_reply("403", "Forbidden");
exit;
if (is_method("ACK")) {
if ( t_check_trans() ) {
record_route();
route(RELAY);
exit;
} else {
exit;
}
}
sl_send_reply("404","Not Found");
}
} else {
if (is_method("NOTIFY")) {
record_route();
}
route(RELAY);
}
exit;
}
}
onreply_route {
if (($Rp == MY_WS_PORT || $Rp == MY_WSS_PORT)
&& !(proto == WS || proto == WSS)) {
xlog("L_WARN", "SIP response received on $Rp\n");
drop;
}
if (!t_check_trans()) {
drop;
}
if ($rm == "REGISTER" && $rs >= 200 && $rs <= 299) {
remove_hf("Flow-Timer");
if ($(hdr(Require)[*])=~"outbound")
insert_hf("Flow-Timer: FLOW_TIMER\r\n", "Call-ID");
}
}
failure_route[FAIL_OUTBOUND] {
if (t_branch_timeout() || !t_branch_replied()) {
send_reply("430", "Flow Failed");
}
}
event_route[xhttp:request] {
set_reply_close();
set_reply_no_connect();
if ($Rp != MY_WS_PORT
#!ifdef WITH_TLS
&& $Rp != MY_WSS_PORT
#!endif
) {
xlog("L_WARN", "HTTP request received on $Rp\n");
xhttp_reply("403", "Forbidden", "", "");
exit;
}
xlog("L_DBG", "HTTP Request Received\n");
if ($hdr(Upgrade)=~"websocket"
&& $hdr(Connection)=~"Upgrade"
&& $rm=~"GET") {
# Validate Host - make sure the client is using the correct
# alias for WebSockets
if ($hdr(Host) == $null || !is_myself("sip:" + $hdr(Host))) {
xlog("L_WARN", "Bad host $hdr(Host)\n");
xhttp_reply("403", "Forbidden", "", "");
exit;
}
# Optional... validate Origin - make sure the client is from an
# authorised website. For example,
#
# if ($hdr(Origin) != "http://communicator.MY_DOMAIN"
# && $hdr(Origin) != "https://communicator.MY_DOMAIN") {
#xlog("L_WARN", "Unauthorised client $hdr(Origin)\n");
#xhttp_reply("403", "Forbidden", "", "");
#exit;
# }
# Optional... perform HTTP authentication
# ws_handle_handshake() exits (no further configuration file
# processing of the request) when complete.
if (ws_handle_handshake())
{
# Optional... cache some information about the
# successful connection
exit;
}
}
xhttp_reply("404", "Not Found", "", "");
}
event_route[websocket:closed] {
xlog("L_INFO", "WebSocket connection from $si:$sp has closed\n");
}
Thanks again!!!
*_
_*
*_
_*
*_Bruno Emer_*
Mobile: +55 11 96540-0044
Hi, Daniel and Frank!
Thanks for your support!
Now, I changed my scenario just a lil bit to make it easy to
1. Created a server using the "Outbound" module configuration
example, but add WebSocket support in it. (IP Address 192.168.1.16)
2. Created a server running as Proxy and Registrar with
WebSockets support. (IP Address 192.168.1.15)
Register requests to the Oubount server (192.168.1.16).
4. I'm also using an external postgres database to store the
user informations. In my proxy/registrar server, I've configurated
"modparam("usrloc", "db_mode", 3)", so it will not store data in
memory.
After register the users in my scenario, I can see the following
id | ruid | username | domain |
contact | received | path | expires
| q | callid | cseq | last_modified |
flags | cflags | user_agent | socket | methods |
instance | reg_id
-----+----------------------+----------+----------------+------------------------------------------------+-----------------------+------+---------------------+----+------------------------+------+---------------------+-------+--------+-------------------+---------------------+---------+-------------------------------------------------+--------
277 | uloc-54203f71-10bd-2 | alice | enterprise.com
<http://enterprise.com> |
sip:192.168.1.16:5060 <http://192.168.1.16:5060> | |
2014-09-22 15:31:21 | -1 | udb4shpe4dnm1jsl6016s5 | 82 |
2014-09-22 15:26:21 | 0 | 0 | JsSIP 0.4.0-devel |
udp:192.168.1.15:80 <http://192.168.1.15:80> | 783 |
<urn:uuid:75c837d1-740a-4c62-baa0-56a06149699e> | 1
278 | uloc-54203f71-10bc-2 | bob | enterprise.com
<http://enterprise.com> |
sip:192.168.1.16:5060 <http://192.168.1.16:5060> | |
2014-09-22 15:34:02 | -1 | 5mpl9q4bkuqsnpk8r316j5 | 82 |
2014-09-22 15:29:02 | 0 | 0 | JsSIP 0.4.0-devel |
udp:192.168.1.15:80 <http://192.168.1.15:80> | 783 |
<urn:uuid:e92ef911-1ae4-45b1-bfc9-b5752b0f2fe1> | 1
So, I can assume that both users are registered and ready to start
sessions.
Now, when I try to start a new session between then (let's say bob
SIP/2.0 500 I'm terribly sorry, server error occurred (1/SL)
Via: SIP/2.0/WS
0mkf6fgtprlh.invalid;rport=33154;received=192.168.1.11;branch=z9hG4bK7711221
Call-ID: 5e1pmj2fppbgg13doi4k
CSeq: 3989 INVITE
Server: kamailio (4.1.5 (x86_64/linux))
Content-Length: 0
What I understood about this problem is that the Proxy server is
trying to forward the INVITE to the Outbound server and this
server does not know that to do with this message - like forward
it to alice.
I'm stucked in this step.
https://mega.co.nz/#!Wlw2RL7S!G2YOP-1QbSCeNQddaAe3kyQMqz8yteZlZsAUpjZX4v4
<https://mega.co.nz/#%21Wlw2RL7S%21G2YOP-1QbSCeNQddaAe3kyQMqz8yteZlZsAUpjZX4v4>
https://mega.co.nz/#!qxAXTbbb!4zBjRtmADdl3rPCN2Yidd3xnZEjFahW3GSMb00w41xc
<https://mega.co.nz/#%21qxAXTbbb%214zBjRtmADdl3rPCN2Yidd3xnZEjFahW3GSMb00w41xc>
Thanks again!
Bruno Emer
*_
_*
*_
_*
*_Bruno Emer_*
Mobile: +55 11 96540-0044 <tel:%2B55%2011%2096540-0044>
Ok, Daniel!
I am trying exactly what you said, but for some reason the
proxy server can't forward the message back to the WebSocket
server. I am getting "487 Unresolvable destination". Appears
that my Proxy Server can't get data from usrloc.
When I register an user using WebRTC I can see that the system
stores the information in kamailio database and in the field
"contact" it puts a string. The Proxy server is looking in
database and just find this information. Actually, I'm trying
to understand the entire process that envolves passing
information from an Edge Server to a Proxy server that sends
the Register information to another Registrar server (as I
described before). The database is shared between all the
servers, and they are in the same network.
I just read the information in another topic, as you said, but
I think that my case is a lil bit different from it. I you
agree, I can post my configuration files here. Maybe this can
help another users with the same problem!
Thanks again!!!
*_
_*
*_
_*
*_Bruno Emer_*
Mobile: +55 11 96540-0044 <tel:%2B55%2011%2096540-0044>
Hello!
I am relatively new to Kamailio and I'm trying to create a
new enviroment using it in my company. I am thinking about
use Amazon to host the servers and use OpsWorks to
automatically escalate then if necessary. To accomplish
this, my idea is to separate the servers, using one
dedicated server to run as WebSocket, one to run as proxy
and one as a Registrar. I'll be using just one database to
store informations to all of my servers. With this, if I
need more resources later, I can just create new servers
with the specific roles (WebSockets, Proxy, Registrar).
By now, the idea is clear, but the point is that I don't
know how to separate the WebSockets server from the proxy
server. Actually, I can do this, but when I have one agent
using a regular softphone and one agent using WebSockets
(with JSSIP) they are not able to establish a session if
the softphone user starts it. Now, I want to know if is
there a way to use two websockets servers, register users
using both of then and start sessions between then, with a
separated proxy and registrar.
Has anyone done this before? Is possible to use kamailio
like this?
Thanks.
*_
_*
*_
_*
*_Bruno Emer_*
Mobile: +55 11 96540-0044 <tel:%2B55%2011%2096540-0044>
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Next Kamailio Advanced Trainings 2014 - http://www.asipto.com
Sep 22-25, Berlin, Germany
Bruno Emer
2014-09-24 13:52:20 UTC
Permalink
Thanks again for your help, Daniel!

Now my scenario is working!
I have two Edge Proxies and a single Registrar server pointing to a
external PostgreSQL database.

My two users (alice and bob) are authenticated each one in a Edge Proxy and
I can start a session between then using WebSockets. I'm using WebRTC
(JSSIP) as a client to start the calls.

:-)





*Bruno Emer*

Mobile: +55 11 96540-0044
email: brunoemer-***@public.gmane.org
<https://www.facebook.com/bruno.emer.5>
<https://www.linkedin.com/profile/view?id=86461237&trk=spm_pic>
<https://twitter.com/brunoemer_>
<https://www.flickr.com/photos/***@N03/>
<http://google.com/+BrunoEmer> <http://instagram.com/brunoemer_>
Post by Bruno Emer
Hello Guys!
Good news about my tests here!
I found some configurations relative to Outbound proxy and I get this
working. Now, I can have two outbound proxies, one registrar and one
database. I can register one user in the Outbound Proxy1 and one user in
Outbound Proxy 2 and place a call between these users.
But now I'm facing another problem! The ACK messages are not being
delivered, so the session is being dropped after a few seconds. I think
that the problem is in the Contact field. Trying to investigate it now!
I'm not sure about how to change the message to deliver the ACK. Did
someone had this problem before?
In anycase, here is the routing configuration that I'm using in my Oubound
request_route {
if (($Rp == MY_WS_PORT || $Rp == MY_WSS_PORT)
&& !(proto == WS || proto == WSS)) {
xlog("L_WARN", "SIP request received on $Rp\n");
sl_send_reply("403", "Forbidden");
exit;
}
route(REQINIT);
if (is_method("CANCEL")) {
if (t_check_trans()) {
route(RELAY);
}
exit;
}
route(WITHINDLG);
t_check_trans();
if (is_method("REGISTER")) {
remove_hf("Route");
add_path();
$du = "sip:REGISTRAR_IP:REGISTRAR_PORT";
} else {
if (is_method("INVITE|SUBSCRIBE|ACK"))
record_route();
# From client so route to registrar...
if ($rU == $null) {
sl_send_reply("484", "Address Incomplete");
exit;
}
remove_hf("Route");
$du = "sip:REGISTRAR_IP:REGISTRAR_PORT";
} else {
# From registrar so route using "Route:" headers...
if (!loose_route()) {
switch($rc) {
sl_send_reply("403", "Forbidden");
exit;
xlog("L_ERR", "in request_route\n");
sl_reply_error();
exit;
}
}
t_on_failure("FAIL_OUTBOUND");
}
}
route(RELAY);
}
route[RELAY] {
if (!t_relay()) {
sl_reply_error();
}
exit;
}
route[REQINIT] {
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
}
if(!sanity_check("1511", "7"))
{
xlog("Malformed SIP message from $si:$sp\n");
exit;
}
}
route[WITHINDLG] {
if (has_totag()) {
if (!loose_route()) {
switch($rc) {
sl_send_reply("403", "Forbidden");
exit;
if (is_method("ACK")) {
if ( t_check_trans() ) {
record_route();
route(RELAY);
exit;
} else {
exit;
}
}
sl_send_reply("404","Not Found");
}
} else {
if (is_method("NOTIFY")) {
record_route();
}
route(RELAY);
}
exit;
}
}
onreply_route {
if (($Rp == MY_WS_PORT || $Rp == MY_WSS_PORT)
&& !(proto == WS || proto == WSS)) {
xlog("L_WARN", "SIP response received on $Rp\n");
drop;
}
if (!t_check_trans()) {
drop;
}
if ($rm == "REGISTER" && $rs >= 200 && $rs <= 299) {
remove_hf("Flow-Timer");
if ($(hdr(Require)[*])=~"outbound")
insert_hf("Flow-Timer: FLOW_TIMER\r\n", "Call-ID");
}
}
failure_route[FAIL_OUTBOUND] {
if (t_branch_timeout() || !t_branch_replied()) {
send_reply("430", "Flow Failed");
}
}
event_route[xhttp:request] {
set_reply_close();
set_reply_no_connect();
if ($Rp != MY_WS_PORT
#!ifdef WITH_TLS
&& $Rp != MY_WSS_PORT
#!endif
) {
xlog("L_WARN", "HTTP request received on $Rp\n");
xhttp_reply("403", "Forbidden", "", "");
exit;
}
xlog("L_DBG", "HTTP Request Received\n");
if ($hdr(Upgrade)=~"websocket"
&& $hdr(Connection)=~"Upgrade"
&& $rm=~"GET") {
# Validate Host - make sure the client is using the correct
# alias for WebSockets
if ($hdr(Host) == $null || !is_myself("sip:" + $hdr(Host))) {
xlog("L_WARN", "Bad host $hdr(Host)\n");
xhttp_reply("403", "Forbidden", "", "");
exit;
}
# Optional... validate Origin - make sure the client is from an
# authorised website. For example,
#
# if ($hdr(Origin) != "http://communicator.MY_DOMAIN"
# && $hdr(Origin) != "https://communicator.MY_DOMAIN") {
# xlog("L_WARN", "Unauthorised client $hdr(Origin)\n");
# xhttp_reply("403", "Forbidden", "", "");
# exit;
# }
# Optional... perform HTTP authentication
# ws_handle_handshake() exits (no further configuration file
# processing of the request) when complete.
if (ws_handle_handshake())
{
# Optional... cache some information about the
# successful connection
exit;
}
}
xhttp_reply("404", "Not Found", "", "");
}
event_route[websocket:closed] {
xlog("L_INFO", "WebSocket connection from $si:$sp has closed\n");
}
Thanks again!!!
*Bruno Emer*
Mobile: +55 11 96540-0044
<https://www.facebook.com/bruno.emer.5>
<https://www.linkedin.com/profile/view?id=86461237&trk=spm_pic>
<https://twitter.com/brunoemer_>
<http://google.com/+BrunoEmer> <http://instagram.com/brunoemer_>
Hi, Daniel and Frank!
Post by Bruno Emer
Thanks for your support!
Now, I changed my scenario just a lil bit to make it easy to understand
1. Created a server using the "Outbound" module configuration example,
but add WebSocket support in it. (IP Address 192.168.1.16)
2. Created a server running as Proxy and Registrar with WebSockets
support. (IP Address 192.168.1.15)
These users sent they Register requests to the Oubount server
(192.168.1.16).
4. I'm also using an external postgres database to store the user
informations. In my proxy/registrar server, I've configurated
"modparam("usrloc", "db_mode", 3)", so it will not store data in memory.
After register the users in my scenario, I can see the following
id | ruid | username | domain |
contact | received | path |
expires | q | callid | cseq | last_modified |
flags | cflags | user_agent | socket | methods |
instance | reg_id
-----+----------------------+----------+----------------+------------------------------------------------+-----------------------+------+---------------------+----+------------------------+------+---------------------+-------+--------+-------------------+---------------------+---------+-------------------------------------------------+--------
277 | uloc-54203f71-10bd-2 | alice | enterprise.com |
| 2014-09-22 15:31:21 | -1 | udb4shpe4dnm1jsl6016s5 | 82 |
192.168.1.15:80 | 783 |
<urn:uuid:75c837d1-740a-4c62-baa0-56a06149699e> | 1
278 | uloc-54203f71-10bc-2 | bob | enterprise.com |
| 2014-09-22 15:34:02 | -1 | 5mpl9q4bkuqsnpk8r316j5 | 82 |
192.168.1.15:80 | 783 |
<urn:uuid:e92ef911-1ae4-45b1-bfc9-b5752b0f2fe1> | 1
So, I can assume that both users are registered and ready to start
sessions.
Now, when I try to start a new session between then (let's say bob
SIP/2.0 500 I'm terribly sorry, server error occurred (1/SL)
Via: SIP/2.0/WS
0mkf6fgtprlh.invalid;rport=33154;received=192.168.1.11;branch=z9hG4bK7711221
Call-ID: 5e1pmj2fppbgg13doi4k
CSeq: 3989 INVITE
Server: kamailio (4.1.5 (x86_64/linux))
Content-Length: 0
What I understood about this problem is that the Proxy server is trying
to forward the INVITE to the Outbound server and this server does not know
that to do with this message - like forward it to alice.
I'm stucked in this step.
https://mega.co.nz/#!Wlw2RL7S!G2YOP-1QbSCeNQddaAe3kyQMqz8yteZlZsAUpjZX4v4
https://mega.co.nz/#!qxAXTbbb!4zBjRtmADdl3rPCN2Yidd3xnZEjFahW3GSMb00w41xc
Thanks again!
Bruno Emer
*Bruno Emer*
Mobile: +55 11 96540-0044
<https://www.facebook.com/bruno.emer.5>
<https://www.linkedin.com/profile/view?id=86461237&trk=spm_pic>
<https://twitter.com/brunoemer_>
<http://google.com/+BrunoEmer> <http://instagram.com/brunoemer_>
Ok, Daniel!
Post by Bruno Emer
I am trying exactly what you said, but for some reason the proxy server
can't forward the message back to the WebSocket server. I am getting
"487 Unresolvable destination". Appears that my Proxy Server can't get data
from usrloc.
When I register an user using WebRTC I can see that the system stores
the information in kamailio database and in the field "contact" it puts a
string. The Proxy server is looking in database and just find this
information. Actually, I'm trying to understand the entire process that
envolves passing information from an Edge Server to a Proxy server that
sends the Register information to another Registrar server (as I described
before). The database is shared between all the servers, and they are in
the same network.
I just read the information in another topic, as you said, but I think
that my case is a lil bit different from it. I you agree, I can post my
configuration files here. Maybe this can help another users with the same
problem!
Thanks again!!!
*Bruno Emer*
Mobile: +55 11 96540-0044
<https://www.facebook.com/bruno.emer.5>
<https://www.linkedin.com/profile/view?id=86461237&trk=spm_pic>
<https://twitter.com/brunoemer_>
<http://google.com/+BrunoEmer> <http://instagram.com/brunoemer_>
Hello!
Post by Bruno Emer
I am relatively new to Kamailio and I'm trying to create a new
enviroment using it in my company. I am thinking about use Amazon to host
the servers and use OpsWorks to automatically escalate then if necessary.
To accomplish this, my idea is to separate the servers, using one dedicated
server to run as WebSocket, one to run as proxy and one as a Registrar.
I'll be using just one database to store informations to all of my servers.
With this, if I need more resources later, I can just create new servers
with the specific roles (WebSockets, Proxy, Registrar).
By now, the idea is clear, but the point is that I don't know how to
separate the WebSockets server from the proxy server. Actually, I can do
this, but when I have one agent using a regular softphone and one agent
using WebSockets (with JSSIP) they are not able to establish a session if
the softphone user starts it. Now, I want to know if is there a way to use
two websockets servers, register users using both of then and start
sessions between then, with a separated proxy and registrar.
Has anyone done this before? Is possible to use kamailio like this?
Thanks.
*Bruno Emer*
Mobile: +55 11 96540-0044
<https://www.facebook.com/bruno.emer.5>
<https://www.linkedin.com/profile/view?id=86461237&trk=spm_pic>
<https://twitter.com/brunoemer_>
<http://google.com/+BrunoEmer> <http://instagram.com/brunoemer_>
Nick Cameo
2014-09-24 16:31:46 UTC
Permalink
Hello Bruno, happy to hear you got it working. We are also working on a
similar setup.
Can you please share the documents online that helped you get the web
socketc/webrtc/
kamailio environment up.


Kind Regards,

Nick.
​
Bruno Emer
2014-09-24 17:46:23 UTC
Permalink
Hello Nick!

I'm still learning more about Kamailio and how it works. This is being a
lil bit hard to me because I don't understand too much about programming
and all those "if's" and "else's", but I'll be happy to help you and
provide you the information that I used to have y scenario working fine.

I spent a lot of time to have this scenario up and running in the way that
I need, but here are the main documentation which I used:


This link here explain how to have Registrar and Proxy in different
servers. It helped me a lot to understand the message flow between the
servers:
http://www.kamailio.org/dokuwiki/doku.php/tutorials:openser-modular-install

This here, shows how to enable the websockets in Kamailio. I think that is
a good point to start:
http://nil.uniza.sk/sip/kamailio/configuring-kamailio-4x-websocket

Here I found a good example that shows how to have an Edge Proxy with
websockets support:
https://github.com/kamailio/kamailio/blob/master/examples/outbound/edge_websocket.cfg



So, I got a mix of information and a lot of attempts and errors.

BTW, many thanks to Daniel and Frank Carmickle that helped me a lot with my
questions!

If you need more help, please let me know!

:-)



*Bruno Emer*

Mobile: +55 11 96540-0044
email: brunoemer-***@public.gmane.org
<https://www.facebook.com/bruno.emer.5>
<https://www.linkedin.com/profile/view?id=86461237&trk=spm_pic>
<https://twitter.com/brunoemer_>
<https://www.flickr.com/photos/***@N03/>
<http://google.com/+BrunoEmer> <http://instagram.com/brunoemer_>
Post by Bruno Emer
Thanks again for your help, Daniel!
Now my scenario is working!
I have two Edge Proxies and a single Registrar server pointing to a
external PostgreSQL database.
My two users (alice and bob) are authenticated each one in a Edge Proxy
and I can start a session between then using WebSockets. I'm using WebRTC
(JSSIP) as a client to start the calls.
:-)
*Bruno Emer*
Mobile: +55 11 96540-0044
<https://www.facebook.com/bruno.emer.5>
<https://www.linkedin.com/profile/view?id=86461237&trk=spm_pic>
<https://twitter.com/brunoemer_>
<http://google.com/+BrunoEmer> <http://instagram.com/brunoemer_>
Hello Guys!
Post by Bruno Emer
Good news about my tests here!
I found some configurations relative to Outbound proxy and I get this
working. Now, I can have two outbound proxies, one registrar and one
database. I can register one user in the Outbound Proxy1 and one user in
Outbound Proxy 2 and place a call between these users.
But now I'm facing another problem! The ACK messages are not being
delivered, so the session is being dropped after a few seconds. I think
that the problem is in the Contact field. Trying to investigate it now!
I'm not sure about how to change the message to deliver the ACK. Did
someone had this problem before?
In anycase, here is the routing configuration that I'm using in my
request_route {
if (($Rp == MY_WS_PORT || $Rp == MY_WSS_PORT)
&& !(proto == WS || proto == WSS)) {
xlog("L_WARN", "SIP request received on $Rp\n");
sl_send_reply("403", "Forbidden");
exit;
}
route(REQINIT);
if (is_method("CANCEL")) {
if (t_check_trans()) {
route(RELAY);
}
exit;
}
route(WITHINDLG);
t_check_trans();
if (is_method("REGISTER")) {
remove_hf("Route");
add_path();
$du = "sip:REGISTRAR_IP:REGISTRAR_PORT";
} else {
if (is_method("INVITE|SUBSCRIBE|ACK"))
record_route();
# From client so route to registrar...
if ($rU == $null) {
sl_send_reply("484", "Address Incomplete");
exit;
}
remove_hf("Route");
$du = "sip:REGISTRAR_IP:REGISTRAR_PORT";
} else {
# From registrar so route using "Route:" headers...
if (!loose_route()) {
switch($rc) {
sl_send_reply("403", "Forbidden");
exit;
xlog("L_ERR", "in request_route\n");
sl_reply_error();
exit;
}
}
t_on_failure("FAIL_OUTBOUND");
}
}
route(RELAY);
}
route[RELAY] {
if (!t_relay()) {
sl_reply_error();
}
exit;
}
route[REQINIT] {
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
}
if(!sanity_check("1511", "7"))
{
xlog("Malformed SIP message from $si:$sp\n");
exit;
}
}
route[WITHINDLG] {
if (has_totag()) {
if (!loose_route()) {
switch($rc) {
sl_send_reply("403", "Forbidden");
exit;
if (is_method("ACK")) {
if ( t_check_trans() ) {
record_route();
route(RELAY);
exit;
} else {
exit;
}
}
sl_send_reply("404","Not Found");
}
} else {
if (is_method("NOTIFY")) {
record_route();
}
route(RELAY);
}
exit;
}
}
onreply_route {
if (($Rp == MY_WS_PORT || $Rp == MY_WSS_PORT)
&& !(proto == WS || proto == WSS)) {
xlog("L_WARN", "SIP response received on $Rp\n");
drop;
}
if (!t_check_trans()) {
drop;
}
if ($rm == "REGISTER" && $rs >= 200 && $rs <= 299) {
remove_hf("Flow-Timer");
if ($(hdr(Require)[*])=~"outbound")
insert_hf("Flow-Timer: FLOW_TIMER\r\n", "Call-ID");
}
}
failure_route[FAIL_OUTBOUND] {
if (t_branch_timeout() || !t_branch_replied()) {
send_reply("430", "Flow Failed");
}
}
event_route[xhttp:request] {
set_reply_close();
set_reply_no_connect();
if ($Rp != MY_WS_PORT
#!ifdef WITH_TLS
&& $Rp != MY_WSS_PORT
#!endif
) {
xlog("L_WARN", "HTTP request received on $Rp\n");
xhttp_reply("403", "Forbidden", "", "");
exit;
}
xlog("L_DBG", "HTTP Request Received\n");
if ($hdr(Upgrade)=~"websocket"
&& $hdr(Connection)=~"Upgrade"
&& $rm=~"GET") {
# Validate Host - make sure the client is using the correct
# alias for WebSockets
if ($hdr(Host) == $null || !is_myself("sip:" + $hdr(Host))) {
xlog("L_WARN", "Bad host $hdr(Host)\n");
xhttp_reply("403", "Forbidden", "", "");
exit;
}
# Optional... validate Origin - make sure the client is from an
# authorised website. For example,
#
# if ($hdr(Origin) != "http://communicator.MY_DOMAIN"
# && $hdr(Origin) != "https://communicator.MY_DOMAIN") {
# xlog("L_WARN", "Unauthorised client $hdr(Origin)\n");
# xhttp_reply("403", "Forbidden", "", "");
# exit;
# }
# Optional... perform HTTP authentication
# ws_handle_handshake() exits (no further configuration file
# processing of the request) when complete.
if (ws_handle_handshake())
{
# Optional... cache some information about the
# successful connection
exit;
}
}
xhttp_reply("404", "Not Found", "", "");
}
event_route[websocket:closed] {
xlog("L_INFO", "WebSocket connection from $si:$sp has closed\n");
}
Thanks again!!!
*Bruno Emer*
Mobile: +55 11 96540-0044
<https://www.facebook.com/bruno.emer.5>
<https://www.linkedin.com/profile/view?id=86461237&trk=spm_pic>
<https://twitter.com/brunoemer_>
<http://google.com/+BrunoEmer> <http://instagram.com/brunoemer_>
Hi, Daniel and Frank!
Post by Bruno Emer
Thanks for your support!
Now, I changed my scenario just a lil bit to make it easy to understand
1. Created a server using the "Outbound" module configuration
example, but add WebSocket support in it. (IP Address 192.168.1.16)
2. Created a server running as Proxy and Registrar with WebSockets
support. (IP Address 192.168.1.15)
These users sent they Register requests to the Oubount server
(192.168.1.16).
4. I'm also using an external postgres database to store the user
informations. In my proxy/registrar server, I've configurated
"modparam("usrloc", "db_mode", 3)", so it will not store data in memory.
After register the users in my scenario, I can see the following
id | ruid | username | domain |
contact | received | path |
expires | q | callid | cseq | last_modified |
flags | cflags | user_agent | socket | methods |
instance | reg_id
-----+----------------------+----------+----------------+------------------------------------------------+-----------------------+------+---------------------+----+------------------------+------+---------------------+-------+--------+-------------------+---------------------+---------+-------------------------------------------------+--------
277 | uloc-54203f71-10bd-2 | alice | enterprise.com |
| | 2014-09-22 15:31:21 | -1 | udb4shpe4dnm1jsl6016s5 | 82 |
192.168.1.15:80 | 783 |
<urn:uuid:75c837d1-740a-4c62-baa0-56a06149699e> | 1
278 | uloc-54203f71-10bc-2 | bob | enterprise.com |
| | 2014-09-22 15:34:02 | -1 | 5mpl9q4bkuqsnpk8r316j5 | 82 |
192.168.1.15:80 | 783 |
<urn:uuid:e92ef911-1ae4-45b1-bfc9-b5752b0f2fe1> | 1
So, I can assume that both users are registered and ready to start
sessions.
Now, when I try to start a new session between then (let's say bob
SIP/2.0 500 I'm terribly sorry, server error occurred (1/SL)
Via: SIP/2.0/WS
0mkf6fgtprlh.invalid;rport=33154;received=192.168.1.11;branch=z9hG4bK7711221
Call-ID: 5e1pmj2fppbgg13doi4k
CSeq: 3989 INVITE
Server: kamailio (4.1.5 (x86_64/linux))
Content-Length: 0
What I understood about this problem is that the Proxy server is trying
to forward the INVITE to the Outbound server and this server does not know
that to do with this message - like forward it to alice.
I'm stucked in this step.
https://mega.co.nz/#!Wlw2RL7S!G2YOP-1QbSCeNQddaAe3kyQMqz8yteZlZsAUpjZX4v4
https://mega.co.nz/#!qxAXTbbb!4zBjRtmADdl3rPCN2Yidd3xnZEjFahW3GSMb00w41xc
Thanks again!
Bruno Emer
*Bruno Emer*
Mobile: +55 11 96540-0044
<https://www.facebook.com/bruno.emer.5>
<https://www.linkedin.com/profile/view?id=86461237&trk=spm_pic>
<https://twitter.com/brunoemer_>
<http://google.com/+BrunoEmer> <http://instagram.com/brunoemer_>
Ok, Daniel!
Post by Bruno Emer
I am trying exactly what you said, but for some reason the proxy server
can't forward the message back to the WebSocket server. I am getting
"487 Unresolvable destination". Appears that my Proxy Server can't get data
from usrloc.
When I register an user using WebRTC I can see that the system stores
the information in kamailio database and in the field "contact" it puts a
string. The Proxy server is looking in database and just find this
information. Actually, I'm trying to understand the entire process that
envolves passing information from an Edge Server to a Proxy server that
sends the Register information to another Registrar server (as I described
before). The database is shared between all the servers, and they are in
the same network.
I just read the information in another topic, as you said, but I think
that my case is a lil bit different from it. I you agree, I can post my
configuration files here. Maybe this can help another users with the same
problem!
Thanks again!!!
*Bruno Emer*
Mobile: +55 11 96540-0044
<https://www.facebook.com/bruno.emer.5>
<https://www.linkedin.com/profile/view?id=86461237&trk=spm_pic>
<https://twitter.com/brunoemer_>
<http://google.com/+BrunoEmer> <http://instagram.com/brunoemer_>
Hello!
Post by Bruno Emer
I am relatively new to Kamailio and I'm trying to create a new
enviroment using it in my company. I am thinking about use Amazon to host
the servers and use OpsWorks to automatically escalate then if necessary.
To accomplish this, my idea is to separate the servers, using one dedicated
server to run as WebSocket, one to run as proxy and one as a Registrar.
I'll be using just one database to store informations to all of my servers.
With this, if I need more resources later, I can just create new servers
with the specific roles (WebSockets, Proxy, Registrar).
By now, the idea is clear, but the point is that I don't know how to
separate the WebSockets server from the proxy server. Actually, I can do
this, but when I have one agent using a regular softphone and one agent
using WebSockets (with JSSIP) they are not able to establish a session if
the softphone user starts it. Now, I want to know if is there a way to use
two websockets servers, register users using both of then and start
sessions between then, with a separated proxy and registrar.
Has anyone done this before? Is possible to use kamailio like this?
Thanks.
*Bruno Emer*
Mobile: +55 11 96540-0044
<https://www.facebook.com/bruno.emer.5>
<https://www.linkedin.com/profile/view?id=86461237&trk=spm_pic>
<https://twitter.com/brunoemer_>
<http://google.com/+BrunoEmer> <http://instagram.com/brunoemer_>
Nick Cameo
2014-09-24 18:10:58 UTC
Permalink
Dude, thank you. I'll go through the documentation and will send you an
email as I progress.
PS I am pretty strong with Kamailio+Media/RTPProxy, perl, ifs and elses, so
I may be able to help you there if
needed
​
Bruno Emer
2014-09-24 18:55:25 UTC
Permalink
Excellent, Nick!

And if you need some help or stuck in some point, don't hesitate on contact
me! I have done a lot of work to get websockets working, and maybe I can
share my experience with you as well.

:-)




*Bruno Emer*

Mobile: +55 11 96540-0044
email: brunoemer-***@public.gmane.org
<https://www.facebook.com/bruno.emer.5>
<https://www.linkedin.com/profile/view?id=86461237&trk=spm_pic>
<https://twitter.com/brunoemer_>
<https://www.flickr.com/photos/***@N03/>
<http://google.com/+BrunoEmer> <http://instagram.com/brunoemer_>
Post by Bruno Emer
Hello Nick!
I'm still learning more about Kamailio and how it works. This is being a
lil bit hard to me because I don't understand too much about programming
and all those "if's" and "else's", but I'll be happy to help you and
provide you the information that I used to have y scenario working fine.
I spent a lot of time to have this scenario up and running in the way that
This link here explain how to have Registrar and Proxy in different
servers. It helped me a lot to understand the message flow between the
http://www.kamailio.org/dokuwiki/doku.php/tutorials:openser-modular-install
This here, shows how to enable the websockets in Kamailio. I think that is
http://nil.uniza.sk/sip/kamailio/configuring-kamailio-4x-websocket
Here I found a good example that shows how to have an Edge Proxy with
https://github.com/kamailio/kamailio/blob/master/examples/outbound/edge_websocket.cfg
So, I got a mix of information and a lot of attempts and errors.
BTW, many thanks to Daniel and Frank Carmickle that helped me a lot with
my questions!
If you need more help, please let me know!
:-)
*Bruno Emer*
Mobile: +55 11 96540-0044
<https://www.facebook.com/bruno.emer.5>
<https://www.linkedin.com/profile/view?id=86461237&trk=spm_pic>
<https://twitter.com/brunoemer_>
<http://google.com/+BrunoEmer> <http://instagram.com/brunoemer_>
Thanks again for your help, Daniel!
Post by Bruno Emer
Now my scenario is working!
I have two Edge Proxies and a single Registrar server pointing to a
external PostgreSQL database.
My two users (alice and bob) are authenticated each one in a Edge Proxy
and I can start a session between then using WebSockets. I'm using WebRTC
(JSSIP) as a client to start the calls.
:-)
*Bruno Emer*
Mobile: +55 11 96540-0044
<https://www.facebook.com/bruno.emer.5>
<https://www.linkedin.com/profile/view?id=86461237&trk=spm_pic>
<https://twitter.com/brunoemer_>
<http://google.com/+BrunoEmer> <http://instagram.com/brunoemer_>
Hello Guys!
Post by Bruno Emer
Good news about my tests here!
I found some configurations relative to Outbound proxy and I get this
working. Now, I can have two outbound proxies, one registrar and one
database. I can register one user in the Outbound Proxy1 and one user in
Outbound Proxy 2 and place a call between these users.
But now I'm facing another problem! The ACK messages are not being
delivered, so the session is being dropped after a few seconds. I think
that the problem is in the Contact field. Trying to investigate it now!
I'm not sure about how to change the message to deliver the ACK. Did
someone had this problem before?
In anycase, here is the routing configuration that I'm using in my
request_route {
if (($Rp == MY_WS_PORT || $Rp == MY_WSS_PORT)
&& !(proto == WS || proto == WSS)) {
xlog("L_WARN", "SIP request received on $Rp\n");
sl_send_reply("403", "Forbidden");
exit;
}
route(REQINIT);
if (is_method("CANCEL")) {
if (t_check_trans()) {
route(RELAY);
}
exit;
}
route(WITHINDLG);
t_check_trans();
if (is_method("REGISTER")) {
remove_hf("Route");
add_path();
$du = "sip:REGISTRAR_IP:REGISTRAR_PORT";
} else {
if (is_method("INVITE|SUBSCRIBE|ACK"))
record_route();
# From client so route to registrar...
if ($rU == $null) {
sl_send_reply("484", "Address Incomplete");
exit;
}
remove_hf("Route");
$du = "sip:REGISTRAR_IP:REGISTRAR_PORT";
} else {
# From registrar so route using "Route:" headers...
if (!loose_route()) {
switch($rc) {
sl_send_reply("403", "Forbidden");
exit;
xlog("L_ERR", "in request_route\n");
sl_reply_error();
exit;
}
}
t_on_failure("FAIL_OUTBOUND");
}
}
route(RELAY);
}
route[RELAY] {
if (!t_relay()) {
sl_reply_error();
}
exit;
}
route[REQINIT] {
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
}
if(!sanity_check("1511", "7"))
{
xlog("Malformed SIP message from $si:$sp\n");
exit;
}
}
route[WITHINDLG] {
if (has_totag()) {
if (!loose_route()) {
switch($rc) {
sl_send_reply("403", "Forbidden");
exit;
if (is_method("ACK")) {
if ( t_check_trans() ) {
record_route();
route(RELAY);
exit;
} else {
exit;
}
}
sl_send_reply("404","Not Found");
}
} else {
if (is_method("NOTIFY")) {
record_route();
}
route(RELAY);
}
exit;
}
}
onreply_route {
if (($Rp == MY_WS_PORT || $Rp == MY_WSS_PORT)
&& !(proto == WS || proto == WSS)) {
xlog("L_WARN", "SIP response received on $Rp\n");
drop;
}
if (!t_check_trans()) {
drop;
}
if ($rm == "REGISTER" && $rs >= 200 && $rs <= 299) {
remove_hf("Flow-Timer");
if ($(hdr(Require)[*])=~"outbound")
insert_hf("Flow-Timer: FLOW_TIMER\r\n", "Call-ID");
}
}
failure_route[FAIL_OUTBOUND] {
if (t_branch_timeout() || !t_branch_replied()) {
send_reply("430", "Flow Failed");
}
}
event_route[xhttp:request] {
set_reply_close();
set_reply_no_connect();
if ($Rp != MY_WS_PORT
#!ifdef WITH_TLS
&& $Rp != MY_WSS_PORT
#!endif
) {
xlog("L_WARN", "HTTP request received on $Rp\n");
xhttp_reply("403", "Forbidden", "", "");
exit;
}
xlog("L_DBG", "HTTP Request Received\n");
if ($hdr(Upgrade)=~"websocket"
&& $hdr(Connection)=~"Upgrade"
&& $rm=~"GET") {
# Validate Host - make sure the client is using the correct
# alias for WebSockets
if ($hdr(Host) == $null || !is_myself("sip:" + $hdr(Host))) {
xlog("L_WARN", "Bad host $hdr(Host)\n");
xhttp_reply("403", "Forbidden", "", "");
exit;
}
# Optional... validate Origin - make sure the client is from an
# authorised website. For example,
#
# if ($hdr(Origin) != "http://communicator.MY_DOMAIN"
# && $hdr(Origin) != "https://communicator.MY_DOMAIN") {
# xlog("L_WARN", "Unauthorised client $hdr(Origin)\n");
# xhttp_reply("403", "Forbidden", "", "");
# exit;
# }
# Optional... perform HTTP authentication
# ws_handle_handshake() exits (no further configuration file
# processing of the request) when complete.
if (ws_handle_handshake())
{
# Optional... cache some information about the
# successful connection
exit;
}
}
xhttp_reply("404", "Not Found", "", "");
}
event_route[websocket:closed] {
xlog("L_INFO", "WebSocket connection from $si:$sp has closed\n");
}
Thanks again!!!
*Bruno Emer*
Mobile: +55 11 96540-0044
<https://www.facebook.com/bruno.emer.5>
<https://www.linkedin.com/profile/view?id=86461237&trk=spm_pic>
<https://twitter.com/brunoemer_>
<http://google.com/+BrunoEmer> <http://instagram.com/brunoemer_>
Hi, Daniel and Frank!
Post by Bruno Emer
Thanks for your support!
Now, I changed my scenario just a lil bit to make it easy to understand
1. Created a server using the "Outbound" module configuration
example, but add WebSocket support in it. (IP Address 192.168.1.16)
2. Created a server running as Proxy and Registrar with WebSockets
support. (IP Address 192.168.1.15)
WebRTC. These users sent they Register requests to the Oubount server
(192.168.1.16).
4. I'm also using an external postgres database to store the user
informations. In my proxy/registrar server, I've configurated
"modparam("usrloc", "db_mode", 3)", so it will not store data in memory.
After register the users in my scenario, I can see the following
id | ruid | username | domain |
contact | received | path |
expires | q | callid | cseq | last_modified |
flags | cflags | user_agent | socket | methods |
instance | reg_id
-----+----------------------+----------+----------------+------------------------------------------------+-----------------------+------+---------------------+----+------------------------+------+---------------------+-------+--------+-------------------+---------------------+---------+-------------------------------------------------+--------
277 | uloc-54203f71-10bd-2 | alice | enterprise.com |
| | 2014-09-22 15:31:21 | -1 | udb4shpe4dnm1jsl6016s5 | 82 |
192.168.1.15:80 | 783 |
<urn:uuid:75c837d1-740a-4c62-baa0-56a06149699e> | 1
278 | uloc-54203f71-10bc-2 | bob | enterprise.com |
| | 2014-09-22 15:34:02 | -1 | 5mpl9q4bkuqsnpk8r316j5 | 82 |
192.168.1.15:80 | 783 |
<urn:uuid:e92ef911-1ae4-45b1-bfc9-b5752b0f2fe1> | 1
So, I can assume that both users are registered and ready to start
sessions.
Now, when I try to start a new session between then (let's say bob
SIP/2.0 500 I'm terribly sorry, server error occurred (1/SL)
Via: SIP/2.0/WS
0mkf6fgtprlh.invalid;rport=33154;received=192.168.1.11;branch=z9hG4bK7711221
Post by Bruno Emer
;tag=94c1b96a0e6eb467885b5057e1e49f9e.1970
Call-ID: 5e1pmj2fppbgg13doi4k
CSeq: 3989 INVITE
Server: kamailio (4.1.5 (x86_64/linux))
Content-Length: 0
What I understood about this problem is that the Proxy server is trying
to forward the INVITE to the Outbound server and this server does not know
that to do with this message - like forward it to alice.
I'm stucked in this step.
https://mega.co.nz/#!Wlw2RL7S!G2YOP-1QbSCeNQddaAe3kyQMqz8yteZlZsAUpjZX4v4
https://mega.co.nz/#!qxAXTbbb!4zBjRtmADdl3rPCN2Yidd3xnZEjFahW3GSMb00w41xc
Thanks again!
Bruno Emer
*Bruno Emer*
Mobile: +55 11 96540-0044
<https://www.facebook.com/bruno.emer.5>
<https://www.linkedin.com/profile/view?id=86461237&trk=spm_pic>
<https://twitter.com/brunoemer_>
<http://google.com/+BrunoEmer> <http://instagram.com/brunoemer_>
Ok, Daniel!
Post by Bruno Emer
I am trying exactly what you said, but for some reason the proxy
server can't forward the message back to the WebSocket server. I am getting
"487 Unresolvable destination". Appears that my Proxy Server can't get data
from usrloc.
When I register an user using WebRTC I can see that the system stores
the information in kamailio database and in the field "contact" it puts a
string. The Proxy server is looking in database and just find this
information. Actually, I'm trying to understand the entire process that
envolves passing information from an Edge Server to a Proxy server that
sends the Register information to another Registrar server (as I described
before). The database is shared between all the servers, and they are in
the same network.
I just read the information in another topic, as you said, but I think
that my case is a lil bit different from it. I you agree, I can post my
configuration files here. Maybe this can help another users with the same
problem!
Thanks again!!!
*Bruno Emer*
Mobile: +55 11 96540-0044
<https://www.facebook.com/bruno.emer.5>
<https://www.linkedin.com/profile/view?id=86461237&trk=spm_pic>
<https://twitter.com/brunoemer_>
<http://google.com/+BrunoEmer> <http://instagram.com/brunoemer_>
Hello!
Post by Bruno Emer
I am relatively new to Kamailio and I'm trying to create a new
enviroment using it in my company. I am thinking about use Amazon to host
the servers and use OpsWorks to automatically escalate then if necessary.
To accomplish this, my idea is to separate the servers, using one dedicated
server to run as WebSocket, one to run as proxy and one as a Registrar.
I'll be using just one database to store informations to all of my servers.
With this, if I need more resources later, I can just create new servers
with the specific roles (WebSockets, Proxy, Registrar).
By now, the idea is clear, but the point is that I don't know how to
separate the WebSockets server from the proxy server. Actually, I can do
this, but when I have one agent using a regular softphone and one agent
using WebSockets (with JSSIP) they are not able to establish a session if
the softphone user starts it. Now, I want to know if is there a way to use
two websockets servers, register users using both of then and start
sessions between then, with a separated proxy and registrar.
Has anyone done this before? Is possible to use kamailio like this?
Thanks.
*Bruno Emer*
Mobile: +55 11 96540-0044
<https://www.facebook.com/bruno.emer.5>
<https://www.linkedin.com/profile/view?id=86461237&trk=spm_pic>
<https://twitter.com/brunoemer_>
<http://google.com/+BrunoEmer> <http://instagram.com/brunoemer_>
Loading...