Asterisk AJAM Authentication

I can login to the Asterisk AGI via AJAM, but Asterisk will refuse subsequent requests (I receive Authentication Required) when processing the next request after login.  Interestingly enough, I can run the function on 'step' mode in FireBug and the lines will process with no problem. It's only when I run the app without stepping through it that I receive the Authentication Required message.

 function localajaminit(user,password) {
            astmanEngine.setURL('../asterisk/mxml/?');
            astmanEngine.setEventCallback();
            astmanEngine.sendRequest('action=login&username=' + user + '&secret=' + password);
            astmanEngine.sendRequest('action=status');      
      }
jcorbitAsked:
Who is Participating?
 
jcorbitConnect With a Mentor Author Commented:
This has been resolved by me - I inserted a callback function to process the status, (  astmanEngine.sendRequest('action=login&username=' + user + '&secret=' + password, ajam.callback); and authentication is now good.
0
All Courses

From novice to tech pro — start learning today.