[Users] lookup function for From URI

unplug maillisting at gmail.com
Thu Jan 5 04:59:59 CET 2006


In aliases table, I want to search the username field as value column
according to the contact field.  I have add some codes in the
configuration file but it doesn't work.

modparam("avpops","db_scheme","scheme1:table=aliases;username_column=contact;value_column=username")
...
        if (avp_db_load("$from/uri","s:alias/$scheme1")) {
                xlog("L_INFO","sip414: load avp_print()\n");
                avp_print();
        } else {
                xlog("L_INFO","sip417: no alias from aliases found\n");
        };
...

After studying the web about avpop module, it is designed to work in
usr_preferences table or similar tables.  I know that there should be
a mistake in my setting.  However, I have no idea what's wrong in it. 
Anyone can help to fix it?  Is it possible to use avpop module in
aliases table?


On 1/4/06, Daniel-Constantin Mierla <daniel at voice-system.ro> wrote:
> You have to use avp db schema to load values from tables that have other
> structure than usr_preferences table. See:
>
> http://voice-system.ro/docs/avpops/ar01s05.html#db_scheme
> http://voice-system.ro/docs/avpops/ar01s06.html#avp_db_load
>
> Cheers,
> Daniel
>
>
> On 01/04/06 06:25, unplug wrote:
> > I have an alias in the aliases table that mapped with an account.  I
> > have tried avp_db_load("$from/uri","s:/aliases") but the following
> > error displayed.
> > Jan  4 12:17:14 zzzsipx /usr/local/sbin/openser[2792]: submit_query:
> > Unknown column 'value' in 'field list'
> > Jan  4 12:17:14 zzzsipx /usr/local/sbin/openser[2792]: db_query: Error
> > while submitting query
> > Jan  4 12:17:14 zzzsipx /usr/local/sbin/openser[2792]:
> > ERROR:avpops:load_avps: db_load failed
> >
> > In the aliases table, there is no value field.  AVP uses to search the
> > value field for the value.  Am I right?
> > For my case, I want to get the alias of an account in the aliases
> > table according to the From header.  Can I still use avp_db_load?
> > How?
> >
> > Thanks!
> >
> > On 1/4/06, Daniel-Constantin Mierla <daniel at voice-system.ro> wrote:
> >
> >> You can load the alias value form any table in an AVP using avpops
> >> module. See:
> >> http://voice-system.ro/docs/avpops/ar01s06.html#avp_db_load
> >>
> >> The you can use uac_replace_from(display,uri) with pseudo-variables in
> >> parameters.
> >>
> >> Cheers,
> >> Daniel
> >>
> >>
> >> On 01/03/06 10:27, unplug wrote:
> >>
> >>> As I know, we can use lookup function for lookup an alias of an RURI.
> >>> It is for inbound call.  How about the outbound call?  Say, I have an
> >>> account (881234) with an alias (24568849).  Someone can call the alias
> >>> to reach the account (881234) by using lookup function.  How can I
> >>> make outbound call such that the caller number will be replaced by the
> >>> alias?  As I know we can use uac_replace_from(display,uri) to replace
> >>> the from URI.  But I have no idea how to retrieve an alias from the
> >>> >From URI.  Any clue?
> >>>
> >>> _______________________________________________
> >>> Users mailing list
> >>> Users at openser.org
> >>> http://openser.org/cgi-bin/mailman/listinfo/users
> >>>
> >>>
> >>>
> >
> >
>




More information about the sr-users mailing list