>From the official kamailio documentation of the function `http_async_query(url, route_name)`
```
Sends HTTP(S) request asynchronously to the URL given in “url” parameter, which is a string that may contain pseudo variables.
Parameter “route_name” defines the route to be executed upon reception of HTTP reply, on error or on timeout. If a transaction exists before calling http_async_query(), it will be paused and resumed in this route, while the routing script execution will be stopped. If executed in a transactionless context, or if $http_req(suspend) is used not to suspend the transaction, the routing script execution will continue and the query result will be available in “route_name”.
```
Because the routing script execution `will be stopped` it's quite difficult for some advanced usages to restore the previous variables and logic and to continue with the execution.
The problem of resuming the work is delegated to the user and not Kamailio itself. I think Kamailio should freeze the execution and store all needed data in memory to resume execution after the http response like for a normal http sync query.
So the `stopping` will become `pausing/resuming`.
--
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/issues/1642
The following change enables app_python (which only works with Python2 anyway) to build on systems where Python3 is the default (Fedora 29).
```
diff --git a/src/modules/app_python/Makefile b/src/modules/app_python/Makefile
index d1854c12e..c9ad254c3 100644
--- a/src/modules/app_python/Makefile
+++ b/src/modules/app_python/Makefile
@@ -9,7 +9,7 @@ NAME=app_python.so
# the following to point to the correct instance. Module has been tested
# to work with 2.6 and 2.5. Python 2.4 has been only confirmed to compile,
# but no testing has been done with that.
-PYTHON?=python
+PYTHON?=python2
PYTHON_VERSION=${shell ${PYTHON} -c "import distutils.sysconfig;print distutils.sysconfig.get_config_var('VERSION')"}
PYTHON_LIBDIR=${shell ${PYTHON} -c "import distutils.sysconfig;print distutils.sysconfig.get_config_var('LIBDIR')"}
```
--
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/issues/1645
Module: kamailio
Branch: 5.0
Commit: 4a88ee66cc4735b655ac4a2b710217a5b6f1ecd8
URL: https://github.com/kamailio/kamailio/commit/4a88ee66cc4735b655ac4a2b710217a…
Author: Henning Westerholt <hw(a)kamailio.org>
Committer: Henning Westerholt <hw(a)kamailio.org>
Date: 2018-09-16T15:00:14+02:00
app_python: workaround in Makefile for MacOS, fall-back to python if python2 not available
(cherry picked from commit a52e7cb1eec84a20432cb959a29a24ee1a8993dd)
---
Modified: src/modules/app_python/Makefile
---
Diff: https://github.com/kamailio/kamailio/commit/4a88ee66cc4735b655ac4a2b710217a…
Patch: https://github.com/kamailio/kamailio/commit/4a88ee66cc4735b655ac4a2b710217a…
---
diff --git a/src/modules/app_python/Makefile b/src/modules/app_python/Makefile
index c9ad254c3b..9898ebc3f5 100644
--- a/src/modules/app_python/Makefile
+++ b/src/modules/app_python/Makefile
@@ -9,7 +9,12 @@ NAME=app_python.so
# the following to point to the correct instance. Module has been tested
# to work with 2.6 and 2.5. Python 2.4 has been only confirmed to compile,
# but no testing has been done with that.
-PYTHON?=python2
+PYTHON=$(shell which python2)
+
+# workaround for some OS (like MacOS) that don't have a python2 link
+ifeq ($(PYTHON),)
+PYTHON=python
+endif
PYTHON_VERSION=${shell ${PYTHON} -c "import distutils.sysconfig;print distutils.sysconfig.get_config_var('VERSION')"}
PYTHON_LIBDIR=${shell ${PYTHON} -c "import distutils.sysconfig;print distutils.sysconfig.get_config_var('LIBDIR')"}
Module: kamailio
Branch: 5.1
Commit: b6e849c9f4463657534d823f5c8cfb1d85f6bdaa
URL: https://github.com/kamailio/kamailio/commit/b6e849c9f4463657534d823f5c8cfb1…
Author: Henning Westerholt <hw(a)kamailio.org>
Committer: Henning Westerholt <hw(a)kamailio.org>
Date: 2018-09-16T15:00:20+02:00
app_python: workaround in Makefile for MacOS, fall-back to python if python2 not available
(cherry picked from commit a52e7cb1eec84a20432cb959a29a24ee1a8993dd)
---
Modified: src/modules/app_python/Makefile
---
Diff: https://github.com/kamailio/kamailio/commit/b6e849c9f4463657534d823f5c8cfb1…
Patch: https://github.com/kamailio/kamailio/commit/b6e849c9f4463657534d823f5c8cfb1…
---
diff --git a/src/modules/app_python/Makefile b/src/modules/app_python/Makefile
index c9ad254c3b..9898ebc3f5 100644
--- a/src/modules/app_python/Makefile
+++ b/src/modules/app_python/Makefile
@@ -9,7 +9,12 @@ NAME=app_python.so
# the following to point to the correct instance. Module has been tested
# to work with 2.6 and 2.5. Python 2.4 has been only confirmed to compile,
# but no testing has been done with that.
-PYTHON?=python2
+PYTHON=$(shell which python2)
+
+# workaround for some OS (like MacOS) that don't have a python2 link
+ifeq ($(PYTHON),)
+PYTHON=python
+endif
PYTHON_VERSION=${shell ${PYTHON} -c "import distutils.sysconfig;print distutils.sysconfig.get_config_var('VERSION')"}
PYTHON_LIBDIR=${shell ${PYTHON} -c "import distutils.sysconfig;print distutils.sysconfig.get_config_var('LIBDIR')"}
Module: kamailio
Branch: master
Commit: a52e7cb1eec84a20432cb959a29a24ee1a8993dd
URL: https://github.com/kamailio/kamailio/commit/a52e7cb1eec84a20432cb959a29a24e…
Author: Henning Westerholt <hw(a)kamailio.org>
Committer: Henning Westerholt <hw(a)kamailio.org>
Date: 2018-09-16T11:09:12+02:00
app_python: workaround in Makefile for MacOS, fall-back to python if python2 not available
---
Modified: src/modules/app_python/Makefile
---
Diff: https://github.com/kamailio/kamailio/commit/a52e7cb1eec84a20432cb959a29a24e…
Patch: https://github.com/kamailio/kamailio/commit/a52e7cb1eec84a20432cb959a29a24e…
---
diff --git a/src/modules/app_python/Makefile b/src/modules/app_python/Makefile
index c9ad254c3b..9898ebc3f5 100644
--- a/src/modules/app_python/Makefile
+++ b/src/modules/app_python/Makefile
@@ -9,7 +9,12 @@ NAME=app_python.so
# the following to point to the correct instance. Module has been tested
# to work with 2.6 and 2.5. Python 2.4 has been only confirmed to compile,
# but no testing has been done with that.
-PYTHON?=python2
+PYTHON=$(shell which python2)
+
+# workaround for some OS (like MacOS) that don't have a python2 link
+ifeq ($(PYTHON),)
+PYTHON=python
+endif
PYTHON_VERSION=${shell ${PYTHON} -c "import distutils.sysconfig;print distutils.sysconfig.get_config_var('VERSION')"}
PYTHON_LIBDIR=${shell ${PYTHON} -c "import distutils.sysconfig;print distutils.sysconfig.get_config_var('LIBDIR')"}
Module: kamailio
Branch: 5.1
Commit: efb843e1de19b01b36363d4f0a5b345520cf166c
URL: https://github.com/kamailio/kamailio/commit/efb843e1de19b01b36363d4f0a5b345…
Author: Henning Westerholt <hw(a)kamailio.org>
Committer: Henning Westerholt <hw(a)kamailio.org>
Date: 2018-09-16T10:33:32+02:00
app_python: fix python call in Makefile (python -> python2), reported by GH #1645
(cherry picked from commit 31498ca574c931f1a7e12619e725c8b151a3e7bd)
---
Modified: src/modules/app_python/Makefile
---
Diff: https://github.com/kamailio/kamailio/commit/efb843e1de19b01b36363d4f0a5b345…
Patch: https://github.com/kamailio/kamailio/commit/efb843e1de19b01b36363d4f0a5b345…
---
diff --git a/src/modules/app_python/Makefile b/src/modules/app_python/Makefile
index d1854c12e4..c9ad254c3b 100644
--- a/src/modules/app_python/Makefile
+++ b/src/modules/app_python/Makefile
@@ -9,7 +9,7 @@ NAME=app_python.so
# the following to point to the correct instance. Module has been tested
# to work with 2.6 and 2.5. Python 2.4 has been only confirmed to compile,
# but no testing has been done with that.
-PYTHON?=python
+PYTHON?=python2
PYTHON_VERSION=${shell ${PYTHON} -c "import distutils.sysconfig;print distutils.sysconfig.get_config_var('VERSION')"}
PYTHON_LIBDIR=${shell ${PYTHON} -c "import distutils.sysconfig;print distutils.sysconfig.get_config_var('LIBDIR')"}