This project is read-only.
Connecting to asterisk using AsterNET is easy, just ensure you've done the following first: -
  • Enabled the manager interface in asterisk
  • Ensure you've reloaded asterisk config for manager
  • Enabled/Created an account on the manager interface to connect via

Add a reference to AsterNET
using Asterisk.NET.Manager;


Now we can begin to connect to Asterisk AMI using the ManagerConnection object.
ManagerConnection astCon = new ManagerConnection(
  ConfigurationManager.AppSettings["astHost"], 
  int.Parse(ConfigurationManager.AppSettings["astPort"]),
  ConfigurationManager.AppSettings["astUser"], 
  ConfigurationManager.AppSettings["astPass"]);


Now all we need to do is Login
try {
  astCon.Login();
}catch(Exception ex) {
  Console.WriteLine(ex.Message);
}

Last edited May 30, 2013 at 12:44 PM by skrusty, version 2

Comments

No comments yet.