Re: [Asterisk-java-users] originateCall in AsteriskManager
Brought to you by:
srt
From: Stefan R. <sr...@re...> - 2006-05-31 22:02:52
|
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. I= n > 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 registere= d > 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... |