Module: kamailio
Branch: master
Commit: 5f0792e7ee985b80601e6f952269bc48031e6356
URL: https://github.com/kamailio/kamailio/commit/5f0792e7ee985b80601e6f952269bc4…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2017-08-07T11:31:22+02:00
modules: readme files regenerated - topos ... [skip ci]
---
Modified: src/modules/topos/README
---
Diff: https://github.com/kamailio/kamailio/commit/5f0792e7ee985b80601e6f952269bc4…
Patch: https://github.com/kamailio/kamailio/commit/5f0792e7ee985b80601e6f952269bc4…
---
diff --git a/src/modules/topos/README b/src/modules/topos/README
index 3e42389014..cf4bce61f6 100644
--- a/src/modules/topos/README
+++ b/src/modules/topos/README
@@ -32,6 +32,11 @@ Daniel-Constantin Mierla
3.5. branch_expire (int)
3.6. dialog_expire (int)
3.7. clean_interval (int)
+ 3.8. event_callback (str)
+
+ 4. Event Routes
+
+ 4.1. event_route[topos:msg-outgoing]
List of Examples
@@ -42,6 +47,8 @@ Daniel-Constantin Mierla
1.5. Set branch_expire parameter
1.6. Set dialog_expire parameter
1.7. Set clean_interval parameter
+ 1.8. Set event_callback parameter
+ 1.9. Usage of event_route[topos:msg-outgoing]
Chapter 1. Admin Guide
@@ -62,6 +69,11 @@ Chapter 1. Admin Guide
3.5. branch_expire (int)
3.6. dialog_expire (int)
3.7. clean_interval (int)
+ 3.8. event_callback (str)
+
+ 4. Event Routes
+
+ 4.1. event_route[topos:msg-outgoing]
1. Overview
@@ -102,6 +114,7 @@ Chapter 1. Admin Guide
3.5. branch_expire (int)
3.6. dialog_expire (int)
3.7. clean_interval (int)
+ 3.8. event_callback (str)
3.1. storage (str)
@@ -188,3 +201,49 @@ modparam("topos", "dialog_expire", 3600)
...
modparam("topos", "clean_interval", 30)
...
+
+3.8. event_callback (str)
+
+ The name of the function in the KEMI configuration file (embedded
+ scripting language such as Lua, Python, ...) to be executed instead of
+ event_route[...] blocks.
+
+ The function receives a string parameter with the name of the event.
+
+ Default value is 'empty' (no function is executed for events).
+
+ Example 1.8. Set event_callback parameter
+...
+modparam("topos", "event_callback", "ksr_topos_event")
+...
+-- event callback function implemented in Lua
+function ksr_topos_event(evname)
+ KSR.info("===== topos module triggered event: " .. evname .. "\n");
+ return 1;
+end
+...
+
+4. Event Routes
+
+ 4.1. event_route[topos:msg-outgoing]
+
+4.1. event_route[topos:msg-outgoing]
+
+ It is executed before doing topology stripping processing for an
+ outgoing SIP message. If 'drop' is executed inside the event route,
+ then the module skips doing the topology hiding.
+
+ Inside the event route the variables $sndto(ip), $sndto(port) and
+ $sndto(proto) point to the destination. The SIP message is not the one
+ to be sent out, but an internally generated one at startup, to avoid
+ reparsing the outgoing SIP message for the cases when topology hiding
+ is not wanted.
+
+ Example 1.9. Usage of event_route[topos:msg-outgoing]
+...
+event_route[topos:msg-outgoing] {
+ if($sndto(ip)=="10.1.1.10") {
+ drop;
+ }
+}
+...
Module: kamailio
Branch: master
Commit: f6dc87151138e600d593a345109ba2028d2dc16f
URL: https://github.com/kamailio/kamailio/commit/f6dc87151138e600d593a345109ba20…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2017-08-07T11:23:53+02:00
topos: docs for event_callback param and event_route[topos:msg-outgoing]
---
Modified: src/modules/topos/doc/topos_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/f6dc87151138e600d593a345109ba20…
Patch: https://github.com/kamailio/kamailio/commit/f6dc87151138e600d593a345109ba20…
---
diff --git a/src/modules/topos/doc/topos_admin.xml b/src/modules/topos/doc/topos_admin.xml
index 77de4b8cbd..bda8ab766d 100644
--- a/src/modules/topos/doc/topos_admin.xml
+++ b/src/modules/topos/doc/topos_admin.xml
@@ -223,7 +223,66 @@ modparam("topos", "clean_interval", 30)
</programlisting>
</example>
</section>
-
+ <section id="topos.p.event_callback">
+ <title><varname>event_callback</varname> (str)</title>
+ <para>
+ The name of the function in the KEMI configuration file (embedded
+ scripting language such as Lua, Python, ...) to be executed instead
+ of event_route[...] blocks.
+ </para>
+ <para>
+ The function receives a string parameter with the name of the event.
+ </para>
+ <para>
+ <emphasis>
+ Default value is 'empty' (no function is executed for events).
+ </emphasis>
+ </para>
+ <example>
+ <title>Set <varname>event_callback</varname> parameter</title>
+ <programlisting format="linespecific">
+...
+modparam("topos", "event_callback", "ksr_topos_event")
+...
+-- event callback function implemented in Lua
+function ksr_topos_event(evname)
+ KSR.info("===== topos module triggered event: " .. evname .. "\n");
+ return 1;
+end
+...
+</programlisting>
+ </example>
+ </section>
+ </section>
+ <section>
+ <title>Event Routes</title>
+ <section>
+ <title>event_route[topos:msg-outgoing]</title>
+ <para>
+ It is executed before doing topology stripping processing for an outgoing
+ SIP message. If 'drop' is executed inside the event route, then the
+ module skips doing the topology hiding.
+ </para>
+ <para>
+ Inside the event route the variables $sndto(ip), $sndto(port) and
+ $sndto(proto) point to the destination. The SIP message is not the one
+ to be sent out, but an internally generated one at startup, to avoid
+ reparsing the outgoing SIP message for the cases when topology hiding
+ is not wanted.
+ </para>
+ <example>
+ <title>Usage of event_route[topos:msg-outgoing]</title>
+ <programlisting format="linespecific">
+...
+event_route[topos:msg-outgoing] {
+ if($sndto(ip)=="10.1.1.10") {
+ drop;
+ }
+}
+...
+</programlisting>
+ </example>
+ </section>
</section>
</chapter>
Hi,
I think, I found one issue with Daniel's new (great) TOPOS module:
I've configured it on my Edge-Proxy (aka. Proxy-CSCF) as a replacement
for an SBC and I ran into a strange issue.
Everything works fine, except in one Scenario:
Both A and B Party are registered using the same Proxy, so TOPOS is
triggered twice: On the originating Leg and on the terminating Leg.
It works properly, if I'm just having one Leg on the Proxy (either
because it's going to/coming from the Breakout Gateway or because the
B-Party registered using a different Proxy).
It appears to happen only, if the B-Party has a public IP, if no NAT
involved (Wtf?!?), it actually happened initially when I called my
mother.
I've looked through the source-code but couldn't find a proper
solution. Anyone an idea?
Thanks,
Carsten
P.S: Please find attached a full trace of such call and the according
database entries
--
Carsten Bock
CEO (Geschäftsführer)
ng-voice GmbH
Millerntorplatz 1
20359 Hamburg / Germany
http://www.ng-voice.com
mailto:carsten@ng-voice.com
Office +49 40 5247593-40
Fax +49 40 5247593-99
Sitz der Gesellschaft: Hamburg
Registergericht: Amtsgericht Hamburg, HRB 120189
Geschäftsführer: Carsten Bock
Ust-ID: DE279344284
Hier finden Sie unsere handelsrechtlichen Pflichtangaben:
http://www.ng-voice.com/imprint/