[Freeswitch-users] Bridge calls to Java ESL socket does not work as expected

Hector Geraldino Hector.Geraldino at ip-soft.net
Sat Oct 8 01:10:02 MSD 2011


Hi,

Most of the issues you've can be addressed with a 'single instanced' application, but I understand why you designed the application to work this way. If at any moment you think about enabling this application to handle several calls, you can overtake these issues in various ways, for example:

- Controlling the number of calls: you can register all answered calls (uuids) in a data structure (list, map), remove them when disconnected, and decide when to accept a new call by getting the collection size and comparing it to your parameter. If you ever get more Nuance licenses, increasing the number of managed calls would be as easy as change a parameter in a property file.

- You can have as many MRCP profiles as you want defined in the configuration xml files on mrcp_profiles/ directory. Coming up with the algorithm to assign channels to MRCP engines (Nuance server/port) won't be that hard. I can think of one: having all mrcp profiles in a map with a flag (in use/free), when the call comes I lock the first available profile so it's attached to this call. When the call is disconnected the profile is freed.

- log mixed, sure. But, is this really a problem? The same with the publishing of topics, you can replicate the same behavior of having multiple instances in a single one. I mean, if you make an abstraction and say: one instance of my java application equals one thread of my new java app you'll see how easy is to overcome this and other problems.

Sorry for such a long message, but as many others I feel real passion about application design topics. My intention is never to criticize what you've done, as each mind is a different world.  

Anyway, good luck with that!

