Prolem generating dialstring with "sofia_contact" having multiple contacts and parameters

in a lua script I’m forging a dialstring like this: (indentation for readability):

{option1=value1, option2=value2}
	[presence_id=1001@domainA]${sofia_contact(user/1001@domainA)},
	[presence_id=1002@domainA]${sofia_contact(user/1002@domainA)}

suppose that users have both 2 active registrations, the desired dialstring would be:

{option1=value1, option2=value2}
	[presence_id=1001@domainA]sofia/internal/sip:1001@10.10.10.1,
	[presence_id=1001@domainA]sofia/internal/sip:1001@10.10.10.2,
	
	[presence_id=1002@domainA]sofia/internal/sip:1002@10.10.10.3,
	[presence_id=1002@domainA]sofia/internal/sip:1002@10.10.10.4

but since

{sofia_contact(user/1001@domainA)}

is expanded in a list of comma-separated values, for example:

sofia/internal/sip:1001@10.10.10.1,sofia/internal/sip:1001@10.10.10.2

what I get is:

{option1=value1, option2=value2}
	[presence_id=1001@domainA]sofia/internal/sip:1001@10.10.10.1,sofia/internal/sip:1001@10.10.10.2,
	[presence_id=1002@domainA]sofia/internal/sip:1002@10.10.10.3,sofia/internal/sip:1002@10.10.10.4

so every second registration won’t get the “presence_id” option.

how to get the desired dialstring?

Thanks!

What do you have set as the dial-string in the user because that is what dictates goes into each of those, and can’t just magically work, You may have to build the dialstring with xml_curl to be more dynamic based on your needs, vs the static directory.

/b

Thank Brian,

good to know that there is no a “curly|round|square|something” bracket syntax to obtain that.

Will investigate how to do as suggested.

M.