[asterisk-dev] Problem with Asterisk realtime ?

Oded Arbel oded at atelis.net
Thu Oct 12 09:30:29 MST 2006


I'm having what appears to be a refresh issue with Asterisk realtime
when using Asterisk trunk (version 44743).

The issue is with channel variables read from sippeers's "setvar" by
asterisk realtime. I have realtime configured for sippeers using a mysql
database, in which a 'setvar' column exists and is populated as
'testvar=123'. 

I can see the column's current value when using "realtime load" from the
Asterisk CLI:

*CLI> realtime load sippeers name 2006
                   Column Name  Column Value
          --------------------  --------------------
                            id  2
                          name  2006
                           ...  ...
                        setvar  testvar=123

And in the dial plan, I have a Set command, in a macro that reads this
value:

[local]
exten = _.,1,Macro(read-testvar)
exten = _.,n,Goto(outgoing-dial,${EXTEN},1)

[macro-read-testvar]
exten = s,1,GotoIf($[${testvar} = ""]?end)
exten = s,n,Set(TEMPVAR=${testvar})
exten = s,n(end),NoOp()


The problem is that I see the Set command being run in Asterisk console
and sets the correct value as it is in the database. I then modify the
value in the database, and even do 'realtime load' again to see that it
was changed. I then dial again to have the dialplan run, but the value
being used for Set is the old value before I updated it. Only doing 'sip
reload' on the console causes the new variable value to be used.

Funny thing though - I was sure that it was working correctly this
morning.. I did restart the asterisk several times, just to see if this
would cause it to behave, but no luck. I just tested and other settings
(such as 'secret' and 'name') don't refresh either. Adding a new sip
peer to the realtime database does work immediately without a reload.

My extconfig.conf looks like this:

[settings]
sippeers => mysql,asterisk,sip_peers
extensions.conf => mysql,asterisk,ast_config

Is it possible that I'm missing some setting ?

--
Oded Arbel
Atelis
oded at atelis.net
Tel: +972-54-7340014
::..
"I drink to make other people interesting."
    -- George Jean Nathan




More information about the asterisk-dev mailing list