[SR-Users] Profile name as variable in set_dlg_profile

Muhammad Sohaib geosohaib at gmail.com
Mon Jan 11 19:44:19 CET 2021


Thank you Daniel for the explanation.

I managed to achieve the goal by "profiles_with_value" parameter and passed
"$rU" but each user might have multiple numbers so I had to
get_profile_size for each number.

However, adding support for variables would be a great help.

I will give a try to the KSA module later.

On Mon, 11 Jan 2021 at 14:56, Daniel-Constantin Mierla <miconda at gmail.com>
wrote:

> Hello,
>
> I haven't checked the code, but I think that the function was designed
> with static parameter to be able to lookup the profile structure at startup
> and keep the pointer to it in order to be faster at runtime.
>
> Adding support for variables is possible of course, it would require a bit
> of c development.
>
> At this moment you can use embedded scripting (e.g., Lua, Python,
> JavaScript, ... see app_lua, ...) and execute functions via KSR module,
> i.e.,:
>
>   -
> http://kamailio.org/docs/tutorials/devel/kamailio-kemi-framework/modules/#ksrdialogset_dlg_profile
>
> Cheers,
> Daniel
> On 08.01.21 07:44, Muhammad Sohaib wrote:
>
> Is it possible to insert the current dialog into the profile by using the
> following way?
>
> modparam("dialog", "profiles_no_value", "mytest;xyz")
>
> $var(profilename)="xyz";
> set_dlg_profile(" $var(profilename) ");
>
> Currently it is giving errors and not allowing to use variable instead of
> static profile name.
>
> Or is there any alternative to pass profile name as variable?
>
> ---
> Thanks,
>
> _______________________________________________
> Kamailio (SER) - Users Mailing Listsr-users at lists.kamailio.orghttps://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
> --
> Daniel-Constantin Mierla -- www.asipto.comwww.twitter.com/miconda -- www.linkedin.com/in/miconda
> Funding: https://www.paypal.me/dcmierla
>
>

-- 
Thanks,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20210111/3cc8a34e/attachment.htm>


More information about the sr-users mailing list