[OpenSIPS-Users] Better Example for the Python Mod
Manuel Tausendfreund
manuel.tausendfreund at dtms.de
Tue Sep 16 09:23:39 UTC 2025
Hello,
after a Couple from hours with Try an Error.
I think we need better Examples for Python Module. ( https://opensips.org/docs/modules/3.4.x/python.html all other docs have the same problem )
First
When you try to call a Function with
python_exec()
python_exec('test_func',$var(optinal))
it should be announced you need 2 Function Parameter
##### Python code
def test_func (self, sip, data):
#####
sip, for the actual call
data, for the optinal data.
Second, and from my point of view the the most important
Call the sipfunctions --> get_pseudoVar and set_pseudoVar
the pseudoVar must be complete as string in the function set.
##### Python code
sip.get_pseudoVar('$avp(py_str)')
sip.set_pseudoVar('$avp(py_str)', 'test str')
#####
And last Return is only number 1 or 0 (when you try a string you get a -1)
BR
Moppi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20250916/9442411c/attachment.html>
More information about the Users
mailing list