Module: kamailio
Branch: master
Commit: 8c59f8e782381811b1afb6a75b8b8c9fa6959933
URL: https://github.com/kamailio/kamailio/commit/8c59f8e782381811b1afb6a75b8b8c9…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2022-11-15T17:31:21+01:00
modules: readme files regenerated - app_python3 ... [skip ci]
---
Modified: src/modules/app_python3/README
---
Diff: https://github.com/kamailio/kamailio/commit/8c59f8e782381811b1afb6a75b8b8c9…
Patch: https://github.com/kamailio/kamailio/commit/8c59f8e782381811b1afb6a75b8b8c9…
---
diff --git a/src/modules/app_python3/README b/src/modules/app_python3/README
index f59291a078..914350572b 100644
--- a/src/modules/app_python3/README
+++ b/src/modules/app_python3/README
@@ -195,9 +195,9 @@ python_exec("my_python_function", "$rU");
in each worker when it next invokes a Python method. The module uses a
worker process lock to prevent recursive reloads.
- This function only reloads the user script and creates a new script
- object. It does not reinitialize the interpreter. E.g., references in
- the old module remain if not redefined by the new version.
+ This function only reloads (re-executes) the user script and creates a
+ new script object. It does not reinitialize the interpreter (references
+ in the old module remain if not redefined by the new version).
Name: app_python.reload
@@ -208,6 +208,24 @@ python_exec("my_python_function", "$rU");
kamcmd app_python.reload
...
+ Note that reload is done for the Python script provided as parameter to
+ this Kamailio module. To reload the Python libraries imported in this
+ script, use something like:
+...
+import mod1
+...
+import modN
+from importlib import reload
+
+def mod_init():
+ reload(mod1)
+ ...
+ reload(modN)
+ return kamailio()
+...
+
+ Where "modX" are the modules imported at the top.
+
5.2. app_python.api_list
List the functions available via Kemi framework.
Module: kamailio
Branch: master
Commit: 34d60608bea449ab7258a5d88894651303b80adf
URL: https://github.com/kamailio/kamailio/commit/34d60608bea449ab7258a5d88894651…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-11-15T17:24:23+01:00
app_python3: docs - added note about how Python modules used in script can be reloaded
---
Modified: src/modules/app_python3/doc/app_python3_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/34d60608bea449ab7258a5d88894651…
Patch: https://github.com/kamailio/kamailio/commit/34d60608bea449ab7258a5d88894651…
---
diff --git a/src/modules/app_python3/doc/app_python3_admin.xml b/src/modules/app_python3/doc/app_python3_admin.xml
index 0f4c63ffd0..67f6058020 100644
--- a/src/modules/app_python3/doc/app_python3_admin.xml
+++ b/src/modules/app_python3/doc/app_python3_admin.xml
@@ -203,12 +203,12 @@ python_exec("my_python_function", "$rU");
<para>
Marks the need to reload the Python script.
The actual reload is done in each worker when it next invokes a Python method.
- The module uses a worker process lock to prevent recursive reloads.
+ The module uses a worker process lock to prevent recursive reloads.
</para>
<para>
- This function only reloads the user script and creates a new script object.
- It does not reinitialize the interpreter.
- E.g., references in the old module remain if not redefined by the new version.
+ This function only reloads (re-executes) the user script and creates
+ a new script object. It does not reinitialize the interpreter (references
+ in the old module remain if not redefined by the new version).
</para>
<para>
Name: <emphasis>app_python.reload</emphasis>
@@ -222,6 +222,28 @@ python_exec("my_python_function", "$rU");
&kamcmd; app_python.reload
...
</programlisting>
+ <para>
+ Note that reload is done for the Python script provided as parameter
+ to this &kamailio; module. To reload the Python libraries imported
+ in this script, use something like:
+ </para>
+ <programlisting format="linespecific">
+...
+import mod1
+...
+import modN
+from importlib import reload
+
+def mod_init():
+ reload(mod1)
+ ...
+ reload(modN)
+ return kamailio()
+...
+ </programlisting>
+ <para>
+ Where "modX" are the modules imported at the top.
+ </para>
</section>
<section id="app_python3.r.api_list">
<title>
Hello,
as some of you may know from previous announcements, a few of us meet
tomorrow and the day after in Dusseldorf at sipgate.de for a Kamailio
development event. Should anyone want to join remotely, we can make
available a video conference bridge.
Join if you want to work together to add new features to Kamailio or
help improving existing tools and documentation. It is not an event for
discussing about Kamailio or how to use it.
Reply to this email (can be only to me this time) if you want to join
remotely and eventually provide the time you think you would be around
and, if you have something in mind, what you would like to work on. You
can also join if you don't have already something to work on, you can
become part of another team and help them.
You will receive privately the details of how to join the video
conference room.
Tomorrow we plan to to start the day around 10:30 Berlin time zone (UTC
+ 1), probably wrapping up around 17:00. The schedule for Thursday will
be given tomorrow once it is decided.
Cheers,
Daniel
--
Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda
Module: kamailio
Branch: master
Commit: 5ecae10fabb5da1911c7a7843ba3fb595bfb39e0
URL: https://github.com/kamailio/kamailio/commit/5ecae10fabb5da1911c7a7843ba3fb5…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Kamailio Dev <kamailio.dev(a)kamailio.org>
Date: 2022-11-10T12:01:36+01:00
modules: readme files regenerated - dialog ... [skip ci]
---
Modified: src/modules/dialog/README
---
Diff: https://github.com/kamailio/kamailio/commit/5ecae10fabb5da1911c7a7843ba3fb5…
Patch: https://github.com/kamailio/kamailio/commit/5ecae10fabb5da1911c7a7843ba3fb5…
---
diff --git a/src/modules/dialog/README b/src/modules/dialog/README
index d850087b7f..06e279ec4f 100644
--- a/src/modules/dialog/README
+++ b/src/modules/dialog/README
@@ -1814,7 +1814,7 @@ if(dlg_get_var("$var(ci)", "$var(ft)", "456", "test", "$var(tmp)"))
Meaning of the parameters is as follows:
* callid - SIP call-id.
* ftag - SIP From tag.
- * ttag - SIP To tag.
+ * ttag - SIP To tag. Use "" value to indicate early dialog.
* name - key name of the $dlg_var.
* value - string value to store at $dlg_var(name).
@@ -1827,6 +1827,11 @@ if(dlg_set_var("$var(ci)", "$var(ft)", "456", "test", "$var(tmp)"))
{
xdbg("set $$dlg_var(test):$var(tmp)\n");
}
+# you can set vars in early dialog too
+if(dlg_set_var("$var(ci)", "$var(ft)", "", "test", "$var(tmp)"))
+{
+ xdbg("set $$dlg_var(test):$var(tmp)\n");
+}
...
7.15. is_known_dlg()
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [x] Commit message has the format required by CONTRIBUTING guide
- [x] Commits are split per component (core, individual modules, libs, utils, ...)
- [x] Each component has a single commit (if not, squash them into one commit)
- [x] No commits to README files for modules (changes must be done to docbook files
in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change
- [ ] Small bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds new functionality)
- [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist:
<!-- Go over all points below, and after creating the PR, tick the checkboxes that apply -->
- [ ] PR should be backported to stable branches
- [x] Tested changes locally
#### Description
support setting vars for non established dialogs
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/3277
-- Commit Summary --
* dialog: dlg_set_var() support empty totag parameter
* dialog: add a note for early dialogs in dlg_set_var()
-- File Changes --
M src/modules/dialog/dialog.c (8)
M src/modules/dialog/doc/dialog_admin.xml (7)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/3277.patchhttps://github.com/kamailio/kamailio/pull/3277.diff
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/3277
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/pull/3277(a)github.com>