Cannot call application despite successful leg service connection.
Hello,
I'm playing around with an application's SASS script in order to experiment with integration of FMG but I have run into some issues.
On application startup I successfully request the service as defined in FMG's rtmp.xml (I have also set <EnableAutoProfile> to true and <DefaultContext> contains a valid context name from workflow.xml):
if(!application.legService.isConnected){
services.request("servicename");
trace("FMG - Service requested");
}
When a normal flash based client connection is detected, I assign it a phone number and save its client object in PhoneIDMap. I also increment the phone number counter for the next connection:
client.phoneID = application.phoneNumberCounter;
application.phoneIDMap[client.phoneID] = client;
// Increment the phone number counter.
application.phoneNumberCounter = application.phoneNumberCounter+1;
After this, onConnect is triggered with client.agent equal to "FMG Leg Service 1.0" in which case we connect the LegService so that it is ready to send/receive voice calls:
if(!application.legService.isConnected){
application.legService.setServer(client);
serviceConnected = true;
}
At this point the onStatus callback function is called twice. Once to signal that the LegService is not ready and a second time to indicate that it is ready.
It is my understanding that at this point I should be able to dial the application using the phoneID assigned to it and the application.legService.onStatus callback function should fire again to let me know that there is an incoming call after which application.legService.onLegStatus should fire. Correct?
At this point, calling the application does nothing.The softphone I am using to call the application cannot find an endpoint to the dialed number and the call fails right away. Any ideas as to what I could have left out?
Note that in actuality my application object is contained in another object like so:
MyApp.application = application;
So I'm actually operating like so:
if(!MyApp.application.legService.isConnected){
MyApp.application.legService.setServer(client);
serviceConnected = true;
}
But I don't think that would be an issue.
Thanks,
- Georges
