[asterisk-users] Realtime SIP peers - reloading cached info

Atis Lezdins atis at iq-labs.net
Tue Feb 12 04:30:46 CST 2008


On 2/12/08, Rob Hillis <rob at hillis.dyndns.org> wrote:
>
>  If this is the only real alternative, then in this instance I'll stick with
> using the System command.  Writing an AGI to execute two manager commands in
> this case is even greater overkill than using the System command.
>
>  I understand that normally anything that calls multiple manager commands
> would usually be something complex enough to justify an AGI.  The exception
> seems to be when you're dealing with cached realtime data. (is it just me,
> or does that sound like a rather odd oxymoron?)
>
>
>  ast guy wrote:
>  > why don't you write an AGI which talks to asterisk manager API 5038 port
> and executes the asterisk commands. You execute asterisk command via agi not
> using system command
>  >
>  > -ag
>  >
>  > On Feb 11, 2008 11:24 AM, Rob Hillis <rob at hillis.dyndns.org
> <mailto:rob at hillis.dyndns.org>> wrote:
>  >
>
> Hi guys,
>
>  I've been working on a little dialplan fragment for roaming extensions,
>  however the customer wants us to set the MWI indicator for the roaming
>  extension that has just logged in.  We're using MySQL realtime, so I've
>  figured out that RealTimeUpdate will happily update the realtime
>  database with the correct mailbox.  My problem comes when I need to tell
>  Asterisk to flush the realtime data for that extension and reload it so
>  that the cached data is correct.  Running the commands "sip prune
>  realtime peer XXX" followed by "sip show peer XXX load" work fine from
>  the Asterisk manager interface and correctly update the cached data so
>  the MWI indicator works fine.
>
>  What I want to know is if there is any better method of running manager
>  API commands from within the dialplan than the horribly ugly
>  System(asterisk -rx "sip prune realtime peer XXX")  It works, but from
>  my point of view, it's a somewhat nasty hack.
>
>  Anyone have any suggestions?

You could write dialplan application to do the same in chan_sip. Code
should be very simple, just the processing of one argument and reusing
existing functions. If you'll argument good enough why you need it, i
think it could be included in asterisk.

Regards,
Atis


-- 
Atis Lezdins
VoIP Developer,
IQ Labs Inc.
atis at iq-labs.net
Skype: atis.lezdins
Cell Phone: +371 28806004
Work phone: +1 800 7502835



More information about the asterisk-users mailing list