Thread: [Asterisk-java-users] asterisk java and astmanproxy
Brought to you by:
srt
From: Aaron E. <aar...@gm...> - 2007-08-01 19:08:08
|
Hi, I'm trying to use asterisk-java with astmanproxy. I am getting the error: org.asteriskjava.manager.TimeoutException: Timeout waiting for protocol identifier Now I did some digging in the archives and found that connecting to astmanproxy is not currently supported but that it might be in the future. The thread was from last year though. Any plans to support it? I also saw that some named Cristian Talle was able to modify the source so that he could use them together. Perhaps that the problem is that the ProxyKey line has to be sent during the connect/login process. I started looking through the source but have not yet located where I would inject that bit of code. If someone could point me in the right direction, or better yet, describe what has to be done to get these working together, that would be sweet. I also saw some threads questioning the value of using astmanproxy in combination with asterisk-java. I think that there are many advantages to doing so. Firstly, I want to use my proxy for more than just asterisk-java clients but would like to have all my asterisk manager API calls going through one place. Secondly, in my case, I have to connect to many (perhaps a dozen or so) asterisk servers right now. I would prefer to just list them in the proxy's configuration rather than having to manage all of these connections in my application individually. Kind regards, aaron |
From: Maciek T. <mlo...@gm...> - 2007-08-01 19:42:53
|
Hi, I had the same problem while using asterisk-java with astmanproxy. Now I'm looking for other AMI poxies (I think, finally i will have to write it on my own). But astmanproxy is the best proxy I already found. Adding support for it to asteriks-java would be great feature. According to your questiopn Aaron, maybe the solution is to change the astamnproxy code and make this program to give output exact like asterisk. Regards, Maciek 2007/8/1, Aaron Evans <aar...@gm...>: > > Hi, > I'm trying to use asterisk-java with astmanproxy. > > I am getting the error: > > org.asteriskjava.manager.TimeoutException: Timeout waiting for > protocol identifier > > Now I did some digging in the archives and found that connecting to > astmanproxy is not currently supported but that it might be in the > future. The thread was from last year though. > > Any plans to support it? > > I also saw that some named Cristian Talle was able to modify the > source so that he could use them together. Perhaps that the problem > is that the ProxyKey line has to be sent during the connect/login > process. > > I started looking through the source but have not yet located where I > would inject that bit of code. > > If someone could point me in the right direction, or better yet, > describe what has to be done to get these working together, that would > be sweet. > > I also saw some threads questioning the value of using astmanproxy in > combination with asterisk-java. > > I think that there are many advantages to doing so. Firstly, I want > to use my proxy for more than just asterisk-java clients but would > like to have all my asterisk manager API calls going through one > place. > > Secondly, in my case, I have to connect to many (perhaps a dozen or > so) asterisk servers right now. I would prefer to just list them in > the proxy's configuration rather than having to manage all of these > connections in my application individually. > > Kind regards, > aaron > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > -- Pozdrawiam Maciek Tokarski |
From: Aaron E. <aar...@gm...> - 2007-08-01 19:54:12
|
Actually, I think maybe I've spotted the problem: In the run method of the ManagerReaderImpl, there is a condition for identifying the protocol identifier. It tests for strings starting with "Asterisk Call Manager/" and "Asterisk Manager Proxy/" and will set the "protocol identifier" if one of those is true. However, AstManProxy is giving back a string that starts with "Asterisk Call Manager Proxy/". I have checked out the source but am not familiar with building with maven 2. So I may try to hack something out by providing my own implementations of the various classes by overriding a few key methods. I'll let you know how it works out... On 8/1/07, Maciek Tokarski <mlo...@gm...> wrote: > Hi, > I had the same problem while using asterisk-java with astmanproxy. Now I'm > looking for other AMI poxies (I think, finally i will have to write it on my > own). But astmanproxy is the best proxy I already found. Adding support for > it to asteriks-java would be great feature. > > According to your questiopn Aaron, maybe the solution is to change the > astamnproxy code and make this program to give output exact like asterisk. > > Regards, > Maciek > > > 2007/8/1, Aaron Evans <aar...@gm...>: > > > > Hi, > > I'm trying to use asterisk-java with astmanproxy. > > > > I am getting the error: > > > > org.asteriskjava.manager.TimeoutException: Timeout > waiting for > > protocol identifier > > > > Now I did some digging in the archives and found that connecting to > > astmanproxy is not currently supported but that it might be in the > > future. The thread was from last year though. > > > > Any plans to support it? > > > > I also saw that some named Cristian Talle was able to modify the > > source so that he could use them together. Perhaps that the problem > > is that the ProxyKey line has to be sent during the connect/login > > process. > > > > I started looking through the source but have not yet located where I > > would inject that bit of code. > > > > If someone could point me in the right direction, or better yet, > > describe what has to be done to get these working together, that would > > be sweet. > > > > I also saw some threads questioning the value of using astmanproxy in > > combination with asterisk-java. > > > > I think that there are many advantages to doing so. Firstly, I want > > to use my proxy for more than just asterisk-java clients but would > > like to have all my asterisk manager API calls going through one > > place. > > > > Secondly, in my case, I have to connect to many (perhaps a dozen or > > so) asterisk servers right now. I would prefer to just list them in > > the proxy's configuration rather than having to manage all of these > > connections in my application individually. > > > > Kind regards, > > aaron > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Splunk Inc. > > Still grepping through log files to find problems? Stop. > > Now Search log events and configuration files using AJAX and a browser. > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > _______________________________________________ > > Asterisk-java-users mailing list > > Ast...@li... > > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > > -- > Pozdrawiam > Maciek Tokarski > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > |
From: Aaron E. <aar...@gm...> - 2007-08-01 20:44:43
|
Ok, I actually ended up making the change to the src and building with maven. That got me a bit further. Now I am getting: org.asteriskjava.manager.AuthenticationFailedException: Unable to send challenge action And standard error says: Unable to retrieve internaActionId from response actionId 'null': org.asteriskjava.manager.response.ChallengeResponse I'll keep looking at the source I guess but any tips are welcome. -aaron On 8/1/07, Aaron Evans <aar...@gm...> wrote: > Actually, I think maybe I've spotted the problem: > > In the run method of the ManagerReaderImpl, there is a condition for > identifying the protocol identifier. It tests for strings starting > with "Asterisk Call Manager/" and "Asterisk Manager Proxy/" and will > set the "protocol identifier" if one of those is true. > > However, AstManProxy is giving back a string that starts with > "Asterisk Call Manager Proxy/". > > I have checked out the source but am not familiar with building with > maven 2. So I may try to hack something out by providing my own > implementations of the various classes by overriding a few key > methods. I'll let you know how it works out... > > On 8/1/07, Maciek Tokarski <mlo...@gm...> wrote: > > Hi, > > I had the same problem while using asterisk-java with astmanproxy. Now I'm > > looking for other AMI poxies (I think, finally i will have to write it on my > > own). But astmanproxy is the best proxy I already found. Adding support for > > it to asteriks-java would be great feature. > > > > According to your questiopn Aaron, maybe the solution is to change the > > astamnproxy code and make this program to give output exact like asterisk. > > > > Regards, > > Maciek > > > > > > 2007/8/1, Aaron Evans <aar...@gm...>: > > > > > > Hi, > > > I'm trying to use asterisk-java with astmanproxy. > > > > > > I am getting the error: > > > > > > org.asteriskjava.manager.TimeoutException: Timeout > > waiting for > > > protocol identifier > > > > > > Now I did some digging in the archives and found that connecting to > > > astmanproxy is not currently supported but that it might be in the > > > future. The thread was from last year though. > > > > > > Any plans to support it? > > > > > > I also saw that some named Cristian Talle was able to modify the > > > source so that he could use them together. Perhaps that the problem > > > is that the ProxyKey line has to be sent during the connect/login > > > process. > > > > > > I started looking through the source but have not yet located where I > > > would inject that bit of code. > > > > > > If someone could point me in the right direction, or better yet, > > > describe what has to be done to get these working together, that would > > > be sweet. > > > > > > I also saw some threads questioning the value of using astmanproxy in > > > combination with asterisk-java. > > > > > > I think that there are many advantages to doing so. Firstly, I want > > > to use my proxy for more than just asterisk-java clients but would > > > like to have all my asterisk manager API calls going through one > > > place. > > > > > > Secondly, in my case, I have to connect to many (perhaps a dozen or > > > so) asterisk servers right now. I would prefer to just list them in > > > the proxy's configuration rather than having to manage all of these > > > connections in my application individually. > > > > > > Kind regards, > > > aaron > > > > > > > > ------------------------------------------------------------------------- > > > This SF.net email is sponsored by: Splunk Inc. > > > Still grepping through log files to find problems? Stop. > > > Now Search log events and configuration files using AJAX and a browser. > > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > > _______________________________________________ > > > Asterisk-java-users mailing list > > > Ast...@li... > > > > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > > > > > > > -- > > Pozdrawiam > > Maciek Tokarski > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Splunk Inc. > > Still grepping through log files to find problems? Stop. > > Now Search log events and configuration files using AJAX and a browser. > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > _______________________________________________ > > Asterisk-java-users mailing list > > Ast...@li... > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > |
From: Aaron E. <aar...@gm...> - 2007-08-01 20:47:25
|
One more tidbit: The exception was caused by org.asteriskjava.manager.TimeoutException: Timeout waiting for response to Challenge On 8/1/07, Aaron Evans <aar...@gm...> wrote: > Ok, I actually ended up making the change to the src and building with maven. > > That got me a bit further. Now I am getting: > > org.asteriskjava.manager.AuthenticationFailedException: Unable to send > challenge action > > And standard error says: > > Unable to retrieve internaActionId from response actionId 'null': > org.asteriskjava.manager.response.ChallengeResponse > > I'll keep looking at the source I guess but any tips are welcome. > > -aaron > > On 8/1/07, Aaron Evans <aar...@gm...> wrote: > > Actually, I think maybe I've spotted the problem: > > > > In the run method of the ManagerReaderImpl, there is a condition for > > identifying the protocol identifier. It tests for strings starting > > with "Asterisk Call Manager/" and "Asterisk Manager Proxy/" and will > > set the "protocol identifier" if one of those is true. > > > > However, AstManProxy is giving back a string that starts with > > "Asterisk Call Manager Proxy/". > > > > I have checked out the source but am not familiar with building with > > maven 2. So I may try to hack something out by providing my own > > implementations of the various classes by overriding a few key > > methods. I'll let you know how it works out... > > > > On 8/1/07, Maciek Tokarski <mlo...@gm...> wrote: > > > Hi, > > > I had the same problem while using asterisk-java with astmanproxy. Now I'm > > > looking for other AMI poxies (I think, finally i will have to write it on my > > > own). But astmanproxy is the best proxy I already found. Adding support for > > > it to asteriks-java would be great feature. > > > > > > According to your questiopn Aaron, maybe the solution is to change the > > > astamnproxy code and make this program to give output exact like asterisk. > > > > > > Regards, > > > Maciek > > > > > > > > > 2007/8/1, Aaron Evans <aar...@gm...>: > > > > > > > > Hi, > > > > I'm trying to use asterisk-java with astmanproxy. > > > > > > > > I am getting the error: > > > > > > > > org.asteriskjava.manager.TimeoutException: Timeout > > > waiting for > > > > protocol identifier > > > > > > > > Now I did some digging in the archives and found that connecting to > > > > astmanproxy is not currently supported but that it might be in the > > > > future. The thread was from last year though. > > > > > > > > Any plans to support it? > > > > > > > > I also saw that some named Cristian Talle was able to modify the > > > > source so that he could use them together. Perhaps that the problem > > > > is that the ProxyKey line has to be sent during the connect/login > > > > process. > > > > > > > > I started looking through the source but have not yet located where I > > > > would inject that bit of code. > > > > > > > > If someone could point me in the right direction, or better yet, > > > > describe what has to be done to get these working together, that would > > > > be sweet. > > > > > > > > I also saw some threads questioning the value of using astmanproxy in > > > > combination with asterisk-java. > > > > > > > > I think that there are many advantages to doing so. Firstly, I want > > > > to use my proxy for more than just asterisk-java clients but would > > > > like to have all my asterisk manager API calls going through one > > > > place. > > > > > > > > Secondly, in my case, I have to connect to many (perhaps a dozen or > > > > so) asterisk servers right now. I would prefer to just list them in > > > > the proxy's configuration rather than having to manage all of these > > > > connections in my application individually. > > > > > > > > Kind regards, > > > > aaron > > > > > > > > > > > ------------------------------------------------------------------------- > > > > This SF.net email is sponsored by: Splunk Inc. > > > > Still grepping through log files to find problems? Stop. > > > > Now Search log events and configuration files using AJAX and a browser. > > > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > > > _______________________________________________ > > > > Asterisk-java-users mailing list > > > > Ast...@li... > > > > > > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > > > > > > > > > > > > -- > > > Pozdrawiam > > > Maciek Tokarski > > > ------------------------------------------------------------------------- > > > This SF.net email is sponsored by: Splunk Inc. > > > Still grepping through log files to find problems? Stop. > > > Now Search log events and configuration files using AJAX and a browser. > > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > > _______________________________________________ > > > Asterisk-java-users mailing list > > > Ast...@li... > > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > > > > > |
From: Martin S. <ma...@be...> - 2007-08-01 21:20:36
|
Hello Aaron, It will be critical to get that protocol information from the AMI, or its proxy. It sounds like the protocol part may not be available at all, but could be inferred if the proxy appends "Proxy" to the original Asterisk string, as it appears "Asterisk Call Manager Proxy/" may be. Have you tried using cleartext login? LoginAction(java.lang.String username, java.lang.String secret) I'd compare an ngrep of the AJ conversation w/ AstManProxy to the conversation with Asterisk itself, with the challenge/response login, and see if there are big differences. Martin Smith, Systems Developer ma...@be... Bureau of Economic and Business Research University of Florida (352) 392-0171 Ext. 221=20 =20 > -----Original Message----- > From: ast...@li...=20 > [mailto:ast...@li...] On=20 > Behalf Of Aaron Evans > Sent: Wednesday, August 01, 2007 4:47 PM > To: ast...@li... > Subject: Re: [Asterisk-java-users] asterisk java and astmanproxy >=20 > One more tidbit: > The exception was caused by >=20 > org.asteriskjava.manager.TimeoutException: Timeout waiting for > response to Challenge >=20 > On 8/1/07, Aaron Evans <aar...@gm...> wrote: > > Ok, I actually ended up making the change to the src and=20 > building with maven. > > > > That got me a bit further. Now I am getting: > > > > org.asteriskjava.manager.AuthenticationFailedException:=20 > Unable to send > > challenge action > > > > And standard error says: > > > > Unable to retrieve internaActionId from response actionId 'null': > > org.asteriskjava.manager.response.ChallengeResponse > > > > I'll keep looking at the source I guess but any tips are welcome. > > > > -aaron > > > > On 8/1/07, Aaron Evans <aar...@gm...> wrote: > > > Actually, I think maybe I've spotted the problem: > > > > > > In the run method of the ManagerReaderImpl, there is a=20 > condition for > > > identifying the protocol identifier. It tests for=20 > strings starting > > > with "Asterisk Call Manager/" and "Asterisk Manager=20 > Proxy/" and will > > > set the "protocol identifier" if one of those is true. > > > > > > However, AstManProxy is giving back a string that starts with > > > "Asterisk Call Manager Proxy/". > > > > > > I have checked out the source but am not familiar with=20 > building with > > > maven 2. So I may try to hack something out by providing my own > > > implementations of the various classes by overriding a few key > > > methods. I'll let you know how it works out... > > > > > > On 8/1/07, Maciek Tokarski <mlo...@gm...> wrote: > > > > Hi, > > > > I had the same problem while using asterisk-java with=20 > astmanproxy. Now I'm > > > > looking for other AMI poxies (I think, finally i will=20 > have to write it on my > > > > own). But astmanproxy is the best proxy I already=20 > found. Adding support for > > > > it to asteriks-java would be great feature. > > > > > > > > According to your questiopn Aaron, maybe the solution=20 > is to change the > > > > astamnproxy code and make this program to give output=20 > exact like asterisk. > > > > > > > > Regards, > > > > Maciek > > > > > > > > > > > > 2007/8/1, Aaron Evans <aar...@gm...>: > > > > > > > > > > Hi, > > > > > I'm trying to use asterisk-java with astmanproxy. > > > > > > > > > > I am getting the error: > > > > > > > > > > org.asteriskjava.manager.TimeoutException: Timeout > > > > waiting for > > > > > protocol identifier > > > > > > > > > > Now I did some digging in the archives and found that=20 > connecting to > > > > > astmanproxy is not currently supported but that it=20 > might be in the > > > > > future. The thread was from last year though. > > > > > > > > > > Any plans to support it? > > > > > > > > > > I also saw that some named Cristian Talle was able to=20 > modify the > > > > > source so that he could use them together. Perhaps=20 > that the problem > > > > > is that the ProxyKey line has to be sent during the=20 > connect/login > > > > > process. > > > > > > > > > > I started looking through the source but have not yet=20 > located where I > > > > > would inject that bit of code. > > > > > > > > > > If someone could point me in the right direction, or=20 > better yet, > > > > > describe what has to be done to get these working=20 > together, that would > > > > > be sweet. > > > > > > > > > > I also saw some threads questioning the value of=20 > using astmanproxy in > > > > > combination with asterisk-java. > > > > > > > > > > I think that there are many advantages to doing so. =20 > Firstly, I want > > > > > to use my proxy for more than just asterisk-java=20 > clients but would > > > > > like to have all my asterisk manager API calls going=20 > through one > > > > > place. > > > > > > > > > > Secondly, in my case, I have to connect to many=20 > (perhaps a dozen or > > > > > so) asterisk servers right now. I would prefer to=20 > just list them in > > > > > the proxy's configuration rather than having to=20 > manage all of these > > > > > connections in my application individually. > > > > > > > > > > Kind regards, > > > > > aaron > > > > > > > > > > > > > >=20 > -------------------------------------------------------------- > ----------- > > > > > This SF.net email is sponsored by: Splunk Inc. > > > > > Still grepping through log files to find problems? Stop. > > > > > Now Search log events and configuration files using=20 > AJAX and a browser. > > > > > Download your FREE copy of Splunk now >> =20 > http://get.splunk.com/ > > > > > _______________________________________________ > > > > > Asterisk-java-users mailing list > > > > > Ast...@li... > > > > > > > > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > > > > > > > > > > > > > > > > > -- > > > > Pozdrawiam > > > > Maciek Tokarski > > > >=20 > -------------------------------------------------------------- > ----------- > > > > This SF.net email is sponsored by: Splunk Inc. > > > > Still grepping through log files to find problems? Stop. > > > > Now Search log events and configuration files using=20 > AJAX and a browser. > > > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > > > _______________________________________________ > > > > Asterisk-java-users mailing list > > > > Ast...@li... > > > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > > > > > > > > > >=20 > -------------------------------------------------------------- > ----------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and=20 > a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >=20 |
From: Aaron E. <aar...@gm...> - 2007-08-01 21:39:12
|
In the hack I did, I simply added an "or" so that Asterisk Call Manager Proxy/ is an allowable protocol prefix. In stderr, I see "Unsupported protocol version 'Asterisk Call Manager Proxy/1.21'. Use at your own risk.", so it is taking it. Can I configure asterisk java to use clear text login? I don't see how. I'm using the DefaultManagerConnection object. I did the Challenge action from the command line by telnet-ing to an asterisk server and then to the proxy and the conversations looked identical in format (except for the number that was spit back in the Challenge attribute of the response). I'm not sure how to "record" the AJ conversation though. In stderr, the following was written by AJ: org.asteriskjava.manager.response.ChallengeResponse: actionId='null'; message='null'; response='Success'; uniqueId='null'; systemHashcode=17227822 So it seemed to work but for whatever reason, AJ is not building a response object out of it and since it is null it throws the timeout exception. On 8/1/07, Martin Smith <ma...@be...> wrote: > Hello Aaron, > > It will be critical to get that protocol information from the AMI, or > its proxy. It sounds like the protocol part may not be available at all, > but could be inferred if the proxy appends "Proxy" to the original > Asterisk string, as it appears "Asterisk Call Manager Proxy/" may be. > > Have you tried using cleartext login? > LoginAction(java.lang.String username, java.lang.String secret) > > I'd compare an ngrep of the AJ conversation w/ AstManProxy to the > conversation with Asterisk itself, with the challenge/response login, > and see if there are big differences. > > Martin Smith, Systems Developer > ma...@be... > Bureau of Economic and Business Research > University of Florida > (352) 392-0171 Ext. 221 > > > > > -----Original Message----- > > From: ast...@li... > > [mailto:ast...@li...] On > > Behalf Of Aaron Evans > > Sent: Wednesday, August 01, 2007 4:47 PM > > To: ast...@li... > > Subject: Re: [Asterisk-java-users] asterisk java and astmanproxy > > > > One more tidbit: > > The exception was caused by > > > > org.asteriskjava.manager.TimeoutException: Timeout waiting for > > response to Challenge > > > > On 8/1/07, Aaron Evans <aar...@gm...> wrote: > > > Ok, I actually ended up making the change to the src and > > building with maven. > > > > > > That got me a bit further. Now I am getting: > > > > > > org.asteriskjava.manager.AuthenticationFailedException: > > Unable to send > > > challenge action > > > > > > And standard error says: > > > > > > Unable to retrieve internaActionId from response actionId 'null': > > > org.asteriskjava.manager.response.ChallengeResponse > > > > > > I'll keep looking at the source I guess but any tips are welcome. > > > > > > -aaron > > > > > > On 8/1/07, Aaron Evans <aar...@gm...> wrote: > > > > Actually, I think maybe I've spotted the problem: > > > > > > > > In the run method of the ManagerReaderImpl, there is a > > condition for > > > > identifying the protocol identifier. It tests for > > strings starting > > > > with "Asterisk Call Manager/" and "Asterisk Manager > > Proxy/" and will > > > > set the "protocol identifier" if one of those is true. > > > > > > > > However, AstManProxy is giving back a string that starts with > > > > "Asterisk Call Manager Proxy/". > > > > > > > > I have checked out the source but am not familiar with > > building with > > > > maven 2. So I may try to hack something out by providing my own > > > > implementations of the various classes by overriding a few key > > > > methods. I'll let you know how it works out... > > > > > > > > On 8/1/07, Maciek Tokarski <mlo...@gm...> wrote: > > > > > Hi, > > > > > I had the same problem while using asterisk-java with > > astmanproxy. Now I'm > > > > > looking for other AMI poxies (I think, finally i will > > have to write it on my > > > > > own). But astmanproxy is the best proxy I already > > found. Adding support for > > > > > it to asteriks-java would be great feature. > > > > > > > > > > According to your questiopn Aaron, maybe the solution > > is to change the > > > > > astamnproxy code and make this program to give output > > exact like asterisk. > > > > > > > > > > Regards, > > > > > Maciek > > > > > > > > > > > > > > > 2007/8/1, Aaron Evans <aar...@gm...>: > > > > > > > > > > > > Hi, > > > > > > I'm trying to use asterisk-java with astmanproxy. > > > > > > > > > > > > I am getting the error: > > > > > > > > > > > > org.asteriskjava.manager.TimeoutException: Timeout > > > > > waiting for > > > > > > protocol identifier > > > > > > > > > > > > Now I did some digging in the archives and found that > > connecting to > > > > > > astmanproxy is not currently supported but that it > > might be in the > > > > > > future. The thread was from last year though. > > > > > > > > > > > > Any plans to support it? > > > > > > > > > > > > I also saw that some named Cristian Talle was able to > > modify the > > > > > > source so that he could use them together. Perhaps > > that the problem > > > > > > is that the ProxyKey line has to be sent during the > > connect/login > > > > > > process. > > > > > > > > > > > > I started looking through the source but have not yet > > located where I > > > > > > would inject that bit of code. > > > > > > > > > > > > If someone could point me in the right direction, or > > better yet, > > > > > > describe what has to be done to get these working > > together, that would > > > > > > be sweet. > > > > > > > > > > > > I also saw some threads questioning the value of > > using astmanproxy in > > > > > > combination with asterisk-java. > > > > > > > > > > > > I think that there are many advantages to doing so. > > Firstly, I want > > > > > > to use my proxy for more than just asterisk-java > > clients but would > > > > > > like to have all my asterisk manager API calls going > > through one > > > > > > place. > > > > > > > > > > > > Secondly, in my case, I have to connect to many > > (perhaps a dozen or > > > > > > so) asterisk servers right now. I would prefer to > > just list them in > > > > > > the proxy's configuration rather than having to > > manage all of these > > > > > > connections in my application individually. > > > > > > > > > > > > Kind regards, > > > > > > aaron > > > > > > > > > > > > > > > > > > > -------------------------------------------------------------- > > ----------- > > > > > > This SF.net email is sponsored by: Splunk Inc. > > > > > > Still grepping through log files to find problems? Stop. > > > > > > Now Search log events and configuration files using > > AJAX and a browser. > > > > > > Download your FREE copy of Splunk now >> > > http://get.splunk.com/ > > > > > > _______________________________________________ > > > > > > Asterisk-java-users mailing list > > > > > > Ast...@li... > > > > > > > > > > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > Pozdrawiam > > > > > Maciek Tokarski > > > > > > > -------------------------------------------------------------- > > ----------- > > > > > This SF.net email is sponsored by: Splunk Inc. > > > > > Still grepping through log files to find problems? Stop. > > > > > Now Search log events and configuration files using > > AJAX and a browser. > > > > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > > > > _______________________________________________ > > > > > Asterisk-java-users mailing list > > > > > Ast...@li... > > > > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > > > > > > > > > > > > > > > > > > -------------------------------------------------------------- > > ----------- > > This SF.net email is sponsored by: Splunk Inc. > > Still grepping through log files to find problems? Stop. > > Now Search log events and configuration files using AJAX and > > a browser. > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > _______________________________________________ > > Asterisk-java-users mailing list > > Ast...@li... > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > |
From: S. B. S. <bs...@no...> - 2007-08-01 21:46:18
|
FYI - there appears to be a major bug in astmanproxy 1.21. For commands like SIPPeers it is only returning the initial header and not the whole list. This appears to be a timing issue and so may not appear on all systems or everytime the call is run. I'm doing further investigation to try and create a patch. If anyone knows how to lodge a support request on astmanproxy I would be interested. Regards, Brett. Aaron Evans wrote: > In the hack I did, I simply added an "or" so that Asterisk Call > Manager Proxy/ is an allowable protocol prefix. > > In stderr, I see "Unsupported protocol version 'Asterisk Call Manager > Proxy/1.21'. Use at your own risk.", so it is taking it. > > Can I configure asterisk java to use clear text login? I don't see > how. I'm using the DefaultManagerConnection object. > > I did the Challenge action from the command line by telnet-ing to an > asterisk server and then to the proxy and the conversations looked > identical in format (except for the number that was spit back in the > Challenge attribute of the response). > > I'm not sure how to "record" the AJ conversation though. > > In stderr, the following was written by AJ: > > org.asteriskjava.manager.response.ChallengeResponse: actionId='null'; > message='null'; response='Success'; uniqueId='null'; > systemHashcode=17227822 > > So it seemed to work but for whatever reason, AJ is not building a > response object out of it and since it is null it throws the timeout > exception. > > > > On 8/1/07, Martin Smith <ma...@be...> wrote: > >> Hello Aaron, >> >> It will be critical to get that protocol information from the AMI, or >> its proxy. It sounds like the protocol part may not be available at all, >> but could be inferred if the proxy appends "Proxy" to the original >> Asterisk string, as it appears "Asterisk Call Manager Proxy/" may be. >> >> Have you tried using cleartext login? >> LoginAction(java.lang.String username, java.lang.String secret) >> >> I'd compare an ngrep of the AJ conversation w/ AstManProxy to the >> conversation with Asterisk itself, with the challenge/response login, >> and see if there are big differences. >> >> Martin Smith, Systems Developer >> ma...@be... >> Bureau of Economic and Business Research >> University of Florida >> (352) 392-0171 Ext. 221 >> >> >> >> >>> -----Original Message----- >>> From: ast...@li... >>> [mailto:ast...@li...] On >>> Behalf Of Aaron Evans >>> Sent: Wednesday, August 01, 2007 4:47 PM >>> To: ast...@li... >>> Subject: Re: [Asterisk-java-users] asterisk java and astmanproxy >>> >>> One more tidbit: >>> The exception was caused by >>> >>> org.asteriskjava.manager.TimeoutException: Timeout waiting for >>> response to Challenge >>> >>> On 8/1/07, Aaron Evans <aar...@gm...> wrote: >>> >>>> Ok, I actually ended up making the change to the src and >>>> >>> building with maven. >>> >>>> That got me a bit further. Now I am getting: >>>> >>>> org.asteriskjava.manager.AuthenticationFailedException: >>>> >>> Unable to send >>> >>>> challenge action >>>> >>>> And standard error says: >>>> >>>> Unable to retrieve internaActionId from response actionId 'null': >>>> org.asteriskjava.manager.response.ChallengeResponse >>>> >>>> I'll keep looking at the source I guess but any tips are welcome. >>>> >>>> -aaron >>>> >>>> On 8/1/07, Aaron Evans <aar...@gm...> wrote: >>>> >>>>> Actually, I think maybe I've spotted the problem: >>>>> >>>>> In the run method of the ManagerReaderImpl, there is a >>>>> >>> condition for >>> >>>>> identifying the protocol identifier. It tests for >>>>> >>> strings starting >>> >>>>> with "Asterisk Call Manager/" and "Asterisk Manager >>>>> >>> Proxy/" and will >>> >>>>> set the "protocol identifier" if one of those is true. >>>>> >>>>> However, AstManProxy is giving back a string that starts with >>>>> "Asterisk Call Manager Proxy/". >>>>> >>>>> I have checked out the source but am not familiar with >>>>> >>> building with >>> >>>>> maven 2. So I may try to hack something out by providing my own >>>>> implementations of the various classes by overriding a few key >>>>> methods. I'll let you know how it works out... >>>>> >>>>> On 8/1/07, Maciek Tokarski <mlo...@gm...> wrote: >>>>> >>>>>> Hi, >>>>>> I had the same problem while using asterisk-java with >>>>>> >>> astmanproxy. Now I'm >>> >>>>>> looking for other AMI poxies (I think, finally i will >>>>>> >>> have to write it on my >>> >>>>>> own). But astmanproxy is the best proxy I already >>>>>> >>> found. Adding support for >>> >>>>>> it to asteriks-java would be great feature. >>>>>> >>>>>> According to your questiopn Aaron, maybe the solution >>>>>> >>> is to change the >>> >>>>>> astamnproxy code and make this program to give output >>>>>> >>> exact like asterisk. >>> >>>>>> Regards, >>>>>> Maciek >>>>>> >>>>>> >>>>>> 2007/8/1, Aaron Evans <aar...@gm...>: >>>>>> >>>>>>> Hi, >>>>>>> I'm trying to use asterisk-java with astmanproxy. >>>>>>> >>>>>>> I am getting the error: >>>>>>> >>>>>>> org.asteriskjava.manager.TimeoutException: Timeout >>>>>>> >>>>>> waiting for >>>>>> >>>>>>> protocol identifier >>>>>>> >>>>>>> Now I did some digging in the archives and found that >>>>>>> >>> connecting to >>> >>>>>>> astmanproxy is not currently supported but that it >>>>>>> >>> might be in the >>> >>>>>>> future. The thread was from last year though. >>>>>>> >>>>>>> Any plans to support it? >>>>>>> >>>>>>> I also saw that some named Cristian Talle was able to >>>>>>> >>> modify the >>> >>>>>>> source so that he could use them together. Perhaps >>>>>>> >>> that the problem >>> >>>>>>> is that the ProxyKey line has to be sent during the >>>>>>> >>> connect/login >>> >>>>>>> process. >>>>>>> >>>>>>> I started looking through the source but have not yet >>>>>>> >>> located where I >>> >>>>>>> would inject that bit of code. >>>>>>> >>>>>>> If someone could point me in the right direction, or >>>>>>> >>> better yet, >>> >>>>>>> describe what has to be done to get these working >>>>>>> >>> together, that would >>> >>>>>>> be sweet. >>>>>>> >>>>>>> I also saw some threads questioning the value of >>>>>>> >>> using astmanproxy in >>> >>>>>>> combination with asterisk-java. >>>>>>> >>>>>>> I think that there are many advantages to doing so. >>>>>>> >>> Firstly, I want >>> >>>>>>> to use my proxy for more than just asterisk-java >>>>>>> >>> clients but would >>> >>>>>>> like to have all my asterisk manager API calls going >>>>>>> >>> through one >>> >>>>>>> place. >>>>>>> >>>>>>> Secondly, in my case, I have to connect to many >>>>>>> >>> (perhaps a dozen or >>> >>>>>>> so) asterisk servers right now. I would prefer to >>>>>>> >>> just list them in >>> >>>>>>> the proxy's configuration rather than having to >>>>>>> >>> manage all of these >>> >>>>>>> connections in my application individually. >>>>>>> >>>>>>> Kind regards, >>>>>>> aaron >>>>>>> >>>>>>> >>>>>>> >>> -------------------------------------------------------------- >>> ----------- >>> >>>>>>> This SF.net email is sponsored by: Splunk Inc. >>>>>>> Still grepping through log files to find problems? Stop. >>>>>>> Now Search log events and configuration files using >>>>>>> >>> AJAX and a browser. >>> >>>>>>> Download your FREE copy of Splunk now >> >>>>>>> >>> http://get.splunk.com/ >>> >>>>>>> _______________________________________________ >>>>>>> Asterisk-java-users mailing list >>>>>>> Ast...@li... >>>>>>> >>>>>>> >>>>>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>>>>> >>>>>> >>>>>> -- >>>>>> Pozdrawiam >>>>>> Maciek Tokarski >>>>>> >>>>>> >>> -------------------------------------------------------------- >>> ----------- >>> >>>>>> This SF.net email is sponsored by: Splunk Inc. >>>>>> Still grepping through log files to find problems? Stop. >>>>>> Now Search log events and configuration files using >>>>>> >>> AJAX and a browser. >>> >>>>>> Download your FREE copy of Splunk now >> http://get.splunk.com/ >>>>>> _______________________________________________ >>>>>> Asterisk-java-users mailing list >>>>>> Ast...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>>>>> >>>>>> >>>>>> >>> -------------------------------------------------------------- >>> ----------- >>> This SF.net email is sponsored by: Splunk Inc. >>> Still grepping through log files to find problems? Stop. >>> Now Search log events and configuration files using AJAX and >>> a browser. >>> Download your FREE copy of Splunk now >> http://get.splunk.com/ >>> _______________________________________________ >>> Asterisk-java-users mailing list >>> Ast...@li... >>> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >>> >>> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by: Splunk Inc. >> Still grepping through log files to find problems? Stop. >> Now Search log events and configuration files using AJAX and a browser. >> Download your FREE copy of Splunk now >> http://get.splunk.com/ >> _______________________________________________ >> Asterisk-java-users mailing list >> Ast...@li... >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >> >> > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > |
From: S. B. S. <bs...@no...> - 2007-10-12 06:39:37
|
Stefan, I don't know if anyone will find this useful, but I've created a little simulator for Fast AGI. The idea is that you can use it in a test enviroment to simulate fast agi calls FROM an asterisk server. Its by no means complete and has had only basic testing, but I found it useful and thought the community might get some benefit from it. On word of warning, it tampers with the URL protocol factories so don't use this inside any application which intends to use the URL class. It is only intended for use as a test driver in something like junit. If you want it, I'm happy to put it into the public domain. To use the script do the following: FastAgiSimulator fast = new FastAgiSimulator(); fast.setVariable("somekey", "somevalue"); fast.execute("agi://localhost/Auth?Amount=10.00&CC=1234"); Regards, S. Brett Sutton /* * This class is designed to simulate a fast agi call originating * from an asterisk server. * * The idea is that when developing a fast agi server you can use * this class to simulate the AGI() command for testing purposes. * */ package au.com.asteriskit.fastagi.paymentgateway.test; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.net.Socket; import java.net.URL; import java.net.URLConnection; import java.net.URLStreamHandler; import java.net.URLStreamHandlerFactory; import java.util.HashMap; import org.apache.log4j.Logger; public class FastAgiSimulator { static final Logger s_logger = Logger.getLogger(FastAgiSimulator.class); static final int FASTAGI_PORT = 4573; HashMap<String, String> vars = new HashMap<String, String>(); private boolean initialized = false;; /** * Allows you to simulating setting an asterisk variable. * Set all variables before calling execute. * @param key * @param value */ void setVariable(String key, String value) { vars.put(key, value); } void execute(String urlString) throws IOException { init(); URL url = new URL(urlString); Socket client = new Socket(url.getHost(), (url.getPort() == -1 ? FASTAGI_PORT : url.getPort())); OutputStream os = client.getOutputStream(); writeAgiVar(os, "network", "yes"); writeAgiVar(os, "network_script", url.getPath() + (url.getQuery() == null ? "" : ("?" + url.getQuery()))); for (String key : vars.keySet()) { String value = vars.get(key); writeAgiVar(os, key, value); } os.write("\n".getBytes()); os.flush(); // Wait for responses and just Ack BufferedWriter br = new BufferedWriter(new OutputStreamWriter(client.getOutputStream())); InputStream is = client.getInputStream(); BufferedReader lr = new BufferedReader(new InputStreamReader(is)); String line = null; while ((line = lr.readLine()) != null) { s_logger.debug(line); // Just reply back with a 'status ok'. br.write("200 result=OK\n"); br.flush(); } } private void init() { if (!initialized ) URL.setURLStreamHandlerFactory(new AgiStreamHandlerFactory()); initialized = true; } private void writeAgiVar(OutputStream os, String argName, String argValue) throws IOException { if (s_logger.isDebugEnabled()) s_logger.debug("Writing agi var: " + argName + ": " + argValue); os.write(("agi_" + argName + ": " + argValue + "\n").getBytes()); } // Add a fake stream handler so that the agi: protocol is handled by // the URL class class AgiStreamHandlerFactory implements URLStreamHandlerFactory { AgiStreamHandlerFactory() { } public URLStreamHandler createURLStreamHandler(String protocol) { // TODO Auto-generated method stub return new AgiURLStreamHandler(); } } class AgiURLStreamHandler extends URLStreamHandler { @Override protected URLConnection openConnection(URL u) throws IOException { // Not used return null; } } } |
From: Martin S. <ma...@be...> - 2007-10-12 14:50:48
|
Very cool -- thanks for sharing! Martin Smith, Systems Developer ma...@be... Bureau of Economic and Business Research University of Florida (352) 392-0171 Ext. 221=20 =20 > -----Original Message----- > From: ast...@li...=20 > [mailto:ast...@li...] On=20 > Behalf Of S. Brett Sutton > Sent: Friday, October 12, 2007 2:40 AM > To: ast...@li... > Subject: [Asterisk-java-users] FastAgi Simulate >=20 > Stefan, > I don't know if anyone will find this useful, but I've created a=20 > little simulator for Fast AGI. >=20 > The idea is that you can use it in a test enviroment to simulate fast=20 > agi calls FROM an asterisk server. >=20 > Its by no means complete and has had only basic testing, but=20 > I found it=20 > useful and thought the community might get some benefit from it. >=20 > On word of warning, it tampers with the URL protocol=20 > factories so don't=20 > use this inside any application which intends to use the URL=20 > class. It=20 > is only intended for use as a test driver in something like junit. >=20 > If you want it, I'm happy to put it into the public domain. >=20 > To use the script do the following: >=20 > FastAgiSimulator fast =3D new FastAgiSimulator(); > =20 > fast.setVariable("somekey", "somevalue"); > = fast.execute("agi://localhost/Auth?Amount=3D10.00&CC=3D1234"); >=20 >=20 > Regards, > S. Brett Sutton >=20 >=20 > /* > * This class is designed to simulate a fast agi call originating > * from an asterisk server. > * > * The idea is that when developing a fast agi server you can use > * this class to simulate the AGI() command for testing purposes. > * > */ > package au.com.asteriskit.fastagi.paymentgateway.test; >=20 > import java.io.BufferedReader; > import java.io.BufferedWriter; > import java.io.IOException; > import java.io.InputStream; > import java.io.InputStreamReader; > import java.io.OutputStream; > import java.io.OutputStreamWriter; > import java.net.Socket; > import java.net.URL; > import java.net.URLConnection; > import java.net.URLStreamHandler; > import java.net.URLStreamHandlerFactory; > import java.util.HashMap; >=20 > import org.apache.log4j.Logger; >=20 > public class FastAgiSimulator > { > static final Logger s_logger =3D=20 > Logger.getLogger(FastAgiSimulator.class); > static final int FASTAGI_PORT =3D 4573; > =20 > HashMap<String, String> vars =3D new HashMap<String, String>(); > private boolean initialized =3D false;; > =20 > /** > * Allows you to simulating setting an asterisk variable. > * Set all variables before calling execute. > * @param key > * @param value > */ > void setVariable(String key, String value) > { > vars.put(key, value); > } > =20 > void execute(String urlString) throws IOException > { > init(); > URL url =3D new URL(urlString); > =20 > =20 > Socket client =3D new Socket(url.getHost(),=20 > (url.getPort() =3D=3D -1 ?=20 > FASTAGI_PORT > : url.getPort())); >=20 > OutputStream os =3D client.getOutputStream(); > =20 > writeAgiVar(os, "network", "yes"); > writeAgiVar(os, "network_script", > url.getPath() + (url.getQuery() =3D=3D null ? "" : ("?" +=20 > url.getQuery()))); > =20 > for (String key : vars.keySet()) > { > String value =3D vars.get(key); > writeAgiVar(os, key, value); > } > =20 > os.write("\n".getBytes()); > os.flush(); >=20 > // Wait for responses and just Ack > BufferedWriter br =3D new BufferedWriter(new=20 > OutputStreamWriter(client.getOutputStream())); > InputStream is =3D client.getInputStream(); > BufferedReader lr =3D new BufferedReader(new=20 > InputStreamReader(is)); > String line =3D null; > while ((line =3D lr.readLine()) !=3D null) > { > s_logger.debug(line); > // Just reply back with a 'status ok'. > br.write("200 result=3DOK\n"); > br.flush(); > } >=20 > } > =20 > =20 > private void init() > { > if (!initialized ) > URL.setURLStreamHandlerFactory(new=20 > AgiStreamHandlerFactory()); > initialized =3D true; > =20 > } >=20 > private void writeAgiVar(OutputStream os, > String argName, String argValue) throws IOException > { > if (s_logger.isDebugEnabled()) > s_logger.debug("Writing agi var: " + argName + ":=20 > " + argValue); > =20 > os.write(("agi_" + argName + ": " + argValue +=20 > "\n").getBytes()); > } > =20 > =20 > // Add a fake stream handler so that the agi: protocol is=20 > handled by > // the URL class > class AgiStreamHandlerFactory implements URLStreamHandlerFactory > { >=20 > AgiStreamHandlerFactory() > { > =20 > } > =20 > public URLStreamHandler createURLStreamHandler(String=20 > protocol) > { > // TODO Auto-generated method stub > return new AgiURLStreamHandler(); > } > =20 > } > =20 > class AgiURLStreamHandler extends URLStreamHandler > { >=20 > @Override > protected URLConnection openConnection(URL u) throws=20 > IOException > { > // Not used > return null; > } > =20 > } >=20 > } >=20 > -------------------------------------------------------------- > ----------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and=20 > a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users >=20 |
From: Stefan R. <ste...@re...> - 2007-08-01 22:04:29
Attachments:
signature.asc
|
Hi, astmanproxy does not honor the ActionId attribute. The following is a log of an attempt to connect: root@samael:~# ngrep port 1234 interface: eth0 (10.13.0.0/255.255.255.0) filter: (ip or ip6) and ( port 1234 ) #### T 10.13.0.101:1234 -> 10.13.0.57:33060 [AP] Asterisk Call Manager Proxy/1.21.. ## T 10.13.0.57:33060 -> 10.13.0.101:1234 [AP] action: Challenge..actionid: 1246657009_0#..authtype: MD5.... ## T 10.13.0.101:1234 -> 10.13.0.57:33060 [AP] Response: Success # T 10.13.0.101:1234 -> 10.13.0.57:33060 [AP] .. # T 10.13.0.101:1234 -> 10.13.0.57:33060 [AP] Challenge: 168169277 ## T 10.13.0.101:1234 -> 10.13.0.57:33060 [AP] .... #### Asterisk-Java sends an actionId (1246657009_0#) but astmanproxy drops it. Therefore Asterisk-Java has no chance to relate the response to the request and you receive the timeout exception. > This appears to be a timing issue and so may not appear on all systems > or everytime the call is run. > I'm doing further investigation to try and create a patch. >=20 > If anyone knows how to lodge a support request on astmanproxy I would b= e > interested. No I don't. I had a conversation with david some time ago but the without success getting these things fixed. I think astmanproxy would need some serious design changes to be usable for a larger audience... =3DStefan P.S. I've updated the latest version of Asterisk-Java to accept the protocol identifier but that won't help much until at least the action id issue is resolved. --=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... Steuernummern 215/5140/1791 USt-IdNr. DE220701760 |
From: Aaron E. <aar...@gm...> - 2007-08-02 01:26:09
|
Thanks for that Stefan. Now I can stop digging and barking up the wrong tree! I've posted a message on the AstManProxy mailing list "home" and we'll see what comes of it. cheers, aaron On 8/1/07, Stefan Reuter <ste...@re...> wrote: > Hi, > > astmanproxy does not honor the ActionId attribute. > The following is a log of an attempt to connect: > > root@samael:~# ngrep port 1234 > interface: eth0 (10.13.0.0/255.255.255.0) > filter: (ip or ip6) and ( port 1234 ) > #### > T 10.13.0.101:1234 -> 10.13.0.57:33060 [AP] > Asterisk Call Manager Proxy/1.21.. > > ## > T 10.13.0.57:33060 -> 10.13.0.101:1234 [AP] > action: Challenge..actionid: 1246657009_0#..authtype: MD5.... > > ## > T 10.13.0.101:1234 -> 10.13.0.57:33060 [AP] > Response: Success > > # > T 10.13.0.101:1234 -> 10.13.0.57:33060 [AP] > .. > > # > T 10.13.0.101:1234 -> 10.13.0.57:33060 [AP] > Challenge: 168169277 > > ## > T 10.13.0.101:1234 -> 10.13.0.57:33060 [AP] > .... > > #### > > Asterisk-Java sends an actionId (1246657009_0#) but astmanproxy drops > it. Therefore Asterisk-Java has no chance to relate the response to the > request and you receive the timeout exception. > > > This appears to be a timing issue and so may not appear on all systems > > or everytime the call is run. > > I'm doing further investigation to try and create a patch. > > > > If anyone knows how to lodge a support request on astmanproxy I would be > > interested. > > No I don't. I had a conversation with david some time ago but the > without success getting these things fixed. > I think astmanproxy would need some serious design changes to be usable > for a larger audience... > > =Stefan > > P.S. I've updated the latest version of Asterisk-Java to accept the > protocol identifier but that won't help much until at least the action > id issue is resolved. > > -- > 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... > > Steuernummern 215/5140/1791 USt-IdNr. DE220701760 > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > |
From: <gm...@ea...> - 2007-10-01 17:46:26
|
Hi Indeed I ran into this problem with astmanproxy some weeks ago too. IIRC I saw at least those problems: - the protocol identifier bug you solved - that actionId problem. ActionId is only ignored during authentication because this is handled internally by astmanproxy. Further comunication is ok. - the credentials are not case sensitive, astmanproxy converts the username and password to lowercase from client to proxy and from proxy to asterisk. I ended modifying the astmanproxy sources to have it work. Changes are minor. This is not the place to discuss this but if someone needs it I'll hapily send him the patch. Regards Gaetan On 02 Aug 2007, at 00:04, Stefan Reuter wrote: > Hi, > > astmanproxy does not honor the ActionId attribute. > The following is a log of an attempt to connect: > > root@samael:~# ngrep port 1234 > interface: eth0 (10.13.0.0/255.255.255.0) > filter: (ip or ip6) and ( port 1234 ) > #### > T 10.13.0.101:1234 -> 10.13.0.57:33060 [AP] > Asterisk Call Manager Proxy/1.21.. > > ## > T 10.13.0.57:33060 -> 10.13.0.101:1234 [AP] > action: Challenge..actionid: 1246657009_0#..authtype: MD5.... > > ## > T 10.13.0.101:1234 -> 10.13.0.57:33060 [AP] > Response: Success > > # > T 10.13.0.101:1234 -> 10.13.0.57:33060 [AP] > .. > > # > T 10.13.0.101:1234 -> 10.13.0.57:33060 [AP] > Challenge: 168169277 > > ## > T 10.13.0.101:1234 -> 10.13.0.57:33060 [AP] > .... > > #### > > Asterisk-Java sends an actionId (1246657009_0#) but astmanproxy drops > it. Therefore Asterisk-Java has no chance to relate the response to > the > request and you receive the timeout exception. > >> This appears to be a timing issue and so may not appear on all >> systems >> or everytime the call is run. >> I'm doing further investigation to try and create a patch. >> >> If anyone knows how to lodge a support request on astmanproxy I >> would be >> interested. > > No I don't. I had a conversation with david some time ago but the > without success getting these things fixed. > I think astmanproxy would need some serious design changes to be > usable > for a larger audience... > > =Stefan > > P.S. I've updated the latest version of Asterisk-Java to accept the > protocol identifier but that won't help much until at least the action > id issue is resolved. > > -- > 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... > > Steuernummern 215/5140/1791 USt-IdNr. DE220701760 > > ---------------------------------------------------------------------- > --- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a > browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users |
From: Aaron E. <aar...@gm...> - 2007-10-01 18:50:32
|
Hey Ga=EBtan, I would like to get my hands on the patch if it means I can use asterisk-java in combination with astmanproxy. I really like using asterisk-java but would like to avoid implementing my own proxy. Further, astmanproxy seems to have the feature set we are looking for... thx, aaron On 10/1/07, Ga=EBtan Minet <gm...@ea...> wrote: > Hi > > Indeed I ran into this problem with astmanproxy some weeks ago too. > > IIRC I saw at least those problems: > > - the protocol identifier bug you solved > - that actionId problem. ActionId is only ignored during > authentication because this is handled internally by astmanproxy. > Further comunication is ok. > - the credentials are not case sensitive, astmanproxy converts the > username and password to lowercase from client to proxy and from > proxy to asterisk. > > I ended modifying the astmanproxy sources to have it work. Changes > are minor. > This is not the place to discuss this but if someone needs it I'll > hapily send him the patch. > > > Regards > > Gaetan > > > On 02 Aug 2007, at 00:04, Stefan Reuter wrote: > > > Hi, > > > > astmanproxy does not honor the ActionId attribute. > > The following is a log of an attempt to connect: > > > > root@samael:~# ngrep port 1234 > > interface: eth0 (10.13.0.0/255.255.255.0) > > filter: (ip or ip6) and ( port 1234 ) > > #### > > T 10.13.0.101:1234 -> 10.13.0.57:33060 [AP] > > Asterisk Call Manager Proxy/1.21.. > > > > ## > > T 10.13.0.57:33060 -> 10.13.0.101:1234 [AP] > > action: Challenge..actionid: 1246657009_0#..authtype: MD5.... > > > > ## > > T 10.13.0.101:1234 -> 10.13.0.57:33060 [AP] > > Response: Success > > > > # > > T 10.13.0.101:1234 -> 10.13.0.57:33060 [AP] > > .. > > > > # > > T 10.13.0.101:1234 -> 10.13.0.57:33060 [AP] > > Challenge: 168169277 > > > > ## > > T 10.13.0.101:1234 -> 10.13.0.57:33060 [AP] > > .... > > > > #### > > > > Asterisk-Java sends an actionId (1246657009_0#) but astmanproxy drops > > it. Therefore Asterisk-Java has no chance to relate the response to > > the > > request and you receive the timeout exception. > > > >> This appears to be a timing issue and so may not appear on all > >> systems > >> or everytime the call is run. > >> I'm doing further investigation to try and create a patch. > >> > >> If anyone knows how to lodge a support request on astmanproxy I > >> would be > >> interested. > > > > No I don't. I had a conversation with david some time ago but the > > without success getting these things fixed. > > I think astmanproxy would need some serious design changes to be > > usable > > for a larger audience... > > > > =3DStefan > > > > P.S. I've updated the latest version of Asterisk-Java to accept the > > protocol identifier but that won't help much until at least the action > > id issue is resolved. > > > > -- > > 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... > > > > Steuernummern 215/5140/1791 USt-IdNr. DE220701760 > > > > ---------------------------------------------------------------------- > > --- > > This SF.net email is sponsored by: Splunk Inc. > > Still grepping through log files to find problems? Stop. > > Now Search log events and configuration files using AJAX and a > > browser. > > Download your FREE copy of Splunk now >> http://get.splunk.com/ > > _______________________________________________ > > Asterisk-java-users mailing list > > Ast...@li... > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > |
From: <gm...@ea...> - 2007-10-01 20:45:48
|
On 01 Oct 2007, at 20:50, Aaron Evans wrote: > Hey Ga=EBtan, > > I would like to get my hands on the patch if it means I can use > asterisk-java in combination with astmanproxy. I've just send it to your email. I use it for several weeks under moderate load, this seems ok. However the proxy adds a "server" header to every message it forwards =20= and that gives (non critical) errors in the library as there is no =20 setter on the event: 2007-10-01 22:37:34,950 [ERROR] [Asterisk-Java ManagerConnection-0-=20 Reader-0] [EventBuilderImpl:setAttributes] Unable to set property =20 'server' to 'localhost' on =20 org.asteriskjava.manager.event.PeerEntryEvent: no setter Stefan, could we add the setter/getter in the base event class ? regards Gaetan > > I really like using asterisk-java but would like to avoid implementing > my own proxy. Further, astmanproxy seems to have the feature set we > are looking for... > > thx, > aaron > > On 10/1/07, Ga=EBtan Minet <gm...@ea...> wrote: |
From: Stefan R. <ste...@re...> - 2007-10-01 20:54:07
Attachments:
signature.asc
|
Ga=EBtan Minet wrote: > 2007-10-01 22:37:34,950 [ERROR] [Asterisk-Java ManagerConnection-0-=20 > Reader-0] [EventBuilderImpl:setAttributes] Unable to set property =20 > 'server' to 'localhost' on =20 > org.asteriskjava.manager.event.PeerEntryEvent: no setter >=20 > Stefan, could we add the setter/getter in the base event class ? Yes, that seems reasonable. Can you publish the patch somewhere with a short description then I can add a paragraph to the Asterisk-Java page with a link to it. Maybe you can even convince the original author to apply the patch to upstream :-) =3DStefan --=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... Steuernummern 215/5140/1791 USt-IdNr. DE220701760 |
From: <gm...@ea...> - 2007-10-01 22:46:04
|
Hi Stefan Here is a link http://dev.mcit.be/various/astmanproxy-asterisk-java.html Regards, Gaetan On 01 Oct 2007, at 22:53, Stefan Reuter wrote: > Ga=EBtan Minet wrote: >> 2007-10-01 22:37:34,950 [ERROR] [Asterisk-Java ManagerConnection-0- >> Reader-0] [EventBuilderImpl:setAttributes] Unable to set property >> 'server' to 'localhost' on >> org.asteriskjava.manager.event.PeerEntryEvent: no setter >> >> Stefan, could we add the setter/getter in the base event class ? > > Yes, that seems reasonable. > > Can you publish the patch somewhere with a short description then I =20= > can > add a paragraph to the Asterisk-Java page with a link to it. > Maybe you can even convince the original author to apply the patch to > upstream :-) > > =3DStefan > > --=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... > > Steuernummern 215/5140/1791 USt-IdNr. DE220701760 > > ----------------------------------------------------------------------=20= > --- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/=20 > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users |
From: Stefan R. <ste...@re...> - 2007-10-02 00:44:41
Attachments:
signature.asc
|
Ga=EBtan Minet wrote: > Here is a link >=20 > http://dev.mcit.be/various/astmanproxy-asterisk-java.html Thanks. You'll find the link on the A-J homepage. I've also added it to the AstManProxy page on voip-info.org. Support for the server property is now in SVN. =3DStefan |
From: Bruno K. <bru...@un...> - 2008-01-30 16:32:39
|
Hello (again!) I am using asterisk-java 0.3.1 and asterisk 1.6.0 beta 2. First of all when connecting to the PBX, I get "Unsupported protocol version 'Asterisk Call Manager/1.1'. Use at your own risk". After that, the first NewChannelEvent event triggers an ERROR in EventBuilderImpl saying "Unable to set property 'channelstatedesc' to 'Down' on ...: no setter". I believe that the beta 2 has changed some events reported by asterisk? and maybe is there a new dev version of asterisk-java that handles the new syntax? or maybe have I missed some configuration somewhere? Thanks for your help about that. Bruno Konik |
From: Bruno K. <bru...@un...> - 2008-02-01 17:36:18
|
Hello, Asterisk 1.4.17, Asterisk-java 0.3.1 I am trying to use the CommandAction with 'diaplan show' but the = response gives only the last line of the response. It seems that the Reader doesn't allow to give such responses splitted over several = lines.=20 If you accept a modification to treat it I suggest the following code in = the ManagerReaderImpl.java : StringBuilder commandResponseResult =3D null; // the buffer to be = used for multi lines command response=20 while ((line =3D socket.readLine()) !=3D null && !this.die) { ... // your code was : // Special handling for "Response: Follows" (CommandResponse) // if ("Follows".equals(buffer.get("response")) && = line.endsWith("--END COMMAND--")) // { // buffer.put("result", line); // continue; // } // I suggest : // special handling for "Response: Follows" (CommandResponse) to treat = several lines // START if ("Follows".equals(buffer.get("response")) && = line.length() > 0 && buffer.containsKey("actionid")) { if (commandResponseResult =3D=3D null) { if (line.endsWith("--END COMMAND--")) { buffer.put("result", line); } else { commandResponseResult =3D new StringBuilder(line); } } else { commandResponseResult.append(line); if (line.endsWith("--END COMMAND--")) { buffer.put("result", commandResponseResult.toString()); commandResponseResult =3D null; } } continue; } // END ... Thanks for letting me know if you are ok with that and thanks for your = help, Bruno Konik > -----Message d'origine----- > De : ast...@li...=20 > [mailto:ast...@li...] De=20 > la part de Stefan Reuter > Envoy=E9 : mardi 2 octobre 2007 02:44 > =C0 : ast...@li... > Objet : Re: [Asterisk-java-users] asterisk java and astmanproxy >=20 > Ga=EBtan Minet wrote: > > Here is a link > >=20 > > http://dev.mcit.be/various/astmanproxy-asterisk-java.html >=20 > Thanks. You'll find the link on the A-J homepage. I've also=20 > added it to the AstManProxy page on voip-info.org. >=20 > Support for the server property is now in SVN. >=20 > =3DStefan >=20 >=20 |
From: Stefan R. <ste...@re...> - 2008-02-01 18:06:41
Attachments:
signature.asc
|
Do you use this correctly? Example: response =3D sendAction(new CommandAction(command)); if (!(response instanceof CommandResponse)) { throw new ManagerCommunicationException( "Response to CommandAction(\"" + command + "\") was not a CommandResponse but " + response, null); } // use ((CommandResponse) response).getResult(); getResult() returns a List of Strings - one per line. Besides, the implementation has been completly reworked in svn trunk to use \r\n as delimiter so that newlines in the responses do work without additonal hacks. Would you mind to check svn trunk or the latest 1.0.0 snapshot? =3DStefan Bruno Konik wrote: > Hello, >=20 > Asterisk 1.4.17, > Asterisk-java 0.3.1 >=20 > I am trying to use the CommandAction with 'diaplan show' but the respon= se gives only the last line of the response. It seems that > the Reader doesn't allow to give such responses splitted over several l= ines.=20 >=20 > If you accept a modification to treat it I suggest the following code i= n the ManagerReaderImpl.java : >=20 > StringBuilder commandResponseResult =3D null; // the buffer to be= used for multi lines command response=20 > while ((line =3D socket.readLine()) !=3D null && !this.die) > { > ... >=20 > // your code was : > // Special handling for "Response: Follows" (CommandResponse) > // if ("Follows".equals(buffer.get("response")) && line.= endsWith("--END COMMAND--")) > // { > // buffer.put("result", line); > // continue; > // } >=20 > // I suggest : > // special handling for "Response: Follows" (CommandResponse) to treat = several lines > // START > if ("Follows".equals(buffer.get("response")) && line.le= ngth() > 0 && buffer.containsKey("actionid")) > { > if (commandResponseResult =3D=3D null) { > if (line.endsWith("--END COMMAND--")) { > buffer.put("result", line); > } else { > commandResponseResult =3D new StringBuilder(line)= ; > } > } else { > commandResponseResult.append(line); > if (line.endsWith("--END COMMAND--")) { > buffer.put("result", commandResponseResult.toString())= ; > commandResponseResult =3D null; > } > } > continue; > } > // END > ... >=20 > Thanks for letting me know if you are ok with that and thanks for your = help, >=20 > Bruno Konik >=20 >> -----Message d'origine----- >> De : ast...@li...=20 >> [mailto:ast...@li...] De=20 >> la part de Stefan Reuter >> Envoy=E9 : mardi 2 octobre 2007 02:44 >> =C0 : ast...@li... >> Objet : Re: [Asterisk-java-users] asterisk java and astmanproxy >> >> Ga=EBtan Minet wrote: >>> Here is a link >>> >>> http://dev.mcit.be/various/astmanproxy-asterisk-java.html >> Thanks. You'll find the link on the A-J homepage. I've also=20 >> added it to the AstManProxy page on voip-info.org. >> >> Support for the server property is now in SVN. >> >> =3DStefan >> >> >=20 >=20 >=20 > -----------------------------------------------------------------------= -- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > 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... WWW: http://www.reucon.com Steuernummern 215/5140/1791 USt-IdNr. DE220701760 |
From: Bruno K. <bru...@un...> - 2008-02-02 13:24:47
|
Stefan, thanks. I think I am using it the right way : commandAction =3D new CommandAction("dialplan show"); response =3D managerConnection.sendAction(commandAction); if (response instanceof CommandResponse) { Iterator<String> i =3D ((CommandResponse) response).getResult().iterator(); while (i.hasNext()) { String item =3D i.next(); } } and yes I am using the 1.0.0 snapshot from last thursday. Bruno 2008/2/1, Stefan Reuter <ste...@re...>: > > Do you use this correctly? > Example: > response =3D sendAction(new CommandAction(command)); > if (!(response instanceof CommandResponse)) > { > throw new ManagerCommunicationException( > "Response to CommandAction(\"" + command > + "\") was not a CommandResponse but " + > response, > null); > } > > // use ((CommandResponse) response).getResult(); > > getResult() returns a List of Strings - one per line. > > Besides, the implementation has been completly reworked in svn trunk to > use \r\n as delimiter so that newlines in the responses do work without > additonal hacks. > Would you mind to check svn trunk or the latest 1.0.0 snapshot? > > =3DStefan > > > > Bruno Konik wrote: > > Hello, > > > > Asterisk 1.4.17, > > Asterisk-java 0.3.1 > > > > I am trying to use the CommandAction with 'diaplan show' but the > response gives only the last line of the response. It seems that > > the Reader doesn't allow to give such responses splitted over several > lines. > > > > If you accept a modification to treat it I suggest the following code i= n > the ManagerReaderImpl.java : > > > > StringBuilder commandResponseResult =3D null; // the buffer to be > used for multi lines command response > > while ((line =3D socket.readLine()) !=3D null && !this.die) > > { > > ... > > > > // your code was : > > // Special handling for "Response: Follows" (CommandResponse) > > // if ("Follows".equals(buffer.get("response")) && > line.endsWith("--END COMMAND--")) > > // { > > // buffer.put("result", line); > > // continue; > > // } > > > > // I suggest : > > // special handling for "Response: Follows" (CommandResponse) to treat > several lines > > // START > > if ("Follows".equals(buffer.get("response")) && > line.length() > 0 && buffer.containsKey("actionid")) > > { > > if (commandResponseResult =3D=3D null) { > > if (line.endsWith("--END COMMAND--")) { > > buffer.put("result", line); > > } else { > > commandResponseResult =3D new StringBuilder(line)= ; > > } > > } else { > > commandResponseResult.append(line); > > if (line.endsWith("--END COMMAND--")) { > > buffer.put("result", > commandResponseResult.toString()); > > commandResponseResult =3D null; > > } > > } > > continue; > > } > > // END > > ... > > > > Thanks for letting me know if you are ok with that and thanks for your > help, > > > > Bruno Konik > > > >> -----Message d'origine----- > >> De : ast...@li... > >> [mailto:ast...@li...] De > >> la part de Stefan Reuter > >> Envoy=E9 : mardi 2 octobre 2007 02:44 > >> =C0 : ast...@li... > >> Objet : Re: [Asterisk-java-users] asterisk java and astmanproxy > >> > >> Ga=EBtan Minet wrote: > >>> Here is a link > >>> > >>> http://dev.mcit.be/various/astmanproxy-asterisk-java.html > >> Thanks. You'll find the link on the A-J homepage. I've also > >> added it to the AstManProxy page on voip-info.org. > >> > >> Support for the server property is now in SVN. > >> > >> =3DStefan > >> > >> > > > > > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Microsoft > > Defy all challenges. Microsoft(R) Visual Studio 2008. > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > _______________________________________________ > > Asterisk-java-users mailing list > > Ast...@li... > > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > -- > 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... > WWW: http://www.reucon.com > > Steuernummern 215/5140/1791 USt-IdNr. DE220701760 > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > |
From: Stefan R. <ste...@re...> - 2008-02-02 14:04:41
Attachments:
signature.asc
|
Bruno, sorry I didn't pay enough attention to your first email. In 0.3 we had similar code to what you suggested and used the Java readLine() method to read from Asterisk. readLine() does not make a difference between "\r\n" and "\n" which turned out to make things harder than they must be. The convention in Asterisk is that "\r\n" is the delimiter for the manager "lines" while "\n" may appear within a line. You can try "sip show peers" this will work just fine as it uses "\n" in its output. For trunk I have reworked the handling of the CommandAction to make use of this convention which makes the code much simpler. My impression is that "show dialplan" does not adhere to this convention. Additionally when I run wireshark and look at the data it seems the dialplan is truncated anyway: action: Command actionid: 2131238190_2# command: dialplan show Response: Follows Privilege: Command ActionID: 2131238190_2# [ Context 'from-voipgate' created by 'pbx_config' ] <snip> [ Context 'app_dial_gosub_virtual_context' created by 'app_dial--END COMMAND-- It would be interesting if there are many commands that behave this way or if its specific to "show dialplan". If there are more we might revert to using the old code (which I would really like to prevent). =3DStefan Bruno KONIK wrote: > Stefan, >=20 > thanks. > I think I am using it the right way : >=20 > commandAction =3D new CommandAction("dialplan show"); > response =3D managerConnection.sendAction(commandAction= ); > if (response instanceof CommandResponse) { > Iterator<String> i =3D ((CommandResponse) > response).getResult().iterator(); > while (i.hasNext()) { > String item =3D i.next(); > } > } >=20 > and yes I am using the 1.0.0 snapshot from last thursday. >=20 > Bruno >=20 > 2008/2/1, Stefan Reuter <ste...@re... > <mailto:ste...@re...>>: >=20 > Do you use this correctly? > Example: > response =3D sendAction(new CommandAction(command)); > if (!(response instanceof CommandResponse)) > { > throw new ManagerCommunicationException( > "Response to CommandAction(\"" + command > + "\") was not a CommandResponse but " = + > response, > null); > } >=20 > // use ((CommandResponse) response).getResult(); >=20 > getResult() returns a List of Strings - one per line. >=20 > Besides, the implementation has been completly reworked in svn trun= k to > use \r\n as delimiter so that newlines in the responses do work wit= hout > additonal hacks. > Would you mind to check svn trunk or the latest 1.0.0 snapshot? >=20 > =3DStefan >=20 >=20 >=20 > Bruno Konik wrote: > > Hello, > > > > Asterisk 1.4.17, > > Asterisk-java 0.3.1 > > > > I am trying to use the CommandAction with 'diaplan show' but the > response gives only the last line of the response. It seems that > > the Reader doesn't allow to give such responses splitted over > several lines. > > > > If you accept a modification to treat it I suggest the following > code in the ManagerReaderImpl.java : > > > > StringBuilder commandResponseResult =3D null; // the buffer= to > be used for multi lines command response > > while ((line =3D socket.readLine()) !=3D null && !this.die)= > > { > > ... > > > > // your code was : > > // Special handling for "Response: Follows" (CommandResponse) > > // if ("Follows".equals(buffer.get("response")) &&= > line.endsWith("--END COMMAND--")) > > // { > > // buffer.put("result", line); > > // continue; > > // } > > > > // I suggest : > > // special handling for "Response: Follows" (CommandResponse) to > treat several lines > > // START > > if ("Follows".equals(buffer.get("response")) && > line.length() > 0 && buffer.containsKey("actionid")) > > { > > if (commandResponseResult =3D=3D null) { > > if (line.endsWith("--END COMMAND--")) { > > buffer.put("result", line); > > } else { > > commandResponseResult =3D new StringBuilder= (line); > > } > > } else { > > commandResponseResult.append(line); > > if (line.endsWith("--END COMMAND--")) { > > buffer.put("result", > commandResponseResult.toString()); > > commandResponseResult =3D null; > > } > > } > > continue; > > } > > // END > > ... > > > > Thanks for letting me know if you are ok with that and thanks for= > your help, > > > > Bruno Konik > > > >> -----Message d'origine----- > >> De : ast...@li... > <mailto:ast...@li...> > >> [mailto:ast...@li... > <mailto:ast...@li...>] De > >> la part de Stefan Reuter > >> Envoy=E9 : mardi 2 octobre 2007 02:44 > >> =C0 : ast...@li... > <mailto:ast...@li...> > >> Objet : Re: [Asterisk-java-users] asterisk java and astmanproxy > >> > >> Ga=EBtan Minet wrote: > >>> Here is a link > >>> > >>> http://dev.mcit.be/various/astmanproxy-asterisk-java.html > >> Thanks. You'll find the link on the A-J homepage. I've also > >> added it to the AstManProxy page on voip-info.org > <http://voip-info.org>. > >> > >> Support for the server property is now in SVN. > >> > >> =3DStefan |
From: Stefan R. <ste...@re...> - 2008-01-30 16:54:47
Attachments:
signature.asc
|
Bruno Konik wrote: > I am using asterisk-java 0.3.1 and asterisk 1.6.0 beta 2. >=20 > First of all when connecting to the PBX, I get "Unsupported protocol ve= rsion 'Asterisk Call Manager/1.1'. Use at your own risk". Yep thats fixed in svn since yesterday :) > After that, the first NewChannelEvent event triggers an ERROR in EventB= uilderImpl saying "Unable to set property 'channelstatedesc' > to 'Down' on ...: no setter". I'll have a look at that and add the setter. > I believe that the beta 2 has changed some events reported by asterisk?= and maybe is there a new dev version of asterisk-java that > handles the new syntax? or maybe have I missed some configuration somew= here? Yes, there are a few properties, events and actions. I am currently looking through the Asterisk sources to identify them. Expect them to appear in the 1.0.0-SNAPSHOT versions in the near future. Besides that you can always (well if at least if it's not down like at the moment ;) report an issue at http://jira.reucon.org so we can track the things we missed. Thanks, Stefan --=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... WWW: http://www.reucon.com Steuernummern 215/5140/1791 USt-IdNr. DE220701760 |
From: Bruno K. <bru...@un...> - 2008-01-30 17:17:40
|
Thanks Stefan, I will add all the missing setters I can find in the bug tracker when it will be accessible! Bruno 2008/1/30, Stefan Reuter <ste...@re...>: > > Bruno Konik wrote: > > I am using asterisk-java 0.3.1 and asterisk 1.6.0 beta 2. > > > > First of all when connecting to the PBX, I get "Unsupported protocol > version 'Asterisk Call Manager/1.1'. Use at your own risk". > > Yep thats fixed in svn since yesterday :) > > > After that, the first NewChannelEvent event triggers an ERROR in > EventBuilderImpl saying "Unable to set property 'channelstatedesc' > > to 'Down' on ...: no setter". > > I'll have a look at that and add the setter. > > > I believe that the beta 2 has changed some events reported by asterisk? > and maybe is there a new dev version of asterisk-java that > > handles the new syntax? or maybe have I missed some configuration > somewhere? > > Yes, there are a few properties, events and actions. I am currently > looking through the Asterisk sources to identify them. > Expect them to appear in the 1.0.0-SNAPSHOT versions in the near future. > > Besides that you can always (well if at least if it's not down like at > the moment ;) report an issue at http://jira.reucon.org so we can track > the things we missed. > > Thanks, > > Stefan > > -- > 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... > WWW: http://www.reucon.com > > Steuernummern 215/5140/1791 USt-IdNr. DE220701760 > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users > > > |