[Serusers] setting prefix according to $SIP_HF_FROM?
Gerd Feiner
g.feiner at cablesurf.de
Mon Nov 7 22:55:26 CET 2005
yeah,
this is what i do now, with about 7 different prefixes this is not a
problem. but i am thinking when we have more than 200 or so
prefixes ... then a single search would be much better, wouldn't it?
Am 07.11.2005 um 20:27 schrieb sip:
> 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