#
#  Convert broadsoft 255 attributes in the form <attr number>=value
#  to internal broadsoft attributes with numbers > 256.
#  There is currently no way to automatically re-encode those
#  attributes, but it can be done with unlang for specific ones.
#
broadsoft-decode {
	foreach value ( BroadSoft-Attr-255 ) {
		if (value =~ /^([0-9]+)=(.*)$/) {
				"&request.BroadSoft-Attr-%{1}" += "%{2}"
		}
	}

	#
	#  We don't need these any more.
	#
	request -= BroadSoft-Attr-255[*]
}
