[Serusers] using variables, modifying "FROM" field

Piet Van den Abeele piet.van.den.abeele at telenet.be
Mon Feb 7 21:53:30 CET 2005


Hi,

In our telephony network, telephones have a private telephone number and 
a public telephone number. I want the CLIP to be the private telephone 
number when calls are made to other company phones, and CLIP to be the 
public telephone number when calling the outside world through the gateway.

eg:  private number: 911/XXXXX   <-> 02/52XXXXX  public number
                               921/XXXX   <-> 03/204XXXX
      and so on.
I know I could hardcode this in SER using something similar to 
subst("/^From:."(.*)sip:([^@]*@[a-zA-Z0-9.]+(.*))$/From: "+\1sip:+\2/"); 
(got that from a previous mail :)), but my numbering plan is too 
complicated, and changes too often to implement it that way.

I'd prefer it to be in some database table which I could access through 
some exec-statement. For Uri translation this would be easy with the 
exec_dst statement, but I can't see any way to put the outcome of an 
exec statement in some sort of variable, which I would then use in the 
subst() statement. Or am I overlooking something???

Thanks,
Piet





More information about the sr-users mailing list