Hi Sebastian,
The existence of this:
https://www.kamailio.org/wiki/cookbooks/5.0.x/pseudovariables#rc_-_returned_...
Makes me think that the return value of functions cannot be captured by assigning an arbitrary variable in this manner:
$var(ret) = func(...);
-- Alex