-----Original Message-----
From: freeswitch-users-bounces at lists.freeswitch.org [mailto:freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of xl127
Sent: Friday, October 07, 2011 6:55 AM
To: FreeSWITCH Users Help
Subject: Re: [Freeswitch-users] Bridge calls to Java ESL socket does not work as expected

Hi Hector,

Your points make sense but I have some specific issues for my 
application so I thought of binding only one call per runnning instance.

1. My outbound socket application is one component/server of our Spoken 
Dialogue System (SDS).
We have four ports Nuance ASR/TTS licenses, each port is specific to one 
machine( yeah, we have four seperate license files for four machines).
It seems to be difficult to specify which channel uses which Nuance MRCP 
profile if simultenous calls are answered by only one instance.

2. It seems to me that the log info would be mixed for simultenous calls 
if running one instance.

3. My socket app will be communicating with other components/servers of 
the SDS via ICE middleware (http://www.zeroc.com/).
It will register to the central ICE server when starting the system via 
a Topic name which is a static name given by the developer,
it will keep publishing ASR results on that topic so the other 
components listening on the topic will get the results,
and it also subscribes and listens to other topics from other components 
for TTS.

In simultenous calls to one running instance scenario, the 
distinguishable thing between channels would be the channel UUID which I 
could use
as a part of the topic name, but it is dynamic and other servers could 
not know it when registering to the central server.

I could let the all channels publish results with a same static topic 
name and channel UUID, the interested parties could parse the results
they want based on the UUID, but I worried this would cause more burdens 
to the whole system.


4. Even if running one instance, I still need some ways to check and 
control the maximum number of calls as we have limited ASR/TTS resources.

Cheers,
Xing

On 06/10/11 22:34, Hector Geraldino wrote:
> This might sound a little bit Off-Topic but, why are you willing to bind only one call per running instance? I cannot imagine any user scenario where this is desirable. Maybe as a proof of concept is Ok, but having an equivalence between calls and instances mmm... I don't know.
>
> Can you please tell me what are you willing to accomplish? I'm really curious about it.
>
> -----Original Message-----
> From: freeswitch-users-bounces at lists.freeswitch.org [mailto:freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of Anthony Minessale
> Sent: Thursday, October 06, 2011 3:20 PM
> To: FreeSWITCH Users Help
> Subject: Re: [Freeswitch-users] Bridge calls to Java ESL socket does not work as expected
>
> don't actually hang it up just don't connect the socket or connnect it
> and disconnect it right away and the app will fail on in the
> dial-plan.
>
> again you could try mod_limit otherwise.
>
>
> On Thu, Oct 6, 2011 at 11:28 AM, xl127<x.liu at hw.ac.uk>  wrote:
>> Thanks for the suggestions!
>>
>> I thought about and tried to make my outbound socket application
>> fail e.g. by send a hangup message but it didn't work.
>>
>> What I did is that I set a public variable channelUUID with initial
>> value null in MyOutboundHandler,
>> I check if it is null in the handleConnectionResponse method. If it not
>> null, a hangup command is sent to FS.
>> But it looks like each call channel creates its own Java thread, so the
>> channelUUID is always null before the connection.
>> So my approach doesn't work.
>>
>> Any idea about checking if the remote application is answering a call?
>>
>> Thanks!
>> Xing
>>
>>
>> On 06/10/11 16:43, Anthony Minessale wrote:
>>> Really the socket app has not limit to how many simultaneous
>>> connections it can handle.
>>> You could try mod_limit, or make the remote end of you application
>>> fail when there are too many connections.
>>>
>>>
>>> On Thu, Oct 6, 2011 at 10:30 AM, xl127<x.liu at hw.ac.uk>    wrote:
>>>> Hello,
>>>>
>>>> I am trying to bridge multiple calls to multiple Java ESL outbound
>>>> socket applications.
>>>>
>>>> Basically I want to check if the first socket app is engaged then the
>>>> call should be transferred
>>>> to the second socket app and so on.
>>>>
>>>> For initial test, I tried two concurrent calls, the problem is both
>>>> calls are always answered
>>>> by the first outbound socket.
>>>>
>>>> I have following setting in the dialplan:
>>>>
>>>> <extension name="sipgateDialedIn">
>>>> <condition field="destination_number" expression="^5800$">
>>>> <action application="set" data="continue_on_fail=true"/>
>>>> <action application="set" data="hangup_after_bridge=true"/>
>>>> <action application="bridge" data="loopback/5801"/>
>>>> <action application="bridge" data="loopback/5802"/>
>>>>
>>>> <action application="set" data="tts_engine=flite"/>
>>>> <action application="set" data="tts_voice=kal"/>
>>>> <action application="speak" data="Sorry, I am busy at the moment. Please
>>>> try again later."/>
>>>> <action application="sleep" data="10"/>
>>>> <action application="hangup"/>
>>>> </condition>
>>>> </extension>
>>>>
>>>> <extension name="myOutboundESL5801">
>>>> <condition field="destination_number" expression="^5801$">
>>>> <action application="socket" data="127.0.0.1:9981 async full"/>
>>>> </condition>
>>>> </extension>
>>>>
>>>> <extension name="myOutboundESL5802">
>>>> <condition field="destination_number" expression="^5802$">
>>>> <action application="socket" data="127.0.0.1:9982 async full"/>
>>>> </condition>
>>>> </extension>
>>>>
>>>> I expect the first call to 5800 would be asnwered by extension 5801, the
>>>> second concurrent call to 5800 will be
>>>> answered by extension 5802, and the third call gets a busy message.
>>>>
>>>> I use Java ESL client-0.9.2 libraries. How do I check in the dialplan if
>>>> the socket is engaged?
>>>>
>>>> I've tried and googled a while but without success.
>>>>
>>>> Any advices please?
>>>>
>>>> Many thanks!
>>>> Xing
>>>>
>>>>
>>>>
>>>> --
>>>> Heriot-Watt University is a Scottish charity
>>>> registered under charity number SC000278.
>>>>
>>>> Heriot-Watt University is the Sunday Times
>>>> Scottish University of the Year 2011-2012
>>>>
>>>>
>>>>
>>>>
>>>> FreeSWITCH-users mailing list
>>>> FreeSWITCH-users at lists.freeswitch.org
>>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>>>> http://www.freeswitch.org
>>>>
>>>
>>
>>
>> --
>> Heriot-Watt University is a Scottish charity
>> registered under charity number SC000278.
>>
>> Heriot-Watt University is the Sunday Times
>> Scottish University of the Year 2011-2012
>>
>>
>>
>>
>> FreeSWITCH-users mailing list
>> FreeSWITCH-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org
>>
>
>



-- 
Heriot-Watt University is a Scottish charity
registered under charity number SC000278.

Heriot-Watt University is the Sunday Times
Scottish University of the Year 2011-2012




FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org



Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list