Setvar PJSIP Realtime

Hello,

Im currently working with PJSIP on a high concurrency, multi-tenant system. I would like to predefine some variables on my PJSIP Endpoints for which I am using Dynamic Realtime. I have managed to define a variable in the setvar database column and read it from the dialplan however I cannot manage to define multiple variables since I cannot find the split sting delimiter (or however this is achieved).

Works:
TENANT_ID=8a49e1e7-3f1a-48c9-aadc-6360110ab8a0

Attempted to delimit in various fashions such as “,” “|”, json array etc and I cant get it to work.

Tried searching online but I cant seem to find how to approach this, if at all possible.

Thank you very much in advance for your help.

Regards,
Gordon

Have you try that
set_var= Variable set on a channel involving the endpoint. For multiple
channel variables specify multiple ‘set_var’(s)

Hello ambiorixg12,

I’ve tried inserting multiple set_var entries in the column delimited in various ways to no avail.

Just to clarify, I am using Dynamic Realtime not static config files. Setvar is a column in the ps_endpoints database table.

Am I missing something?

Kind regards and thanks for your assistance.

Gordon

I vaguely recall using “;” as a character to separate multiple values.

That only works for file based configuration; the OP is trying to use Asterisk Realtime Architecture.

Well you can add the variable with a character as delimiter var1-var2-var2 and then using php or python create multiples variables based on the original variable and set then as channel variable after that

I assumed it should work for realtime but I didnt test it

Brilliant. Thank you so much! Working example as follows;

ARKAFORT_ID=xxx;TENANT_ID=yyy

I would have ended up going down a similar route using Cut, however delimiting by “;” as suggested by jcolp works natively. Thanks for your help and suggestions.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.