[Serusers] Use of fifo for registration :ul_add: command tutorial

Samuel Osorio Calvo samuel.osorio at nl.thalesgroup.com
Tue Jun 28 10:40:25 CEST 2005


Try the following.....

#################################################
#!/bin/sh

cat> /tmp/ser_fifo << 
:ul_add:return_fifo
location
sip:user at domain
sip:user at IP
{expires}
{qvalue}
{replicate}
{flags}


##################################################

return_fifo is the name of the fifo (with a /tmp prefix) that will use SER for answering to the fifo command.If you don't want to read it, just don't worry about the possible complaint of FIFO not existing, error opening return fifo or something like that in SER log.
location is the table where to add/update the record
sip:user at domain-->AoR    
you might have to look at SER's debug output because I remember there was something with sip: prefix in either AoR or contact. I think using sip: will work but just check if you have to remove the sip: prefix from the contact....
sip:user at IP-->contact
expires-->record validity in seconds
qvalue-->[0..1]
replicate-->bool 0|1
flags-->not 100% sure if it corresponds to the flag vector of SER or just indicate natted contacts...I recommend to use a 0 value here..
Remember to add an End Of File character in the last line or there are some funny parsing things with subsequent messages isnerted in the fifo...


Hope it helps,

Samuel.


Unclassified.
>>> "Rodrigue ESTEVE" <rodrigue at mobius.fr> 06/28/05 09:13AM >>>
Does anybody have an explanation to use the fifo for registration (using a
script and not the serctl command) ?

 

Thanks very much

 

  _____  

De : serusers-bounces at iptel.org [mailto:serusers-bounces at lists.iptel.org] De la
part de Rodrigue ESTEVE
Envoyé : mardi 14 juin 2005 19:00
À : serusers at lists.iptel.org 
Objet : [Serusers] Use of fifo for registration :ul_add: command tutorial

 

Hi all,

 

I would like to use ser_fifo to register a user; I think the :ul_add:
command is the clue, but I don't how to use the fifo to do this.

 

My aim is to do the following:

I have a Voip gateway on a customer with a lot of phone number (700) and I
would like to authenticate each number. Unfortunately I have to add a small
amount of configuration on the voip gateway each time I add a number (uri),
moreover I'm not sure this gateway will work with so many numbers, and the
bandwidth needed to register each number every 5 minutes will be wasted.

 

The idea is to challenge only one time the gateway and then in ser.cfg if
the challenge succeeds I execute a script to register by bulk all the
numbers enclosed in a file on the proxy. To do this I have to pass arguments
to the fifo using the :ul_add: command, but this is where I'm stuck.

 

I've done this:

 

echo :ul_add:receiving_fifo > /tmp/ser_fifo

echo location > /tmp/ser_fifo

echo 100 > /tmp/ser_fifo

echo <sip:100 at 10.1.1.1:5060> > /tmp/ser_fifo

echo 300 > /tmp/ser_fifo

echo 0 > /tmp/ser_fifo

echo 2 > /tmp/ser_fifo

 

but it does not work, I think this is due to the receiving_fifo, I have to
do something with it to process the response of SER, but what ??

 

I know I can use the following command to workaround the pbm, and I'm
successful with this command:

Serctl fifo ul_add location *..

 

But it requires one process each time I register a number, and it takes 1
minute on a Celeron 700 for 500 numbers (30 % CPU), and I think using the
fifo is a more suitable solution (less CPU consuming).

 

Thanks for your support,

 

Rodrigue

 

PS: I would like to register every 5minutes,cause the customer gateway is
able to redirect to PSTN in case of failure.

 

 




More information about the sr-users mailing list