Skip to main content
Participant
December 7, 2010
Question

Cannot call application despite successful leg service connection.

  • December 7, 2010
  • 1 reply
  • 514 views

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

This topic has been closed for replies.

1 reply

Participant
December 7, 2010

It was because my application's instance name didn't match with the instance name configured in the rtmp.xml profile element.

By default it is:

<Instance> _definst_ </Instance>

The created instance in FMS wasn't "_definst_". My application's instance name is "123/56", setting the Instance element to this value solved the issue.

But another question arises from this: How can we we manage profile configuration of the instance value when this value is dynamically set upon instanciation of the application in FMS? It's "123/56" now but the next time it could be "123/57", "123/58", and so on and so forth.

Thanks,

- Georges

December 7, 2010

Making incoming calls to a flash-phone requires FMG to actually know the FMSserver/application/instance names (i.e. RTMP url)  to route the call to that particular RTMP application instance . RTMP URL is something which may NOT be possible to specify in the dial string by traditional PSTN/mobile phones users as these phones support only number based dialing. Therefore, defining a static entry in rtmp.xml is a recommended way to create mapping & route calls towards a flash-phone.

In a nutshell, it would mean a set of few-hundred flash-phones will have to be tied down to a particular application/instance on FMS. In telephony sense, FMS application will act as the nearest PBX for those flash-phones.

I hope it helps,

-Pankaj

Message was edited by: Pankaj Y

Participant
December 8, 2010

That makes perfect sense, thanks for clearing that up.