Scheduling Conference Fails with Reason maxConferencesExceeded

Issue: Your middle tier UCMA application uses trusted application endpoint to schedule conferences on demand. When a conference is not needed anymore, your application invokes ApplicationEndpoint.ConferenceSession.BeginTerminateConference() to terminate the conference. Your application works fine for a while. Then it suddenly starts getting ConferenceFailureException with reason code maxConferencesExceeded each time a new conference is tried to be scheduled.

Root cause: your application endpoint reached the maximum number of existing conferences which is 1000 by default.

Reason: ApplicationEndpoint.ConferenceSession.BeginTerminateConference() does not terminate conferences. It just deactivates them.

Solution: You should use ApplicationEndpoint.ConferenceSession.BeginCancelConference() instead. BeginCancelConference() deactivates and terminates the conference in a single step.

Technical background

There are 2 places where an SfB pool  - more precisely the RTCLOCAL SQL Server instance - stores conferences in the database:

  • [RTC].[Conference] database table: it stores the existing conferences.
  • [RTCDYN].[ActiveConference] database table: it stores only the active conferences

If you execute ConferenceSession.BeginTerminateConference() for a conference then it just deactivates the conference meaning that the conference record is removed from [RTCDYN].[ActiveConference] but it will remain in [RTC].[Conference] since the conference still exists.

The conference will be terminated and removed from [RTC].[Conference] when the conference expiry time – specified by your application when scheduled the conference - is exceeded. There is a conference purging process executed periodically on the RTC database. If this purging process detects that the expiry time of a given conference is exceeded then the process terminates the conference and removes the conference record from [RTC].[Conference]. After this is done, the given conference does not exist anymore.

You can connect to the RTCLOCAL SQL Server instance and query the [RTC].[Conference] database table to see how many conferences your application endpoint currently have

use [rtc]
select * from Conference where OrganizerId = 'xxx' order by ConfId desc

and you can query the [RTCDYN].[ActiveConference] database table to see how many conferences are active from these conferences

use [rtcdyn]
select * from ActiveConference order by ConfId desc

By default each application endpoint can have maximum 1000 existing conferences. So the application endpoint can have maximum 1000 conference record in [RTC].[Conference] at a given time. If your application endpoint is going to exceed this limit then it gets the ConferenceFailureException with reason code maxConferencesExceeded. This limit is specified in the global user services policy (MaxSchedulingMeetingsPerOrganizer property) which is applied to your application endpoint by default.
Although you can launch the SfB Management Shell and increase this 1000 concurrent conferences limit by 

  • creating a new user services policy using the New-CsUserServicesConfiguration cmdlet and
  • assigning that to your application endpoint using the Grant-CsUserServicesPolicy cmdlet

this does not really solve your original problem since you can still reach the new maximum conferences limit if your application needs to create conferences frequently and it just uses BeginTerminateConference() to “close” conferences. You should modify your application to use BeginCancelConference() instead.