Thread: [Asterisk-java-users] What does response codes within AbstractOriginateEvent mean?
Brought to you by:
srt
From: Karien Du P. <kar...@gm...> - 2006-10-12 13:18:00
|
Hi. I'm using 0.3 milestone release. I'm using the OrigantaAction to make calls, I send it via the managerConnection.sendEventGeneratingAction() in order to get the originate events back. AbstractOriginateEvent contains a getResponse method. I notice that when the originate action succeeds I get a OriginateSuccessEvent and the response code is 4. If the action fails I get the OriginateFailureEvent, with a response code of 1. What are all the different response codes and what do each mean? The reason why I'm asking is that I want to determine the reason for failure and present the user with an appropiate message. "Like the call was rejected". "The call was not picked up in time". "That is not a valid number", "Circuits are busy" , etc. Thanks. |
From: Karien Du P. <kar...@gm...> - 2006-10-12 13:28:38
|
Sorry, please replace response with reason. Thanks. Its the reason code, and the getReason() method. On 10/12/06, Karien Du Preez <kar...@gm...> wrote: > > Hi. > > I'm using 0.3 milestone release. I'm using the OrigantaAction to make > calls, I send it via the managerConnection.sendEventGeneratingAction() in > order to get the originate events back. AbstractOriginateEvent contains a > getResponse method. I notice that when the originate action succeeds I get a > OriginateSuccessEvent and the response code is 4. If the action fails I get > the OriginateFailureEvent, with a response code of 1. > > What are all the different response codes and what do each mean? The > reason why I'm asking is that I want to determine the reason for failure and > present the user with an appropiate message. "Like the call was rejected". > "The call was not picked up in time". "That is not a valid number", > "Circuits are busy" , etc. > > Thanks. > |
From: Stefan R. <ste...@re...> - 2006-10-14 17:31:55
Attachments:
signature.asc
|
Karien Du Preez wrote: > Sorry, please replace response with reason. Thanks. Its the reason code= , > and the getReason() method. 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. =3DStefan >=20 > On 10/12/06, *Karien Du Preez* < kar...@gm... > <mailto:kar...@gm...>> wrote: >=20 > Hi. >=20 > I'm using 0.3 milestone release. I'm using the OrigantaAction to > make calls, I send it via the > managerConnection.sendEventGeneratingAction() in order to get the > originate events back. AbstractOriginateEvent contains a > getResponse method. I notice that when the originate action succeed= s > I get a OriginateSuccessEvent and the response code is 4. If the > action fails I get the OriginateFailureEvent, with a response code > of 1. >=20 > What are all the different response codes and what do each mean? Th= e > reason why I'm asking is that I want to determine the reason for > failure and present the user with an appropiate message. "Like the > call was rejected". "The call was not picked up in time". "That is > not a valid number", "Circuits are busy" , etc. >=20 > Thanks. >=20 >=20 >=20 > -----------------------------------------------------------------------= - >=20 > -----------------------------------------------------------------------= -- > Using Tomcat but need to do more? Need to support web services, securit= y? > Get stuff done quickly with pre-integrated technology to make your job = easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geron= imo > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 >=20 >=20 > -----------------------------------------------------------------------= - >=20 > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users --=20 reuter network consulting Neusser Str. 110 50760 Koeln Germany Telefon: +49 221 1305699-0 Telefax: +49 221 1305699-90 E-Mail: ste...@re... Jabber: ste...@re... |
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. |