Now that Jon and our infrastructure team have installed and configured Asterisk, we’ve begun to add phone system integration features to Arena. In the next couple days I’ll show the click-to-call and phone micro-browser features we’ve added, but first wanted to highlight the architecture.
Although we’re using Asterisk, we implemented phone-integration similar to the ASP.NET provider model, meaning that additional providers, Cisco CallManager for example, can be developed and added through a simple plug-and-play architecture without requiring a new version or recompile of Arena. To create a new provider, it just needs to inherit the PBXManager interface…
public interface PBXManager { #region Properties string ServerName { get; set; } string Password { get; set; } string Username { get; set; } int Port { get; set; } int OrganizationId { get; set; } bool IsConnected { get; set; } #endregion bool Originate(string channel, string context, string phoneNumber, string callerId); bool Connect(); bool Logoff(); void SyncPeers(int organizationId); void Dispose(); } public class PBXHelper { public static PBXManager GetPBXClass(Lookup phoneSystem) { Assembly PBXAssembly = Assembly.Load(phoneSystem.Qualifier3); if (PBXAssembly != null) { Type PBXClassType = PBXAssembly.GetType(phoneSystem.Qualifier2); if (PBXClassType == null) PBXClassType = PBXAssembly.GetType(phoneSystem.Qualifier3 + "." + phoneSystem.Qualifier2); if (PBXClassType == null) throw new Arena.Exceptions.ArenaApplicationException( string.Format("Could not find '{0}' class in '{1}' assembly.", phoneSystem.Qualifier2, phoneSystem.Qualifier3)); else return (PBXManager)Activator.CreateInstance(PBXClassType); } return null; } }
As you can see, each phone system’s provider just needs to provide a way to connect, originate a call, syncpeers (provide Extension, IP Address, Arena Person relationships), logoff, and dispose.
A new provider is then added to Arena through the use of a new “Phone System” lookup type that allows you to define the namespace and class-name of the provider.
