Skip to main content
December 9, 2011
Question

Cannot make new call leg, request dropped as legService is not ready or is blocked

  • December 9, 2011
  • 1 reply
  • 933 views

hello,

  I am programming by SASS in order to integrate FMS with FMG.

first,  I confige the rtmp.xml and the workflow.xml of the FMG.

second, I create a fms application, and program the main.asc:

Client.prototype.requestService = function(name){

if(!application.legService.isConnected){

  services.request(name);

}else{

  trace("FMG legservice is already connected");

}

}

the client call the requestService ,and the onConnect of main.asc is called:

application.onConnect = function(client){

trace("on connect ,the client.agent="+client.agent);

if(client.agent == "FMG Aux Leg Service 1.0"){

  return;

} else if(client.agent == "FMG Leg Service 1.0"){

       trace("2:A callLegServer (FMG) connect");

       if(!this.legService.isConnected){

              this.legService.setServer(client); 

              serviceConnected = true;

               trace("3:  connected");

       }else{

               trace("3: but no connected");

       } 

       return;

}

and the log '3:  connected' is printed

but, when I called the createNewCall function, I was told error, the application.legService.ready is false:

Client.prototype.createNewCall = function(destAddress){

trace("2:creating a new call,application.legService.ready="+application.legService.ready);

if(!application.legService.ready){

  trace("error: Cannot make new call leg, request dropped as legService is not ready or is blocked.");

  return false; 

}

return application.legService.createCall(this.clientID, destAddress, this.clientID+"-1", this.clientID+"-2");

}

what can I do to let the  application.legService.ready is true:

Thanks verymuch!

This topic has been closed for replies.

1 reply

January 9, 2012

There are two alternatives:

   1) Alternative #1: remove the check for application.legservice.ready:  

                It appears that the code you have in your application has been taken from sample telephony appllication. This check was added at SSAS telephony application to detect against call attempt failure in automated cased. Usually, when Flash Media Gateway provides call leg service to an FMS application; there could be few millisecond delay (~50-200 ms) while FMG connects back and is ready to createCalls. For a normal application like yours, it is OK to remove application.legservice.ready check completly.  In later version, we intend try to make such checks implicit part of SSAS library to help improve the development experience.

     2)  Alternative #2:  Add following function in your SSAS application  (this has been taken from sample telephony application)

          

application.legService.onStatus = function(info){

   

    trace("******* Recieved Legservice onStatus message:");

    trace("info.type:"+info.type);

    trace("info.data:"+info.data);

    trace("info.metadata.profileID:"+info.metadata.profileID);   

    if((info.data == "legService.status.blocked")|| (info.data == "legService.status.init")){

        application.legService.ready = false;

    }else{

        application.legService.ready = true;

    }

    return;

   

}

Do share, how it goes !

-Pankaj