change Snom transfer setting

Thomas Six

Platinum Partner
Advanced Certified
Joined
May 31, 2017
Messages
129
Reaction score
44
We have 200 Snom D735 hotdesk phones, and we want to change the setting “Choose either Blind or Attended transfer method when a DSS key is pressed” on all devices at once. How can we do this? The current setting is Blind, and we want to change it to Attended.
 
How can we do this?
You can use the 3CX Config API aka xapi.

You need a GET /xapi/v1/Users with some parameters to get all HD phones and their UserIDs, almost the same process again to retrieve the configured telephony data for each found and desired UserID and then use this telephony data with a PATCH /xapi/v1/Users(...) to set the XferType from former BXfer to AttXfer in the JSON for the phone.

Everything you can see and click in the 3CX under Admin/... can also be read and changed via xapi. The browser developer tools show exactly how this works and how you can build it yourself.
 
  • Like
Reactions: Thomas Six
@Thomas Six
With the header from here this powershell snippet might work if only one phone per extension is registered:

Code:
$uri = "https://$tcxurl/xapi/v1/Users?`$filter=startsWith(Number,'HD')&`$count=true&`$orderby=Number&`$select=IsRegistered,CurrentProfileName,Id,Number,HotdeskingAssignment&`$expand=Phones(`$select=MacAddress,Name,Settings(`$select=IsSBC,ProvisionType))"

$tcxhdphones = (Invoke-RestMethod -uri $uri -headers $headers -Method GET -ContentType "application/json").Value

foreach( $tcxhdphone in $tcxhdphones ) {
    $uri = "https://$tcxurl/xapi/v1/Users($($tcxhdphone.Id))?`$select=Phones,Number,AuthID,AuthPassword,DeskphonePassword&`$expand=Phones"
    $tcxhdphonedata = Invoke-RestMethod -uri $uri -headers $headers -Method GET -ContentType "application/json"
    $tcxhdphonedata.Phones.Settings.XferType = "AttXfer"
    $tcxhdphonedata.PSObject.Properties.Remove('@odata.context')
    $patchdata = $tcxhdphonedata | convertTo-Json -depth 10
    Invoke-RestMethod -uri "https://$tcxurl/xapi/v1/Users($($tcxhdphone.Id))" -headers $headers -Method PATCH -body $patchdata -ContentType "application/json"
}

pls. test it yourself

edit: forgot a debug line after the foreach in the script, now deleted ..
 
Last edited:

Members Online Now

Forum statistics

Threads
111,831
Messages
589,277
Members
164,661
Latest member
ALVI