Picture of Wim 4127
Registered 6 years 309 days
Wim 4127 Thursday, 4 November 2021, 09:07 AM
how to get user's email address with searchusers and getobject?
I'm using the admin api to get a list of all users (or specific users) using the search users function documented at https://sdk.innovaphone.com/13r2/doc/appwebsocket/PbxAdminApi.htm#SearchUsers

This only returns basic properties of a user, so then I use the function https://sdk.innovaphone.com/13r2/doc/appwebsocket/PbxAdminApi.htm#GetObject to get more information about the object with the specified guid. However, the returned object does not hold the email address of that user that I can see in the PBX configuration... why is this information missing from the object? And where can I find it then?


Andreas Fink
Moderator Registered 13 years 109 days
Andreas Fink (innovaphone) Friday, 5 November 2021, 09:29 AM
Re: how to get user's email address with searchusers and getobject?
Hello Wim,

I was not able to reproduce your problem.

Following requests was tested:

>> {"api":"PbxAdminApi","mt":"SearchUsers","cn":"Atlantis","includeMatch":true}
<< {"api":"PbxAdminApi","mt":"SearchUsersResult","user":[{"cn":"Atlantis","guid":"5c4c344ae5a760012c38009033410fab","h323":"atlantis"}]}

>> {"api":"PbxAdminApi","mt":"GetObject","guid":"5c4c344ae5a760012c38009033410fab"}
<< {"api":"PbxAdminApi","mt":"GetObjectResult","guid":"5c4c344ae5a760012c38009033410fab","cn":"Atlantis","h323":"atlantis","e164":"200","loc":"master","node":"root","emails":[{"email":"atlantis.test@gmail.com"}],"config":"Config","apps":"pbxmanager,softphone","hide":false,"no-dev":false,"devices":[{"hw":"atlantis"}],"presence":[],"wakeups":[],"gws":[],"critical":false,"cds":[{"type":"cfnr","ep":[{"e164":"919"}]}]}

The User Object "Atlantis" has an email address configured and GetObjectResult contains this email address.

Could you post your JSON requests and the User object that is affected?

Best Regards
Andreas Fink
Picture of Wim 4127
Registered 6 years 309 days
Wim 4127 Friday, 5 November 2021, 11:54 AM
Re: how to get user's email address with searchusers and getobject?
AppWebsocket(0022b1c0)::AppWebsocketMessageSend {"api":"PbxAdminApi","guid":"6f782e082e8249ae918abb19b9976ced","mt":"GetObject"}
...

AppWebsocket(0022b1c0)::AppWebsocketRecvResult {"api":"PbxAdminApi","mt":"GetObjectResult","guid":"6f782e082e8249ae918abb19b9976ced","dn":"Test","cn":"Wim Van Houts","h323":"wim","e164":"47","loc":"gent","node":"root","config":"Config Admin","grp":[{"name":"iAgent"}],"hide":false,"no-dev":false,"devices":[{"hw":"wim.van.houts","text":"WebRTC","voip":"DUMMYVOIP"}],"wakeups":[],"gws":[],"critical":false}

But user Wim Van Houts is configured as email "jos" in the PBX config. If request user wim via Http cmd https://10.0.0.240/!mod cmd PBX0/ADMIN show /user-guid 6f782e082e8249ae918abb19b9976ced I get following result (see email attribute jos, which is not present in getobject result message

<show state="up" time="581671"><attrs></attrs><user cn="Wim Van Houts" guid="6f782e082e8249ae918abb19b9976ced" e164="47" dn="Test" h323="wim" email="jos" pwd="********" pwdx="9eb55b5682877568fe2a7fd4d1bcfef7cad1fe3b6aeb78a9" apps-my="users,kapschkundenadmin,pbxmanager,devices,apps,kapschmanagementapp" loc="gent" node="root" config="Config Admin" filter="normal" cd-filter="normal" busy-out="0" phone-config="true" phone-discard-config="true" reporting="true" uclic="true" messages="messages-api" push="push" reporting-unlicensed="true" uc-unlicensed="true" type="ep"><app name="calendar" template="Config User"/><app name="calllist" template="Config User"/><app name="calllist-api" template="Config User"/><app name="chat" template="Config User"/><app name="contacts" template="Config User"/><app name="contacts-api" template="Config User"/><app name="events-api" template="Config User"/><app name="fax" template="Config User"/><app name="orders" template="Config User"/><app name="phone" template="Config User"/><app name="profile" template="Config User"/><app name="rcc" template="Config User"/><app name="softphone" template="Config User"/><app name="users" template="Config User"/><app name="users-apis" template="Config User"/><app name="alarms" template="Config Admin"/><app name="ap" template="Config Admin"/><app name="apps" template="Config Admin"/><app name="backup-files" template="Config Admin"/><app name="businesshours" template="Config Admin"/><app name="calendar-admin" template="Config Admin"/><app name="calllist" template="Config Admin"/><app name="calllist-api" template="Config Admin"/><app name="christmas" template="Config Admin"/><app name="contacts-admin" template="Config Admin"/><app name="devices" template="Config Admin"/><app name="devices-api" template="Config Admin"/><app name="events" template="Config Admin"/><app name="events-api" template="Config Admin"/><app name="fax" template="Config Admin"/><app name="files" template="Config Admin"/><app name="files-api" template="Config Admin"/><app name="kapschkundenadmin" template="Config Admin"/><app name="kapschmanagementapp" template="Config Admin"/><app name="logging" template="Config Admin"/><app name="pbxmanager" template="Config Admin"/><app name="profile" template="Config Admin"/><app name="reporting" template="Config Admin"/><app name="users" template="Config Admin"/><app name="users-admin" template="Config Admin"/><app name="users-apis" template="Config Admin"/><app name="usesdkinfrontend" template="Config Admin"/><device hw="wim.van.houts" text="WebRTC"><reg voip="DUMMYVOIP"/></device><allows template="Config User"><allow name="@xqting.be" Xonline="true" act="true" otf="true" note="true" visible="true"/></allows><allows template="Config Admin"/><grp name="iAgent"/></user> </show>
Picture of Wim 4127
Registered 6 years 309 days
Wim 4127 Friday, 5 November 2021, 11:56 AM
Re: how to get user's email address with searchusers and getobject?
Also, as seen in the users admin app (see attachment) Screenshot_1.jpg

Andreas Fink
Moderator Registered 13 years 109 days
Andreas Fink (innovaphone) Friday, 5 November 2021, 04:06 PM
Re: how to get user's email address with searchusers and getobject?
Really strange, can not reproduce it with V13r2 SR5.

User Object from Config Show:
mod cmd FLASHDIR0 add-item 102 (cn=Atlantis)(h323=atlantis)(e164=200)(email=atlantis)(loc=master)(node=root) ...

GetObjectResult:
{"api":"PbxAdminApi","mt":"GetObjectResult","guid":"5c4c344ae5a760012c38009033410fab","cn":"Atlantis","h323":"atlantis","e164":"200","loc":"master","node":"root","emails":[{"email":"atlantis"}], 
Could you post the complete config line of the User Object? May be there is something in the user object, causing the problem.

The PBX firmware Version is V13r2 sr5?

Best Regards
Andreas Fink
Picture of Wim 4127
Registered 6 years 309 days
Wim 4127 Friday, 5 November 2021, 02:31 PM
1 of 1 users consider this post helpful
Re: how to get user's email address with searchusers and getobject?
Ok, seems I wasn't on the latest release with our PBX. Upgraded to the version you say and now it seems to work correctly. Thanks and you can close this issue
← You can define your color theme preference here