AsterNET: .net OriginateResponseEvent (response=failure, reason=3...)

Aug 21, 2014 at 1:32 AM
Hi, am developping a c# application that allow me to make and receive call..
I use a c# library "AsterNET" in order to communicate with asterisk server..

CODE:
public void checkFastAGI () 
        {
                  AsteriskFastAGI agi = new AsteriskFastAGI();
                
            agi.MappingStrategy = new GeneralMappingStrategy(
                                        new List<ScriptMapping>()
                                           {
                                             new ScriptMapping() {
                                             ScriptName = "FastAGIScript1",
                                              ScriptClass="Asterisk_cnx.cLASS"
                                                                 }
                                                                   });
          Console.WriteLine(string.Format("Running FastAGI Server. Press ctrl-c to stop..."));
                
                      agi.Start();
    
        
        }

public void receive_call ()
        {
            manager = new ManagerConnection (ASTERISK_HOST, ASTERISK_PORT, ASTERISK_LOGINNAME, ASTERISK_LOGINPWD);

            // Register user event class
                manager.RegisterUserEventClass(typeof(UserAgentLoginEvent));

            // Add or Remove events
                manager.UserEvents += new UserEventHandler(dam_UserEvents);

            // Dont't display this event
                manager.NewExten += new NewExtenEventHandler(manager_IgnoreEvent);

            // Display all other
            manager.UnhandledEvent += new ManagerEventHandler (dam_Events);

            // +++ Only to debug purpose
            manager.FireAllEvents = true;
            // manager.DefaultEventTimeout = 0;
            // manager.DefaultResponseTimeout = 0;
            manager.PingInterval = 0;
            // +++
            try {
                manager.Login ();           // Login only (fast)

                Console.WriteLine ("Asterisk version : " + manager.Version);
                Console.WriteLine ("Hostname:  " + manager.Hostname);
                Console.WriteLine ("UserName:  " + manager.Username);
            } catch (Exception ex) {
                Console.WriteLine (ex);
                Console.ReadLine ();
                manager.Logoff ();
                return;
            }

            Console.WriteLine("\nPress ENTER key to originate call.\n"
                + "Start phone (or connect) or make a call to see events.\n"
                + "After all events press a key to originate call.");
            Console.ReadLine();

            OriginateAction oc = new OriginateAction();
            oc.Context ="default"; 
            oc.Priority = "1";
            oc.Channel =   "SIP/xxx";
        //  oc.CallerId =  ORIGINATE_CALLERID;
            oc.Exten = "101";      
            oc.Timeout = ORIGINATE_TIMEOUT;
            oc.Async = true;
            //heckFastAGI () ;
            ManagerResponse originateResponse = manager.SendAction(oc, oc.Timeout);
            
            Console.WriteLine("Response:");
            Console.WriteLine(originateResponse);

            Console.WriteLine("Press ENTER key to next test.");
            Console.ReadLine();
    

        }

Here my configuration's files
/etc/asterisk/manager.conf
[admin]
secret=secret
deny = 0.0.0.0/0.0.0.0
permit = 127.0.0.1/255.255.255.0
read = system,call,log,verbose,command,agent,user,originate
write = system,call,log,verbose,command,agent,user,originate
/etc/asterisk/sip.conf
[xxx]
type=friend
host=dynamic
user=xxx
secret=mysecret
context=default
callerid= xxx_caller
/etc/asterisk/extensions.conf
[default]
exten => 101,1,AGI("agi://127.0.0.1/FastAGIScript1")
exten => 101,2,Hangup ()
[default]
exten =>100,1,Dial(SIP/xxx)
the application ouput
OriginateResponseEvent {Response:Failure; Context:default; Exten:101; Reason:3; CallerIdNum:<unknown>; CallerIdName:<unknown>; ActionId:-1126729472_3; InternalActionId:-1126729472_3; DateReceived:5:42:52 PM; Privilege:call,all; Channel:SIP/xxx}
help please
Coordinator
Aug 21, 2014 at 6:05 PM
What version of Asterisk are you running?

https://issues.asterisk.org/jira/browse/ASTERISK-15542

Reason 3, Remote End is Ringing.
Aug 21, 2014 at 8:18 PM
thanks for reply.
My asterisk version is 1.8.13 . i have another problem when i type CLI> sip show peer" the xxx status is "unmonitored" and if i add "qualify=yes" to xxx definition in /etc/asterisk/sip.conf it became unreachable.

PS: i used nuget to import asterisk.dll and asterisk_extension.dll

help plzzz