[OpenSIPS-Users] Loading rpid_avp from auth

Sergio Gutierrez saguti at gmail.com
Sun Feb 22 23:27:11 CET 2009


Hi Julian.

On Sun, Feb 22, 2009 at 4:44 PM, Julian Yap <julianokyap at gmail.com> wrote:

> Sergio and OpenSIPS users,
>
> Damn, I feel so stupid.  Changing that modparam worked for me.
>

Do not worry; these things are a continuous learning process.


>
> For those wondering, here is how I load it up:
> if ($avp(s:rpid)) {
>            append_hf("P-Asserted-Identity: <sip:$avp(s:rpid)@$fd>\r\n");
> };
>
> One general question on AVP's.  When I select AVP to have an integer
> value 302 in the modparam statement, what is 302?  Is that just an
> arbitrary value?  Or is value '302' preassigned somewhere?  I'm
> working from examples and AVP's are still kind of confusing.
>

302 is just an index; when you define an AVP, you could name it with a
string or with a integer; you choose at your will the integer index or the
string you use; AVP with integer indexes are faster to handle within
OpenSIPS Core; AVP with String names are easier to remember for Script
writer.

You cand find more information about AVP's at:

http://www.voice-system.ro/docs/avpops/index.html
http://www.opensips.org/html/docs/modules/1.4.x/avpops.html

Feel free to keep asking about anything you do not understand well.

Best regards.

Sergio.



>
> - Julian
>
> On Sun, Feb 22, 2009 at 8:08 AM, Sergio Gutierrez <saguti at gmail.com>
> wrote:
> >
> > Hi Julian.
> >
> > Are you using the syntax you pasted for modparam?
> >
> > Try the following syntax:
> >
> > modparam("auth|lcr", "rpid_avp", "$avp(i:302)")
> >
> > Regards.
> >
> > Sergio G.
> >
> >
> > On Sun, Feb 22, 2009 at 7:36 AM, Julian Yap <julianokyap at gmail.com>
> wrote:
> >>
> >> Hi all,
> >>
> >> I'm intending on loading rpid_avp from auth.  This will be used with a
> >> P-Asserted-Identity header.  I am storing the RPID in the 'rpid' of
> >> the subscriber column of my database.
> >>
> >> I believe that s:rpid should then get loaded during authentication but
> >> I think I'm missing something.
> >>
> >> Here is my module load line:
> >> modparam("^auth$|lcr", "rpid_avp", "$avp(i:302)")
> >>
> >> Then later on, setting the $avp(i:302) manually works:
> >> $avp(i:302) = "<sip:8085331000 at mysip.server.com<sip%3A8085331000 at mysip.server.com>
> >";
> >> append_hf("P-Asserted-Identity: $avp(i:302)\r\n");
> >>
> >> Any clues here?  Basically I want to eliminate the line where I'm
> >> hard-coding in the $avp(i:302) value.  I'm kinda confused with the
> >> documentation and haven't found any examples.
> >>
> >> Thanks,
> >> Julian
> >>
> >> _______________________________________________
> >> Users mailing list
> >> Users at lists.opensips.org
> >> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> >
> >
> >
> > --
> > Sergio Gutiérrez
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20090222/e1bc7177/attachment-0001.htm 


More information about the Users mailing list