These methods allow setting/getting pseudo variable values from Python module.

Pre-Submission Checklist

Type Of Change

Checklist:

Description

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

File Changes

Patch Links:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.