Re: [Serusers] configure SER to work as a gateway
by "Martínez García, Rebeca"
Hi all,
Thanks Rupert for your answer, I realise that my explanation was not very clear but the scenario I am
working into is a little bit complex.
Finally, I have decided to change my configuration and make the client sends its REGISTER message to
SER and then it will forward the same message to my Server. However, the Server carries out the authentication
process (I can not change it), so SER has to save the location contact after the client is authenticated in the Server.
My function for the REGISTER message in SER is the following one:
route[REGISTER]
{
t_newtran();
# send the register to the proxy
rewritehostport("open-ims.test:4060");
t_on_reply("REGISTER_reply");
#t_on_failure("REGISTER_failure");
if (!t_relay()) {
sl_send_reply("500","Error forwarding to P-CSCF");
break;
}
}
onreply_route[REGISTER_reply]
{
if (t_check_status("401")){
log(-1, "A response from the P-CSCF!");
break;
}
if (t_check_status("200")){
log(-1, "User registered in the IMS Core!");
save_contacts("location");
break;
}
}
But SER does not start. It shows this error:
cng@cng:~$ sudo /etc/init.d/ser start -P /var/run/ser/ser.pid
Starting ser: ser 0(2545) parse error (147,19-20): Command cannot be used in the block
I have checked where is the error and it complains about the "save_contacts("location"))", but I
do not know why I can not use it inside the onreply_route.
Thanks in advance,
Rebeca Martinez
-----Mensaje original-----
De: rupert.organ(a)bt.com [mailto:rupert.organ@bt.com]
Enviado el: vie 08/01/2010 15:03
Para: Martínez García, Rebeca
Asunto: RE: [Serusers] configure SER to work as a gateway
Hi Rebeca,
I think I understand what you are trying to do, albeit you describe it in a strange way.
SER is designed to be a Registrar / SIP Proxy.
It is not designed to proxy REGISTER messages.
However I had to interface it to a SIP Application Server that wanted to see the REGISTER messages. However SER was my REGISTRAR and performed my security / authentication.
Therefore I filter on the REGISTER messages using
if (method=="REGISTER") {
after doing the auth challenge in the ser.cfg, and after doing an eNum lookup and some user agent field checks I simply t_replicate the REGISTER.
i.e. t_replicate("rebeca.node.es.com", "5060");
or if you do not use DNS
t_replicate("10.1.x.y", "5060");
Note this replication does not include the auth challenge....but it satisfys my SIP app server functionality nicely,
Also you can overwrite the useragent field if you wish...
e.g. if (subst_uri("/;userAgent=rupert")) {
subst('/^User-Agent:.*$/User-Agent: Rebeca/ig');
Good luck
Rupert
________________________________
From: serusers-bounces(a)lists.iptel.org [mailto:serusers-bounces@lists.iptel.org] On Behalf Of "Martínez García, Rebeca"
Sent: 08 January 2010 11:52
To: serusers(a)lists.iptel.org
Cc: "Huertas García, Victor"
Subject: [Serusers] configure SER to work as a gateway
Hello all,
Solved the installation problem I had, now I am trying to configure SER in a certain way.
My configuration is the following one:
Client ------------------------- SER ---------------------------- Server/Proxy
192.168.x.x 192.168.x.y 10.1.x.x 10.1.x.y
Unlike the normal case where SER is used as the Registrar, my client (in a private LAN) must register in a Server/Proxy
and SER has to act as a SIP gateway. However, at the same time, SER has to register locally this client (for internal calls).
So, put in other words, SER should forward the REGISTER message (directed from the client to the Server/Proxy) and save locally the
location of that client. Once registered the user, SER should act as a transparent proxy.
But in the practice, it does nothing if I put that the client registers in the Server/Proxy. The messages reach SER but it does not
forward them, nor it registers locally the clients.
So I tried configuring the client to register in SER instead of the Server/Proxy and then SER started to work.
Is a listening problem? What I have to include to the ser.cfg so SER handles also messages which are not directed to it but to the Server/Proxy?
I hope somebody could help me.
Thanks in advance,
Rebeca Martinez