Picture of Sam 4951
Registered 5 years 4 days
Sam 4951 Tuesday, 21 June 2022, 11:10 AM
myPBX config (WebRTC) is gone after UpdateObject for another device
Dear Innovaphone support,

A PBX user object has two devices: one called "myPBX" with the Config VOIP checkbox set, and WebRTC configured in the extra MyPBX tab.
And a second hardware device.

When the media-relay property of the second device is enabled with an UpdateObject call, the myPBX/WebRTC configuration of the first device disappears.


1. ReplicateUpdate indicates second device is added

06-21 08:34:33.771 snomprovisioningapp@xqting.be AppWebsocket(01f73b50)::AppWebsocketRecvResult {"mt":"ReplicateUpdate","src":"XqtingReplicatorApi","api":"PbxTableUsers","columns":{"guid":"67589b697a4744bb8be33a172b889557","cn":"pascal langhe","h323":"Pascal","e164":"13","pwd":"2e276819ee84890320594a7ae4525df9565d9831d014bb84","devices":[{"hw":"MyPBX","text":"MyPBX","tls":true,"sreg":true,"voip":"DUMMYVOIP"},{"hw":"00041379b00b","text":"PHONE","app":"phone","tls":true,"trusted":true}]}}

2. UpdateObject is used to enable media relay on the second device

06-21 08:34:33.771 snomprovisioningapp@xqting.be AppWebsocket(01f73b50)::AppWebsocketMessageSend {"api":"PbxAdminApi","mt":"UpdateObject","guid":"67589b697a4744bb8be33a172b889557","devices":[{"hw":"MyPBX","text":"MyPBX","app":"","admin":false,"no-filter":false,"tls":true,"no-mob":false,"voip":"DUMMYVOIP","trusted":false,"sreg":true,"mr":false},{"hw":"00041379b00b","text":"PHONE","app":"phone","admin":false,"no-filter":false,"tls":true,"no-mob":false,"trusted":true,"sreg":false,"mr":true}]} connected:true

3. ReplicateUpdate confirms the update of media relay, but voip config is gone

06-21 08:34:33.779 snomprovisioningapp@xqting.be AppWebsocket(01f73b50)::AppWebsocketRecvResult {"mt":"ReplicateUpdate","src":"XqtingReplicatorApi","api":"PbxTableUsers","columns":{"guid":"67589b697a4744bb8be33a172b889557","cn":"pascal langhe","h323":"Pascal","e164":"13","pwd":"2e276819ee84890320594a7ae4525df9565d9831d014bb84","devices":[{"hw":"MyPBX","text":"MyPBX","tls":true,"sreg":true},{"hw":"00041379b00b","text":"PHONE","app":"phone","tls":true,"trusted":true,"mr":true}]}}
06-21 08:34:33.779 snomprovisioningapp@xqting.be AppWebsocket(01f73b50)::AppWebsocketRecvResult {"api":"PbxAdminApi","mt":"UpdateObjectResult"}

The latest version (13r2 sr12) is installed.

Best regards,
Sam
Andreas Fink
Moderator Registered 13 years 52 days
Andreas Fink (innovaphone) Monday, 11 July 2022, 01:33 PM
Re: myPBX config (WebRTC) is gone after UpdateObject for another device
Hello Sam,

the reason is inconsistent data inside of the devices object delivered by the GetObject method. The XML data stored on the PBX is converted to JSON. In this case the conversion is inconsistent.

Internally PBX stores it in following format:

<device hw="MyPBX" text="MyPBX" tls="true" sreg="true" mr="true">
<reg mr="true" voip="H323" gk-id="gk.example.com" prim="10.0.0.1"/>
</device>

The properties "voip", "gk-id", "prim", "alt" must be inside of the own object "reg".

Following UpdateObject message should preserve settings for WebRTC:

{
 "api": "PbxAdminApi",
 "mt": "UpdateObject",
 "guid": "67589b697a4744bb8be33a172b889557",
 "devices": [
 {
 "admin": false,
 "app": "",
 "hw": "MyPBX",
 "mr": false,
 "no-filter": false,
 "no-mob": false,
 "sreg": true,
 "text": "MyPBX",
 "tls": true,
 "trusted": false,
 "reg": {
 "voip": "DUMMYVOIP"
 }
 },
 {
 "admin": false,
 "app": "phone",
 "hw": "00041379b00b",
 "mr": true,
 "no-filter": false,
 "no-mob": false,
 "sreg": false,
 "text": "PHONE",
 "tls": true,
 "trusted": true
 }
 ]
}

We will fix the GetObjectResult message in order it fits the structure on the PBX. However only in v13r3.

In case v13r2 PBX is used, please workaround it (place "voip", "gk-id", "prim", "alt" into "reg" object while read/update/write cycle), if possible.

Best Regards
Andreas Fink
Picture of Sam 4951
Registered 5 years 4 days
Sam 4951 Wednesday, 13 July 2022, 12:30 PM
Re: myPBX config (WebRTC) is gone after UpdateObject for another device
Hello Andreas,

Thanks, this workaround works!

I hope the workaround will still work in v13r3.

Best regards,
Sam
← You can define your color theme preference here