These methods allow setting/getting pseudo variable values from Python module.
<!-- Kamailio Pull Request Template -->
<!--
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
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
Two new methods msg_get_pv and msg_set_pv are added to app_python/python_msgobj.c
In python script, we can call *msg.set_pv* or *msg.get_pv* to set/get value from a pseudo variable
```
class RouteHelper:
def normalize_number(self, msg, number):
ret = number
if number.startswith('00'):
ret = '+' + number[2:]
elif number.startswith('0'):
ret = '+33' + number[1:]
msg.set_pv("$var(normalized_number)", ret)
return 1
def mod_init():
return RouteHelper()
```
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/1612
-- Commit Summary --
* app_python: Ability to get/set pseudo variable value from Python module
-- File Changes --
M src/modules/app_python/python_msgobj.c (92)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/1612.patchhttps://github.com/kamailio/kamailio/pull/1612.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/1612
Module: kamailio
Branch: 5.1
Commit: 877d753acf18691b9d8b2208b57c085721151b38
URL: https://github.com/kamailio/kamailio/commit/877d753acf18691b9d8b2208b57c085…
Author: Henning Westerholt <hw(a)kamailio.org>
Committer: Henning Westerholt <hw(a)kamailio.org>
Date: 2018-08-13T21:21:43+02:00
uac: fix typo in module README
(cherry picked from commit 00ba2193d60e8255ea863a99b52e86f841f16bdb)
---
Modified: src/modules/uac/doc/uac_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/877d753acf18691b9d8b2208b57c085…
Patch: https://github.com/kamailio/kamailio/commit/877d753acf18691b9d8b2208b57c085…
---
diff --git a/src/modules/uac/doc/uac_admin.xml b/src/modules/uac/doc/uac_admin.xml
index 052bc2dc7a..a0520ece71 100644
--- a/src/modules/uac/doc/uac_admin.xml
+++ b/src/modules/uac/doc/uac_admin.xml
@@ -987,7 +987,7 @@ event_route[uac:reply] {
Return the details of a remote registration record based on
a filter. The command has two parameter: attribute and value.
The attribute can be: l_uuid, l_username, r_username or auth_username.
- The value is what should be matcheg against the value of the attribute
+ The value is what should be matched against the value of the attribute
in the remote registration record.
</para>
<para>
@@ -1029,7 +1029,7 @@ event_route[uac:reply] {
Enable a remote registration record based on
a filter. The command has two parameter: attribute and value.
The attribute can be: l_uuid, l_username, r_username or auth_username.
- The value is what should be matcheg against the value of the attribute
+ The value is what should be matched against the value of the attribute
in the remote registration record.
</para>
<example>
@@ -1050,7 +1050,7 @@ event_route[uac:reply] {
Disable a remote registration record based on
a filter. The command has two parameter: attribute and value.
The attribute can be: l_uuid, l_username, r_username or auth_username.
- The value is what should be matcheg against the value of the attribute
+ The value is what should be matched against the value of the attribute
in the remote registration record.
</para>
<example>
Module: kamailio
Branch: 5.0
Commit: 4552c85c36f1e1b5abda7b29c7c453467f4b8ec1
URL: https://github.com/kamailio/kamailio/commit/4552c85c36f1e1b5abda7b29c7c4534…
Author: Henning Westerholt <hw(a)kamailio.org>
Committer: Henning Westerholt <hw(a)kamailio.org>
Date: 2018-08-13T21:20:57+02:00
uac: fix typo in module README
(cherry picked from commit 00ba2193d60e8255ea863a99b52e86f841f16bdb)
---
Modified: src/modules/uac/doc/uac_admin.xml
---
Diff: https://github.com/kamailio/kamailio/commit/4552c85c36f1e1b5abda7b29c7c4534…
Patch: https://github.com/kamailio/kamailio/commit/4552c85c36f1e1b5abda7b29c7c4534…
---
diff --git a/src/modules/uac/doc/uac_admin.xml b/src/modules/uac/doc/uac_admin.xml
index f409454196..a3d4b7b840 100644
--- a/src/modules/uac/doc/uac_admin.xml
+++ b/src/modules/uac/doc/uac_admin.xml
@@ -987,7 +987,7 @@ event_route[uac:reply] {
Return the details of a remote registration record based on
a filter. The command has two parameter: attribute and value.
The attribute can be: l_uuid, l_username, r_username or auth_username.
- The value is what should be matcheg against the value of the attribute
+ The value is what should be matched against the value of the attribute
in the remote registration record.
</para>
<para>
@@ -1029,7 +1029,7 @@ event_route[uac:reply] {
Enable a remote registration record based on
a filter. The command has two parameter: attribute and value.
The attribute can be: l_uuid, l_username, r_username or auth_username.
- The value is what should be matcheg against the value of the attribute
+ The value is what should be matched against the value of the attribute
in the remote registration record.
</para>
<example>
@@ -1050,7 +1050,7 @@ event_route[uac:reply] {
Disable a remote registration record based on
a filter. The command has two parameter: attribute and value.
The attribute can be: l_uuid, l_username, r_username or auth_username.
- The value is what should be matcheg against the value of the attribute
+ The value is what should be matched against the value of the attribute
in the remote registration record.
</para>
<example>
Hello,
sorry for the wrong cherry-pick to the README files in the stable branches, I
was misguided from the git output. Will not happen again.
Best regards,
Henning
--
Henning Westerholt
https://skalatan.de/blog/
Module: kamailio
Branch: 5.1
Commit: c87df98e726cf5acefa4ea6d382602c88dc76919
URL: https://github.com/kamailio/kamailio/commit/c87df98e726cf5acefa4ea6d382602c…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Henning Westerholt <hw(a)kamailio.org>
Date: 2018-08-13T21:18:25+02:00
modules: readme files regenerated - uac ... [skip ci]
(cherry picked from commit d6eff66b185d442d0848a03c5b4681d6ab74373a)
---
Modified: src/modules/uac/README
---
Diff: https://github.com/kamailio/kamailio/commit/c87df98e726cf5acefa4ea6d382602c…
Patch: https://github.com/kamailio/kamailio/commit/c87df98e726cf5acefa4ea6d382602c…
---
diff --git a/src/modules/uac/README b/src/modules/uac/README
index 848279a2c2..a69d481a2f 100644
--- a/src/modules/uac/README
+++ b/src/modules/uac/README
@@ -838,7 +838,7 @@ event_route[uac:reply] {
Return the details of a remote registration record based on a filter.
The command has two parameter: attribute and value. The attribute can
be: l_uuid, l_username, r_username or auth_username. The value is what
- should be matcheg against the value of the attribute in the remote
+ should be matched against the value of the attribute in the remote
registration record.
The state of the registration is reflected in the flags field:
@@ -859,7 +859,7 @@ event_route[uac:reply] {
Enable a remote registration record based on a filter. The command has
two parameter: attribute and value. The attribute can be: l_uuid,
l_username, r_username or auth_username. The value is what should be
- matcheg against the value of the attribute in the remote registration
+ matched against the value of the attribute in the remote registration
record.
Example 1.33. uac.reg_enable usage
@@ -872,7 +872,7 @@ event_route[uac:reply] {
Disable a remote registration record based on a filter. The command has
two parameter: attribute and value. The attribute can be: l_uuid,
l_username, r_username or auth_username. The value is what should be
- matcheg against the value of the attribute in the remote registration
+ matched against the value of the attribute in the remote registration
record.
Example 1.34. uac.reg_disable usage
Module: kamailio
Branch: 5.0
Commit: 97bbdb67d31e0f4d73f56fc19d01c2152a0af005
URL: https://github.com/kamailio/kamailio/commit/97bbdb67d31e0f4d73f56fc19d01c21…
Author: Kamailio Dev <kamailio.dev(a)kamailio.org>
Committer: Henning Westerholt <hw(a)kamailio.org>
Date: 2018-08-13T21:18:09+02:00
modules: readme files regenerated - uac ... [skip ci]
(cherry picked from commit d6eff66b185d442d0848a03c5b4681d6ab74373a)
---
Modified: src/modules/uac/README
---
Diff: https://github.com/kamailio/kamailio/commit/97bbdb67d31e0f4d73f56fc19d01c21…
Patch: https://github.com/kamailio/kamailio/commit/97bbdb67d31e0f4d73f56fc19d01c21…
---
diff --git a/src/modules/uac/README b/src/modules/uac/README
index c9a1dca942..59200d70ee 100644
--- a/src/modules/uac/README
+++ b/src/modules/uac/README
@@ -838,7 +838,7 @@ event_route[uac:reply] {
Return the details of a remote registration record based on a filter.
The command has two parameter: attribute and value. The attribute can
be: l_uuid, l_username, r_username or auth_username. The value is what
- should be matcheg against the value of the attribute in the remote
+ should be matched against the value of the attribute in the remote
registration record.
The state of the registration is reflected in the flags field:
@@ -859,7 +859,7 @@ event_route[uac:reply] {
Enable a remote registration record based on a filter. The command has
two parameter: attribute and value. The attribute can be: l_uuid,
l_username, r_username or auth_username. The value is what should be
- matcheg against the value of the attribute in the remote registration
+ matched against the value of the attribute in the remote registration
record.
Example 1.33. uac.reg_enable usage
@@ -872,7 +872,7 @@ event_route[uac:reply] {
Disable a remote registration record based on a filter. The command has
two parameter: attribute and value. The attribute can be: l_uuid,
l_username, r_username or auth_username. The value is what should be
- matcheg against the value of the attribute in the remote registration
+ matched against the value of the attribute in the remote registration
record.
Example 1.34. uac.reg_disable usage