Picture of Wim 4127
Registered 6 years 112 days
Wim 4127 Tuesday, 26 July 2022, 11:17 AM
PBX Admin API search users returns strange responses
Hi,

we are using innovaphone SDK - PbxAdminApi protocol for searching users. I see the following messages going on in my log file:

07-26 09:10:47.637 xqting@[xqting.com ] [MsgContext ] I> 0xdec410 --> {
"api": "PbxAdminApi",
"cn": "Robbe Vidts",
"mt": "SearchUsers"
}

07-26 09:10:47.640 xqting@[xqting.com ] [PbxAdminApi ] I> 0xdec410 <-- {
"api": "PbxAdminApi",
"mt": "SearchUsersResult",
"user": [
{
"cn": "Sam Van Belle",
"guid": "55fac54e454445118e5dfbf92f5e48aa",
"h323": "Sam"
},
{
"cn": "Sinan Bolat",
"dn": "Sinan Bolat",
"guid": "7f6d507f72cc6101a4ca00155d00bc0b",
"h323": "Sinan Bolat"
},
{
"cn": "Vincent Peeters",
"guid": "c72c130210ab4ba9bf8a3a4321629af8",
"h323": "vincent"
},
{
"cn": "Wim Van Houts",
"guid": "05556f645a624a718c74f50bb7b536b5",
"h323": "Wim"
}
]
}

This is really strange, for two reasons:
- Robbe Vidts is really an object that exists in my pbx, so I would expect to see at least that one?
- Where do the four other objects come from?

Why is this happening and why does the PBX return these results?
Andreas Fink
Moderator Registered 12 years 277 days
Andreas Fink (innovaphone) Tuesday, 26 July 2022, 04:17 PM
Re: PBX Admin API search users returns strange responses
Hello Wim,

the reason of strange behaviour is explained by the fact that the function performs a b-tree traversal starting from the search value provided, but not including it, and may deliver leaf nodes results.

For example if you have objects "alice", "bob" and "eve", searching for "alice" will deliver "bob" and "eve".

To include the match please set the property includeMatch to true in the request. The response must be filtered for headmatch, since it could contain not matching entries (leaf nodes).

Best Regards
Andreas Fink
Picture of Wim 4127
Registered 6 years 112 days
Wim 4127 Thursday, 4 August 2022, 09:05 AM
Re: PBX Admin API search users returns strange responses
It could be me, but that is very confusing, and one could argue that the name of the function is vaguely misleading (as is also the description in the documentation).

Anyway, I understand now how the function works, and imho nobody interpretes "search" like that, but we will then use it just to fetch everything and perform our own search function then on the received list. A pitty, because this means that we must still fetch all users...
← You can define your color theme preference here