[Serusers] setting prefix according to $SIP_HF_FROM?

sip sip at arcdiv.com
Mon Nov 7 20:27:08 CET 2005


As a workaround, could you not do a search on a regexp of the From header and
just do a couple of if-then cases...  i.e. 

If(search("^From: 999*@*")
{
  prefix("something");
}
else if(search("^From: 998*@*")
{
  prefix("something else");
};

?




On Mon, 7 Nov 2005 19:37:55 +0100, Gerd Feiner wrote
> hi,
> 
> is there some way, to prefix a given uri (=~[1-9]\d*, for example)  
> based on the From-header field?  suppose i want to extract a 
> specific  part (the area-code) from the From-header (like in 
> bla at 04711.sip...),  i want to add
> 
> prefix(echo $SIP_HF_FROM | sed 's/.*\@\([^.]*\)\..*/\1/')
> 
> or something like that in my SER config, but (even with the exec- 
> module, which isn't at all that flexible in my opinion) there seems  
> to be no way to accomplish this.  background is my previous mail  
> regarding aliases based on SIP_DOMAIN.  if i could just extract that 
>  area-code from the From-header, then i could easily prefix it to 
> the  To-header, so i would have no problems with aliases at all.
> 
> any clues?
> 
> brgds,
> g. feiner
> 
> _______________________________________________
> Serusers mailing list
> serusers at lists.iptel.org
> http://lists.iptel.org/mailman/listinfo/serusers




More information about the sr-users mailing list