[Asterisk-java-users] Origination Success, and Dispositon Failure
Brought to you by:
srt
From: Jason W. <ja...@cl...> - 2006-09-18 16:33:37
|
Hello, I am using asterisk java to send origination requests to asterisk server. I test to see if I have received "Success" in the originationresponse. On some calls, I do receive a Success, but the disposition in the CDR reports shows "Failure" because the line is busy. I pretty sure, please correct me if wrong, that Origination Response is not the same as Disposition as reported by asterisk. Here's my problem. I'm using IAX so I don't know the channel that will be used for the call until the call is answered. Here's what happens in normal opperation: 1. origination action sent to Asterisk server with callMap of variables (one variable is callRecordId, which identifies this call in my database) 2. asterisk originates the call and returns success 3. call is answered, userdefined event is fired, reporting two things... the callRecordId and the channel, so that my origination program can now respond to events generated for this channel. Whenever I receive events from asterisk, I check the channel, and look in my 'channels' map to see which recordid this channel is servicing. Then I know what call the event is referencing. 4. so now when I receive a hangup event, which includes channel, I know which call was hungup. PROBLEM: 1. when the line is 'busy' or basically anything besides 'Answered', I don't enter the extensions and therefor the channel doesn't get registered, and I don't know that the call has failed in my origination program. I do receive a ''hangup" event, but I don't know which origination request it belongs to because the channel never got registered, linked to a callrecordid. when I do an originate, remember that I pass a 'callmap' of variables about the call... If I could override the hangup event, to tell me more than just channel... like 'recordid' also from my callmap, then I could parse this event and problem would be solved. Before I start changing asterisk hangup event code, is their a better, simpler way to solve this problem? Jason |