<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/4.0.1">
</HEAD>
<BODY>
Hi Daniel,<BR>
<BR>
I have a couple of other jobs I am working on right now, but I will try and get these changes done this week in time for the code freeze.<BR>
<BR>
Thanks,<BR>
<BR>
Peter<BR>
<BR>
On Tue, 2011-08-16 at 16:15 +0200, Daniel-Constantin Mierla wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Hi Peter,

thanks for this enhancement, I find it very useful.

I have few remarks for potentially a better integration with available code:

a) lib/kcore/faked_msg.{c,h} offers already a way to get a fake SIP msg. 
It should be used instead of building a new one inside dispatcher 
module. The Makefile of the module has to be updated to link against 
internal libkcore

b) instead of using route blocks with names, I think it is better to 
define two new event_route blocks to be executed when a destination is 
un/available. There are several modules that are still running route 
blocks for non-sip message events, because they were developed long time 
ago, but for new implementations, whenever one needs to execute a block 
of actions from config file on an event which is not related to SIP 
message routing, should be done via event_route.

In this case, for example, can be used event_route[dispatcher:dst-down] 
and event_route[dispatcher:dst-up]. If they are defined, they will be 
executed. Checking for existence of these event routes can be done at 
startup, so no new module parameters are needed -- the names of the 
event routes will be &quot;known&quot; and reserved in the future. You can see 
inside htable module how event_route[htable:mod-init] is looked up and 
executed.

Using an event route instead of a route block will also clearly indicate 
that is not about SIP routing, therefore not all of the functions 
exported by modules work properly there.

Cheers,
Daniel

On 8/16/11 12:27 PM, Peter Dunkley wrote:
&gt; Module: sip-router
&gt; Branch: master
&gt; Commit: 085638299508ef6bf0c96673a663453da76d0a4f
&gt; URL:    <A HREF="http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=085638299508ef6bf0c96673a663453da76d0a4f">http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=085638299508ef6bf0c96673a663453da76d0a4f</A>
&gt;
&gt; Author: pd&lt;<A HREF="mailto:peter.dunkley@crocodile-rcs.com">peter.dunkley@crocodile-rcs.com</A>&gt;
&gt; Committer: pd&lt;<A HREF="mailto:peter.dunkley@crocodile-rcs.com">peter.dunkley@crocodile-rcs.com</A>&gt;
&gt; Date:   Tue Aug 16 11:24:44 2011 +0100
&gt;
&gt; modules_k/dispatcher: Added new feature that enables routes to be run when destinations fail/recover
&gt;
&gt; - Two new exported parameters ds_dst_unavailable_route and
&gt;    ds_dst_available_route allow you to specify routes to run when
&gt;    a destination is marked PROBING and unmarked PROBING respectively.
&gt;
&gt;    This is useful for integration with NMC and alarms equipment as
&gt;    these routes can be used to trigger/log these status changes.
&gt;
&gt; ---
&gt;
&gt;   modules_k/dispatcher/README                   |  114 ++++++++++++++++++-------
&gt;   modules_k/dispatcher/dispatch.c               |   64 ++++++++++++--
&gt;   modules_k/dispatcher/dispatch.h               |    5 +-
&gt;   modules_k/dispatcher/dispatcher.c             |   94 ++++++++++++++++++++
&gt;   modules_k/dispatcher/doc/dispatcher_admin.xml |   64 ++++++++++++++-
&gt;   5 files changed, 299 insertions(+), 42 deletions(-)
&gt;
&gt; Diff:   <A HREF="http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=085638299508ef6bf0c96673a663453da76d0a4f">http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=085638299508ef6bf0c96673a663453da76d0a4f</A>
&gt;
&gt; _______________________________________________
&gt; sr-dev mailing list
&gt; <A HREF="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</A>
&gt; <A HREF="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</A>

</PRE>
</BLOCKQUOTE>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<PRE>
-- 
Peter Dunkley
Technical Director
Crocodile RCS Ltd
</PRE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>