Ejemplo n.º 1
0
        private static void checkFastAGI()
        {
            Console.WriteLine(@"
Add next lines to your extension.conf file
	exten => 200,1,agi(agi://"     + DEV_HOST + @"/customivr)
	exten => 200,2,Hangup()
reload Asterisk and dial 200 from phone.
Also enter 'agi debug' from Asterisk console to more information.
See CustomIVR.cs and fastagi-mapping.resx to detail.

Ctrl-C to exit");
            AsteriskFastAGI agi = new AsteriskFastAGI();

            // Remove the lines below to enable the default (resource based) MappingStrategy
            // You can use an XML file with XmlMappingStrategy, or simply pass in a list of
            // ScriptMapping.
            // If you wish to save it to a file, use ScriptMapping.SaveMappings and pass in a path.
            // This can then be used to load the mappings without having to change the source code!

            agi.MappingStrategy = new GeneralMappingStrategy(new List <ScriptMapping>()
            {
                new ScriptMapping()
                {
                    ScriptClass = "AsterNET.Test.CustomIVR",
                    ScriptName  = "customivr"
                }
            });

            //agi.SC511_CAUSES_EXCEPTION = true;
            //agi.SCHANGUP_CAUSES_EXCEPTION = true;

            agi.Start();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Console.Write("Asterisk AGI agent started.\nPress CTRL+C to stop agent.");

            AsteriskFastAGI agi = new AsteriskFastAGI();

            agi.Start();
        }
Ejemplo n.º 3
0
        private static void checkFastAGI()
        {
            Console.WriteLine(@"
Add next lines to your extension.conf file
	exten => 200,1,agi(agi://"     + DEV_HOST + @"/customivr)
	exten => 200,2,Hangup()
reload Asterisk and dial 200 from phone.
Also enter 'agi debug' from Asterisk console to more information.
See CustomIVR.cs and fastagi-mapping.resx to detail.

Ctrl-C to exit");
            AsteriskFastAGI agi = new AsteriskFastAGI();

            agi.Start();
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            AsteriskFastAGI agiServer = new AsteriskFastAGI();

            agiServer.MappingStrategy = new GeneralMappingStrategy(
                new List <ScriptMapping>()
            {
                new ScriptMapping()
                {
                    ScriptName  = "callmonitor",
                    ScriptClass = "CallMonitor.CallMonitorAGI"
                }
            });

            Console.WriteLine("Press ctrl-c to exit...");
            agiServer.Start();
        }
Ejemplo n.º 5
0
        static void Main(string[] args)
        {
            AsteriskFastAGI agiServer = new AsteriskFastAGI();

            agiServer.MappingStrategy = new GeneralMappingStrategy(
                new List <ScriptMapping>()
            {
                new ScriptMapping()
                {
                    ScriptName  = "acccheck",
                    ScriptClass = "AccCheckExample.AccCheckAGI"
                }
            });

            Console.WriteLine("Press ctrl-c to exit...");
            agiServer.Start();
        }
Ejemplo n.º 6
0
        private static void CheckFastAGI()
        {
            // Anotação

            // Add next lines to your extension.conf file
            // exten => 200,1,agi(agi://" + DEV_HOST + @"/customivr)
            // exten => 200,2,Hangup()
            // reload Asterisk and dial 200 from phone.
            // Also enter 'agi debug' from Asterisk console to more information.
            // See CustomIVR.cs and fastagi-mapping.resx to detail.

            //Ctrl-C to exit

            var agi = new AsteriskFastAGI
            {
                MappingStrategy = new GeneralMappingStrategy(new List <ScriptMapping>
                {
                    new ScriptMapping {
                        ScriptClass = typeof(Negocio.URAs.CustomIVR).FullName, ScriptName = "customivr"
                    },
                    new ScriptMapping {
                        ScriptClass = typeof(Negocio.URAs.MegaIVR).FullName, ScriptName = "megaivr"
                    }
                })
            };

            // Remove the lines below to enable the default (resource based) MappingStrategy
            // You can use an XML file with XmlMappingStrategy, or simply pass in a list of
            // ScriptMapping.
            // If you wish to save it to a file, use ScriptMapping.SaveMappings and pass in a path.
            // This can then be used to load the mappings without having to change the source code!


            //agi.SC511_CAUSES_EXCEPTION = true;
            //agi.SCHANGUP_CAUSES_EXCEPTION = true;

            agi.Start();
        }