Re: [Asterisk-java-users] What does response codes within AbstractOriginateEvent mean?
Brought to you by:
srt
From: Karien Du P. <kar...@gm...> - 2006-10-16 05:16:25
|
Hi. I think it corresponds to the HangupCause. > They are defined in org.asteriskjava.live.HangupCause > Can you confirm this? If yes i will add the appropriate javadoc. > =Stefan Hi, that was my first thought that they correspond to the HangupCase, but it that look that way as I received a 1 in the response all the time in the event of failure. No asnwer, rejected, no such number, etc all had a response of 1. The hangupcauses distinct between all these causes and therefore it can not be the hangupcauses. Then I thought maybe its a bug in asterisk, cause having the failure reasons correpsond to the hangupcauses is a great idea. I search around on the asterisk list and got the following: "Unfortunately, Originate is somehow a mess. Answering your question, the "reason" is not really a reason, at least not in release 1.2.12.1, that is the one im using. The reason is set according to the last communication frame read from the originated channel. Let me explain. When you originate a channel, asterisk starts creating the internal C structure, and then trying to reach the peer. So, one first common control frame received from our originated channel is AST_CONTROL_RING, defined in include/asterisk/frame.h with a value of 2. If originate terminated in that very moment, the reason would be 2. But in your scenario, when the callee does not pick up, the channel is hangup, so the control frame AST_CONTROL_HANGUP is the last frame read, and YES, is defined with a value of 1, the 1 you always receive. The 4 you receive is defined as AST_CONTROL_ANSWER, because that was the last control frame received once the call was answered and the event OriginateSuccess sent. In my personal experience I have the following code working good enough to handle async originate responses, it has some comments so you can see what other reasons im using:" That thread can be read under the following URL http://lists.digium.com/pipermail/asterisk-users/2006-October/169223.html Regards. |