[asterisk-users] Using HASH() and REALTIME_HASH()

Tilghman Lesher tlesher at digium.com
Sun Jan 10 00:53:04 CST 2010


On Saturday 09 January 2010 15:22:29 Benoit wrote:
> I'm playing around with asterisk 1.6.2.0 and the first try was to
> replace my now non-functionning
> 'app-realtime' macro which emulated RealTime with REALTIME_HASH()
>
> There is very few documentation on the subject except for this bug report:
>         https://issues.asterisk.org/view.php?id=13651#c94998
>
> However when i try this syntax:
> Set(HASH(info)=${REALTIME_HASH(call_info,exten,${dest})});
> the syntax doesn't seem to be happy:
>
>     -- Executing [s at appel_deb:8] Set("SIP/maverick-00000000",
> "HASH(info)=,101,maverick,0,0,max,0,0,123456,123654") in new stack
> [Jan  9 22:07:25] WARNING[27801]: pbx.c:9107
> pbx_builtin_setvar_multiple: MSet: ignoring entry '101' with no '=' (in
> s at appel_deb:8
> [Jan  9 22:07:25] WARNING[27801]: pbx.c:9107
> pbx_builtin_setvar_multiple: MSet: ignoring entry 'maverick' with no '='
> (in s at appel_deb:8
> [Jan  9 22:07:25] WARNING[27801]: pbx.c:9107
> pbx_builtin_setvar_multiple: MSet: ignoring entry '0' with no '=' (in
> s at appel_deb:8
> [Jan  9 22:07:25] WARNING[27801]: pbx.c:9107
> pbx_builtin_setvar_multiple: MSet: ignoring entry '0' with no '=' (in
> s at appel_deb:8
> ....
>
> I had to do the following:
> Set(HASH(info)="${REALTIME_HASH(call_info,exten,${dest})}");    (adding
> of double quote)

Yes, this is because you're on a machine that you upgraded from 1.4.  This
makes Set get the old 1.4 behavior that I tried to leave behind.  In your
asterisk.conf file, create or modify the following section:

[compat]
app_set=1.6

and it will start working beautifully, in an intuitively obvious way.

-- 
Tilghman Lesher
Digium, Inc. | Senior Software Developer
twitter: Corydon76 | IRC: Corydon76-dig (Freenode)
Check us out at: www.digium.com & www.asterisk.org



More information about the asterisk-users mailing list