I have been trying to get my head wrapped around the Asterisk database. I understand that it is supposed to be family/key value, but I was trying to work with parsing results from the database via the manager, so I was working on setting up a RegEx to parse the results. I was thinking that you could probably not have a / (slash) in the family or key, but that is not true…
pbx2*CLI> database put "test" "key" "one"
Updated database successfully
pbx2*CLI> database show test
/test/key : one
1 results found.
pbx2*CLI> database put "test/key" "" "two"
Updated database successfully
pbx2*CLI> database show test
/test/key : one
/test/key/ : two
2 results found.
pbx2*CLI> database put "test" "key/" "three"
Updated database successfully
pbx2*CLI> database show test
/test/key : one
/test/key/ : three
2 results found.
pbx2*CLI> database put "test" "key/subkey" "four"
Updated database successfully
pbx2*CLI> database show test
/test/key : one
/test/key/ : three
/test/key/subkey : four
3 results found.
pbx2*CLI> database put "test/key" "subkey" "five"
Updated database successfully
pbx2*CLI> database show test
/test/key : one
/test/key/ : three
/test/key/subkey : five
3 results found.
pbx2*CLI> database showkey key
/test/key : one
1 results found.
pbx2*CLI> database showkey subkey
/test/key/subkey : five
1 results found.
pbx2*CLI>
As you can see you can use a / (slash) in both the family & the key, which cases the value to get over written. Why is this function this way?