[Serusers] help: avpops question
Java Rockx
javarockx at yahoo.com
Wed Dec 1 00:41:08 CET 2004
Thanks! That got me pointed in the right direction. There was an error reported in syslog so I
played with the code you gave me a little and came up with this. I'm not sure I totally understand
the two avp_write() calls but it works.
If something is obviously incorrect please let me know. :-)
modparam("avpops", "avp_aliases", "from_addr=i:33;to_addr=i:34")
route {
# sanity checks, speed dial checks, alias lookups, etc
avp_write("$ruri","i:33");
avp_write("$from","i:34");
if (avp_check("i:34","eq/$ruri/i")) {
if (isflagset(31)) {
# send to voicemail since flag 31 is
# set from an acl lookup
route(4);
break;
} else {
sl_send_reply("486", "Busy");
break;
};
};
if (!lookup("location")) {
...
# continue processing
}
Regards,
Paul
--- Elena Ramona Modroiu <ramona at voice-system.ro> wrote:
> Hello,
>
> no need for MySQL to do this test. Try this:
>
> ...
>
> modparam("avpops","avp_aliases","from_addr=i:44")
> ...
>
> route{
> ...
> avp_write("$ruri","i:33");
> avp_write("$from","$from_addr");
> if (avp_check("i:33","eq/$from_addr/i"))
> {
> # here from_uri==request_uri
> ....
> }
> ...
> }
>
> It is better to check r-uri than To uri and do the check just before
> user location lookup, after looking up speeddial and aliases (To uri may
> contain an alias or a speeddial key and cannot be changed ...)
>
> Hope this helps,
> Ramona
>
>
> Java Rockx wrote:
>
> >Hi All.
> >
> >I'm using ser-0.8.99-dev19 and I'm trying to figure out how to get avpops to tell me if
> >(to_uri==from_uri) for INVITE messages.
> >
> >I want to do a quick test to see if a user is calling their own extension and route them to
> >voicemail accordingly.
> >
> >I'm having a bit of trouble understanding avpops. Do I need to use the database functionality
> to
> >do this or can I do it without MySQL?
> >
> >Anyhow here is about what I've got - but is wrong and I'm unclear on how to get this to work
> >
> >ser.cfg snippet:
> >
> >loadmodule "/usr/local/lib/ser/modules/avpops.so"
> >
> >route {
> >
> > # usual checks
> >
> > # REGISTER stuff
> >
> > if ((method=="INVITE") && is_user_in("Request-URI", "voicemail")) {
> >
>
> > if (avp_check("$from", "$to")) {
> > log(1, "Sending to Voicemail");
> > route(4);
> > };
> > };
> >
> > # lookup aliases stuff
> >
> > # etc
> >}
> >
> >route [1] {
> > # send to voicemail route
> >}
> >
> >But starting ser gives these errors
> >
> >AVPops - initializing
> >ERROR:avpops:parse_check_value: parse error in <$to> pos -135487828
> >ERROR:avpops:fixup_check_avp: failed to parse checked value
> >ERROR: fix_expr : fix_actions error
> >
> >Regards,
> >Paul
> >
> >
> >
> >
> >__________________________________
> >Do you Yahoo!?
> >Read only the mail you want - Yahoo! Mail SpamGuard.
> >http://promotions.yahoo.com/new_mail
> >
> >_______________________________________________
> >Serusers mailing list
> >serusers at lists.iptel.org
> >http://lists.iptel.org/mailman/listinfo/serusers
> >
> >
>
__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo
More information about the sr-users
mailing list