[OpenSIPS-Users] a comma ending a parameter list string?

Kingsley Tart kingsley at dns99.co.uk
Tue Apr 27 13:01:29 EST 2021


BTW, I noticed it's OK if I wrap double quotes around the CSV, eg:

    $var(paramstr) = "h=BT1;dir=in;dprulesRX=\"1,2,3\";dprulesTX=\"4,100\"";

(getting a bit embarrassed with the number of emails I'm submitting to
this list, sorry).

Cheers,
Kingsley.

On Tue, 2021-04-27 at 13:42 +0100, Kingsley Tart wrote:
> Hi,
> 
> firstly apologies if this is a dumb question; I'm still pretty new to
> OpenSIPS and some aspects of SIP itself.
> 
> Is a comma supposed to mark the end of a parameter list?
> 
> Eg, if I do this, the param transformation is treating the first
> comma
> as the end of the string:
> 
> 	$var(paramstr) =
> "h=BT1;dir=in;dprulesRX=1,2,3;dprulesTX=4,100";
> 	xlog("PARAMSTR='$var(paramstr)'\n");
> 	xlog("PARAMCOUNT='$(var(paramstr){param.count})'\n");
> 
> 	xlog("h='$(var(paramstr){param.value,h})'\n");
> 	xlog("dir='$(var(paramstr){param.value,dir})'\n");
> 	xlog("dprulesRX='$(var(paramstr){param.value,dprulesRX})'\n");
> 	xlog("dprulesTX='$(var(paramstr){param.value,dprulesTX})'\n");
> 
> then this is what gets logged:
> 
> 	PARAMSTR='h=BT1;dir=in;dprulesRX=1,2,3;dprulesTX=4,100'
> 	PARAMCOUNT='3'
> 	h='BT1'
> 	dir='in'
> 	dprulesRX='1'
> 	dprulesTX='<null>'
> 
> Is this deliberate behaviour? OpenSIPS 3.1, FWIW.
> 




More information about the Users mailing list