Re: [Asterisk-java-users] Problem with UniqueId and originate command
Brought to you by:
srt
From: Ben H. <bra...@gm...> - 2005-05-18 23:47:48
|
The asterisk-java.patch should work on the 0.2 snapshot dated 5/8. The asterisk.patch should work on asterisk 1.0.7 I went ahead and added 2 new objects: Call and Originate (for lack of a better name). Since there are so many parameters that are possible for an originate I just copied the relevant parts of OriginateAction instead of breaking it into several smaller objects like Channel and DialPlanEntry, etc. I think it can stand some refactoring in the future. Feel free to make modifications and/or tell me how to clean it up. Changes in the patch: 1. AsteriskManager Originate signature and it now also throws generic Exceptions to cover other possible implementations or circumstances. (ie InterruptedException when the thread waits for the Originate to finish). 2. Added event handlers for the Originate related events to DefaultAsteriskManager 3. Added a calls map to DefaultAsteriskManager to keep track of the calls that are going out by actionid. They are removed after they originate, but could be stored and used later. (maybe combined w/ channel for CDR like information) 4. Changed DefaultManagerConnection createInternalActionId to createUniqueActionId and made it part of the interface. (it was useful to create a connection specific uniqueid) 5. Added uniqueId and reason to the Originate Events (as per the asterisk implementation in CVS) With these changes, It works with the * implementation of the uniqueId tracking that is implemented in the latest CVS and the provided patch to 1.0.7. It might not work with your bristuff patched system unless bristuff also added the uniqueid and reason to the originate events. Since *-j didn't have these, I assume it is probably not in there. It should be possible with a few modifications to work with both mainstream and bristuff branches of asterisk. ie just check for uniqueid in the response and use that instead of actionid for the calls map and event handlers. There may be a small race possibility if * sends back the originate event before the sendAction call returns and the call is put in the calls collection. The Async=3Dtrue setting should make this a slim possibility but still a possibility. Any ideas? - Ben |