[asterisk-users] Hint for realtime peers
Tilghman Lesher
tlesher at digium.com
Sat Jan 16 22:57:15 CST 2010
On Saturday 16 January 2010 14:28:14 Leif Neland wrote:
> Tilghman Lesher skrev:
> > On Saturday 16 January 2010 11:02:52 Deep D wrote:
> >> On Sat, Jan 16, 2010 at 9:21 PM, Tilghman Lesher <tlesher at digium.com>
wrote:
> >>> On Saturday 16 January 2010 06:04:01 Deep D wrote:
> >>>> When I create a sip peer in users.conf then a hint is automatically
> >>>> created for that peer. But when I create a peer in sip.conf or a
> >>>> realtime peer with the same values then this hint is not created.
> >>>> Every time I add such peers I have to add a hint in extensions.conf.
> >>>>
> >>>> Is it possible to have something like exten =>
> >>>> _XXX,hint,SIP/${EXTEN} in extensions.conf so that I don't have to
> >>>> add hint for each sip peer I create?
> >>>
> >>> Only in 1.6.1 and later. The hints will grow, as phones subscribe to
> >>> them, one entry per hint, automatically.
> >>
> >> I tried this in asterisk 1.6.1.1 by adding the line exten =>
> >> _XXX,hint,SIP/${EXTEN} to the default context, but it did not work.
> >>
> >> I gave the following commands through the manager interface
> >>
> >> action: extensionstate
> >> exten: 777
> >>
> >> and the response was
> >>
> >> Response: Success
> >> Message: Extension Status
> >> Exten: 777
> >> Context: default
> >> Hint: SIP/${EXTEN}
> >> Status: 0
> >>
> >> I am always getting a Status: 0 for any value of exten. I think the
> >> variable ${EXTEN} is not being evaluated to its value.
> >
> > That's not a subscription. You must actually get a phone to subscribe to
> > the hint before it is created.
>
> Might be true for "dynamic" hints.
> But for static hints it's not.
Thank you, Captain Obvious. I am trying to explain to the OP what he did
wrong and how to make it work correctly. He is not using static hints; he
is attempting to use dynamic hints, so an explanation of how static hints
work is not warranted, unless you're going to explain the difference.
> > arnold*CLI> core show hints
> > arnold*CLI>
> > -= Registered Asterisk Dial Plan Hints =-
> > 6 at hintcontext : SIP/6
> > State:Idle Watchers 0
> > 5 at hintcontext : SIP/jesperfon
> > State:Idle Watchers 1
>
> I have several "unused" hints.
If he had a phone subscribe to the dynamic hints and unsubscribe, the hint
would continue to exist until he performed a reload. This is how dynamic
hints work -- they are created as needed and disappear on reload, if they are
no longer being watched.
If, on the other hand, you are saying that the behavior needs more explanation
or documentation or perhaps the hint needs to be evaluated in more places,
that was not clear. Were someone to make such a suggestion AFTER
understanding what makes dynamic hints work, that would be a welcome
suggestion, and I also think it would be quite doable.
--
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