Extension status change

Status
Not open for further replies.

Trestill

Platinum Distributor
Advanced Certified
Joined
Jan 22, 2015
Messages
61
Reaction score
6
Hello,

I found old post showing how to change extensions status (available, away, etc.) in CC API and I would like to know if this is still accurate:
Code:
var ext = PhoneSystem.Root.GetExtensions().FirstOrDefault(f => f.Number == "001");

                    if (ext != null)
                    {
                        ext.CurrentProfile = ext.FwdProfiles[3];
                        ext.Save();
                    }
This one is supposed to change status to Away but I found that in my case different extensions have different order of statuses. Is there a foolproof way to set desired status?
Regards,
Trestill
 
Hello @Trestill,

You're right, the order is not always the same. You should check the property Name of the profile, to know which is the one you need.

Kind regards.
 
Thank you Ernesto
 
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
112,323
Messages
591,896
Members
165,474
Latest member
costionofrei