Re: [Asterisk-java-users] originateCall in AsteriskManager
Brought to you by:
srt
From: Tony M. <to...@am...> - 2006-06-01 10:50:19
|
I meant to say "I do not know what the ideal callback mechanism would = look like for me ..." -----Original Message----- From: ast...@li... [mailto:ast...@li...] On Behalf Of = Tony Mowers Sent: Thursday, June 01, 2006 12:39 PM To: ast...@li... Subject: Re: [Asterisk-java-users] originateCall in AsteriskManager The asynchronous origination would work for me. I am listening for = channel state changes so it means most things in my particular application are asynchronous. I know what the ideal mechanism would look like for me, so I'll just = talk aloud about some of my thoughts. I would like to be able to register for callbacks before any events are generated for my call. I don't want to miss any events related to my = call. If that can be done by automatically registering my property change = listener to the originating channel immediately then that would be good. I don't know enough about Asterisk to know whether watching the property changes of the originating channel is equivalent to watching a phone = call. I know that intuitively I would like to watch the call. The types of things I'd like to watch for are: - Originating channel was created (I didn't screw up with channel data) - Origination information was incorrect and call ended - Originating channel was congested and so call aborted - Alerting is happening on originating channel=20 - Origination alerting timed out - Originator has answered - Another channel has been linked to call - A channel in the call is being alerted - A channel in the call has answered - One of the channels has hung-up or failed - Call has ended I have to admit that the logical object model for asterisk is not very = clear to me yet. My basic understanding of it is that an originating channel = gets created and then some application is applied to the channel either in = the form of an extension or directly as an application. The application can = do certain things to the channel, such as creating another channel and = linking it to the originating channel. That's my na=EFve understanding of the = logical model. I don't know if this sheds any light on what might be the typical user requirements. -----Original Message----- From: ast...@li... [mailto:ast...@li...] On Behalf Of Stefan Reuter Sent: Thursday, June 01, 2006 12:03 AM To: ast...@li... Subject: Re: [Asterisk-java-users] originateCall in AsteriskManager Hi Tony, these are two very good questions :) What I thought of was to make to call to originate asynchronous so that you could pass it some kind of callback (maybe just a property change listener) that is called on changes to the originated channel. What do you think? =3DStefan Tony Mowers wrote: > Stefan, >=20 > =20 >=20 > I=92ve been playing a little bit with the AsteriskManager interface. = In > my application I have encountered two difficulties: >=20 > =20 >=20 > 1) I have a race condition right after originating the call. I > originate the call, receive the new AsteriskChannel, and then register = a > property change listener with it. I have no way of knowing if the > channel state has changed after origination but before having = registered > the listener. I can probably synchronize on the channel and get a = safe > result, but it feels a bit awkward. >=20 > 2) There is no way for me to determine the reason for the call > failure when the originate returns null. For example if any of the > origination parameters, such as an illegal channel, caused the = failure. >=20 > =20 >=20 > My application code that wraps the AsteriskManager has an interface > somewhat like a JTapi API. >=20 > =20 >=20 > Call call =3D pbxService.createCall(=85); >=20 > call.addObserver(myObserver()); >=20 > call.connect(); >=20 > =20 >=20 > Does anybody have suggestions for how to deal with (1) and (2)? --=20 reuter network consulting Neusser Str. 110 50760 Koeln Germany Telefon: +49 221 1305699-0 Telefax: +49 221 1305699-90 E-Mail: sr...@re... Jabber: sr...@ja... _______________________________________________ Asterisk-java-users mailing list Ast...@li... https://lists.sourceforge.net/lists/listinfo/asterisk-java-users |