<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>RE: [Serusers] configure SER to work as a gateway</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<BR>

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

</BODY>
</HTML>