[Users] AVPOPS manipulating header fields

Bogdan-Andrei Iancu bogdan at voice-system.ro
Tue Apr 11 21:05:54 CEST 2006


Hi Martin,

do not use the from uri as a string uuid to perform loading, but use it 
as key (username, domain):
    avp_db_load("$from","s:pai/$scheme0");   in 1.0.x
or
    avp_db_load("$fu","s:pai/$scheme0");   in 1.1.x

in DB you will have to populate the username and domain fields instead 
of uuid.

regards,
bogdan

Martin Kjeldsen wrote:

> Hi all
>
> I am in the need for a little assistance on how to best use some data 
> taken from a invite request, and then create an appropriate AVP.
>
> My idea was to take the from header field,
>
>         avp_write("$from", "$fromuri");
>
> Then use it to extract the alias which belongs to this user, and 
> create the AVP,
>
>         avp_db_load("$fromuri","s:pai/$scheme0");
>
> And then incorperate it into another AVP, in order to add a callerid, 
> via P-Asserted-Identity,
>
>        avp_printf("i:10","<sip:$avp(s:pai)@sip.domain.com>");
>        remove_hf("P-Asserted-Identity"); #remove org. hdr
>        avp_pushto("$P-Asserted-Identity/request","i:10"); # set new hdr
>
> My question is, how do I best remove the port (eg. :5060) indication 
> at the end of the from header field?
> Because the clients on a private IP range and my alias table does not 
> carry the port numbers (eg. 88888888 at sip.domain.com ).
>
> So I need to manipulate the $fromuri, by removing the port indication, 
> before i do the avp_db_load!
>
> I was thinking of using the avp_subst function, but cant quite seem to 
> get it to work.
>
>
> Can anyone help me with a smart way to solve this problem?
>
>
> All help greatly appreciated.
>
>
> Kind regards
> Martin Kjeldsen
>
>
> _______________________________________________
> Users mailing list
> Users at openser.org
> http://openser.org/cgi-bin/mailman/listinfo/users
>





More information about the sr-users mailing list