[asterisk-dev] Dynamically removing a provider registration entry
Craig Edwards
craig at haenterprises.com.au
Fri Oct 27 00:53:01 MST 2006
Johansson Olle E wrote:
> You propably want to send an unregister request to the service before
> you disable the entry.
Good idea, but the challenge with doing that is when I fire off the
expiry=0 message (ie. unregister) my thread will (likely) have finished
before asterisk has finished processing the asynchronous replies, so I
would need to be careful not to delete the entry out from underneath the
working unregister conversation. Not sure how I can work around this...
maybe I can send the unregister and then add an entry to the schedule to
actually delete it in 10 seconds (or some such timeout).
> There's propably something else holding a reference pointer to the
> object, thus sip_registry_destroy does not
> get called.
I believe this is why I need to fiddle with the registry->regattempts
count because for the non-Registered proxies (the Registered guys work
just fine), the scheduler is holding a reference (to retry every 120
secs). And the sip_reg_timeout just keeps adding the entry back into
the scheduler until it has tried the maximum times. By setting the
count to a huge value, it stops sip_reg_timeout from adding it back to
the scheduler, and so the last reference is released. However, it seems
to be working a little more by side-effect than I would like... I am
curious if anyone has had to do a similar thing, or if there are other
similarly subtle issus I may strike with this approach.
Thanks a lot.
--
Craig
More information about the asterisk-dev
mailing list