There are already similar functions, respectively: KSR.pv.get() and KSR.pv.sets()/KSR.pv.seti():
* http://kamailio.org/docs/tutorials/devel/kamailio-kemi-framework/kemimods/#p...
If you find something that doesn't give what you expect, let us know and those functions should be enhanced or the KSR.pv module extended.