From ray at oneunified.net Wed Jul 2 13:54:08 2008 From: ray at oneunified.net (Ray Burkholder) Date: Wed, 2 Jul 2008 15:54:08 -0300 Subject: [Astxx-devel] (no subject) Message-ID: <012501c8dc75$03fd37b0$0bf7a710$@net> I am interested in using the library. Upon download, expansion, and attempted compilation, I see the following results, ie, an error during build. Platform is Debian with the indicated compiler. Is there a problem with the build environment? i9100:/usr/src# cd astxx-0.5 i9100:/usr/src/astxx-0.5# ./pm install pm: bootstrapping... pm: creating new intermediate file cache in '_PM/cache' pm: object 'file', defined at pmfile:8, is referring to the file 'tools/pkgconfig/astxx.pc.in' which does not exist i9100:/usr/src/astxx-0.5# ll tools/pkgconfig/ total 12 -rw-r--r-- 1 sysadmin sysadmin 288 2008-04-17 17:51 astxx.pc -rw-r--r-- 1 sysadmin sysadmin 274 2008-04-17 17:51 libastxx_agi.pc -rw-r--r-- 1 sysadmin sysadmin 282 2008-04-17 17:51 libastxx_manager.pc i9100:/usr/src/astxx-0.5# gcc --version gcc (Debian 4.3.0-5) 4.3.1 20080523 (prerelease) Copyright (C) 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. i9100:/usr/src/astxx-0.5# -- Scanned for viruses and dangerous content at http://www.oneunified.net and is believed to be clean. From ray at oneunified.net Wed Jul 2 14:22:33 2008 From: ray at oneunified.net (Ray Burkholder) Date: Wed, 2 Jul 2008 16:22:33 -0300 Subject: [Astxx-devel] Building in Debian with GCC 4.3 In-Reply-To: <012501c8dc75$03fd37b0$0bf7a710$@net> References: <012501c8dc75$03fd37b0$0bf7a710$@net> Message-ID: <013801c8dc78$fb588d90$f209a8b0$@net> I ended up ignoring .pm and building a static library from within Eclipse with my already installed boost libraries. In addition, in order to run with my compiler version, agi.cc needs the following line added: #include > -----Original Message----- > From: astxx-devel-bounces at matt-land.com [mailto:astxx-devel- > bounces at matt-land.com] On Behalf Of Ray Burkholder > Sent: Wednesday, July 02, 2008 15:54 > To: astxx-devel at matt-land.com > Subject: [Astxx-devel] (no subject) > > I am interested in using the library. Upon download, expansion, and > attempted compilation, I see the following results, ie, an error during > build. Platform is Debian with the indicated compiler. Is there a > problem > with the build environment? > > i9100:/usr/src# cd astxx-0.5 > i9100:/usr/src/astxx-0.5# ./pm install > pm: bootstrapping... > pm: creating new intermediate file cache in '_PM/cache' > pm: object 'file', defined at pmfile:8, is referring to the file > 'tools/pkgconfig/astxx.pc.in' which does not exist > i9100:/usr/src/astxx-0.5# ll tools/pkgconfig/ > total 12 > -rw-r--r-- 1 sysadmin sysadmin 288 2008-04-17 17:51 astxx.pc > -rw-r--r-- 1 sysadmin sysadmin 274 2008-04-17 17:51 libastxx_agi.pc > -rw-r--r-- 1 sysadmin sysadmin 282 2008-04-17 17:51 libastxx_manager.pc > i9100:/usr/src/astxx-0.5# gcc --version > gcc (Debian 4.3.0-5) 4.3.1 20080523 (prerelease) > Copyright (C) 2008 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is > NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR > PURPOSE. > > i9100:/usr/src/astxx-0.5# > > > -- > Scanned for viruses and dangerous content at > http://www.oneunified.net and is believed to be clean. > > > _______________________________________________ > Astxx-devel mailing list > Astxx-devel at matt-land.com > http://matt-land.com/mailman/listinfo/astxx-devel -- Scanned for viruses and dangerous content at http://www.oneunified.net and is believed to be clean. From matt at matt-land.com Thu Jul 3 00:40:57 2008 From: matt at matt-land.com (Matthew Nicholson) Date: Thu, 03 Jul 2008 00:40:57 -0500 Subject: [Astxx-devel] (no subject) In-Reply-To: <012501c8dc75$03fd37b0$0bf7a710$@net> References: <012501c8dc75$03fd37b0$0bf7a710$@net> Message-ID: <486C6669.4020700@matt-land.com> Yeah, there is a problem with the 0.5 tarball, I should probably upload a new one. It is missing the astxx.pc.in file. Ray Burkholder wrote: > I am interested in using the library. Upon download, expansion, and > attempted compilation, I see the following results, ie, an error during > build. Platform is Debian with the indicated compiler. Is there a problem > with the build environment? > > i9100:/usr/src# cd astxx-0.5 > i9100:/usr/src/astxx-0.5# ./pm install > pm: bootstrapping... > pm: creating new intermediate file cache in '_PM/cache' > pm: object 'file', defined at pmfile:8, is referring to the file > 'tools/pkgconfig/astxx.pc.in' which does not exist > i9100:/usr/src/astxx-0.5# ll tools/pkgconfig/ > total 12 > -rw-r--r-- 1 sysadmin sysadmin 288 2008-04-17 17:51 astxx.pc > -rw-r--r-- 1 sysadmin sysadmin 274 2008-04-17 17:51 libastxx_agi.pc > -rw-r--r-- 1 sysadmin sysadmin 282 2008-04-17 17:51 libastxx_manager.pc > i9100:/usr/src/astxx-0.5# gcc --version > gcc (Debian 4.3.0-5) 4.3.1 20080523 (prerelease) > Copyright (C) 2008 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > > i9100:/usr/src/astxx-0.5# > > -- Matthew Nicholson matt-land.com From matt at matt-land.com Thu Jul 3 00:41:18 2008 From: matt at matt-land.com (Matthew Nicholson) Date: Thu, 03 Jul 2008 00:41:18 -0500 Subject: [Astxx-devel] Building in Debian with GCC 4.3 In-Reply-To: <013801c8dc78$fb588d90$f209a8b0$@net> References: <012501c8dc75$03fd37b0$0bf7a710$@net> <013801c8dc78$fb588d90$f209a8b0$@net> Message-ID: <486C667E.5080304@matt-land.com> Hmmm... I'll check that out. What function from cstring am I using? Ray Burkholder wrote: > I ended up ignoring .pm and building a static library from within Eclipse > with my already installed boost libraries. In addition, in order to run > with my compiler version, agi.cc needs the following line added: > > #include > >> -----Original Message----- >> From: astxx-devel-bounces at matt-land.com [mailto:astxx-devel- >> bounces at matt-land.com] On Behalf Of Ray Burkholder >> Sent: Wednesday, July 02, 2008 15:54 >> To: astxx-devel at matt-land.com >> Subject: [Astxx-devel] (no subject) >> >> I am interested in using the library. Upon download, expansion, and >> attempted compilation, I see the following results, ie, an error during >> build. Platform is Debian with the indicated compiler. Is there a >> problem >> with the build environment? >> >> i9100:/usr/src# cd astxx-0.5 >> i9100:/usr/src/astxx-0.5# ./pm install >> pm: bootstrapping... >> pm: creating new intermediate file cache in '_PM/cache' >> pm: object 'file', defined at pmfile:8, is referring to the file >> 'tools/pkgconfig/astxx.pc.in' which does not exist >> i9100:/usr/src/astxx-0.5# ll tools/pkgconfig/ >> total 12 >> -rw-r--r-- 1 sysadmin sysadmin 288 2008-04-17 17:51 astxx.pc >> -rw-r--r-- 1 sysadmin sysadmin 274 2008-04-17 17:51 libastxx_agi.pc >> -rw-r--r-- 1 sysadmin sysadmin 282 2008-04-17 17:51 libastxx_manager.pc >> i9100:/usr/src/astxx-0.5# gcc --version >> gcc (Debian 4.3.0-5) 4.3.1 20080523 (prerelease) >> Copyright (C) 2008 Free Software Foundation, Inc. >> This is free software; see the source for copying conditions. There is >> NO >> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR >> PURPOSE. >> >> i9100:/usr/src/astxx-0.5# >> >> >> -- >> Scanned for viruses and dangerous content at >> http://www.oneunified.net and is believed to be clean. >> >> >> _______________________________________________ >> Astxx-devel mailing list >> Astxx-devel at matt-land.com >> http://matt-land.com/mailman/listinfo/astxx-devel > > -- Matthew Nicholson matt-land.com From matt at matt-land.com Thu Jul 3 00:42:48 2008 From: matt at matt-land.com (Matthew Nicholson) Date: Thu, 03 Jul 2008 00:42:48 -0500 Subject: [Astxx-devel] Building in Debian with GCC 4.3 In-Reply-To: <486C667E.5080304@matt-land.com> References: <012501c8dc75$03fd37b0$0bf7a710$@net> <013801c8dc78$fb588d90$f209a8b0$@net> <486C667E.5080304@matt-land.com> Message-ID: <486C66D8.8010003@matt-land.com> Nvm. I see, I am getting that error now too. Looks like strerror is the problem. Matthew Nicholson wrote: > Hmmm... I'll check that out. What function from cstring am I using? > > Ray Burkholder wrote: >> I ended up ignoring .pm and building a static library from within Eclipse >> with my already installed boost libraries. In addition, in order to run >> with my compiler version, agi.cc needs the following line added: >> >> #include >> >>> -----Original Message----- >>> From: astxx-devel-bounces at matt-land.com [mailto:astxx-devel- >>> bounces at matt-land.com] On Behalf Of Ray Burkholder >>> Sent: Wednesday, July 02, 2008 15:54 >>> To: astxx-devel at matt-land.com >>> Subject: [Astxx-devel] (no subject) >>> >>> I am interested in using the library. Upon download, expansion, and >>> attempted compilation, I see the following results, ie, an error during >>> build. Platform is Debian with the indicated compiler. Is there a >>> problem >>> with the build environment? >>> >>> i9100:/usr/src# cd astxx-0.5 >>> i9100:/usr/src/astxx-0.5# ./pm install >>> pm: bootstrapping... >>> pm: creating new intermediate file cache in '_PM/cache' >>> pm: object 'file', defined at pmfile:8, is referring to the file >>> 'tools/pkgconfig/astxx.pc.in' which does not exist >>> i9100:/usr/src/astxx-0.5# ll tools/pkgconfig/ >>> total 12 >>> -rw-r--r-- 1 sysadmin sysadmin 288 2008-04-17 17:51 astxx.pc >>> -rw-r--r-- 1 sysadmin sysadmin 274 2008-04-17 17:51 libastxx_agi.pc >>> -rw-r--r-- 1 sysadmin sysadmin 282 2008-04-17 17:51 libastxx_manager.pc >>> i9100:/usr/src/astxx-0.5# gcc --version >>> gcc (Debian 4.3.0-5) 4.3.1 20080523 (prerelease) >>> Copyright (C) 2008 Free Software Foundation, Inc. >>> This is free software; see the source for copying conditions. There is >>> NO >>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR >>> PURPOSE. >>> >>> i9100:/usr/src/astxx-0.5# >>> >>> >>> -- >>> Scanned for viruses and dangerous content at >>> http://www.oneunified.net and is believed to be clean. >>> >>> >>> _______________________________________________ >>> Astxx-devel mailing list >>> Astxx-devel at matt-land.com >>> http://matt-land.com/mailman/listinfo/astxx-devel >> > -- Matthew Nicholson matt-land.com From matt at matt-land.com Thu Jul 3 01:26:09 2008 From: matt at matt-land.com (Matthew Nicholson) Date: Thu, 03 Jul 2008 01:26:09 -0500 Subject: [Astxx-devel] [ANN] Astxx 0.6 Released Message-ID: <486C7101.7020005@matt-land.com> Greetings, Astxx 0.6 is now available from http://matt-land.com/astxx. I have also attached the UPGRADE and NEWS files. This release contains fixes to the build system, tweaks to the documentation, and other build fixes. The only source code changes were the addition of a missing header file (cstring) to agi.cc (thanks to Ray Burkholder for catching this one). -- Matthew Nicholson matt-land.com -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: UPGRADE Url: http://matt-land.com/mailman/archives/astxx-devel/attachments/20080703/52c151cc/attachment.ksh -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: NEWS Url: http://matt-land.com/mailman/archives/astxx-devel/attachments/20080703/52c151cc/attachment.txt From ray at oneunified.net Thu Jul 3 06:58:09 2008 From: ray at oneunified.net (Ray Burkholder) Date: Thu, 3 Jul 2008 08:58:09 -0300 Subject: [Astxx-devel] Example File In-Reply-To: <486C7101.7020005@matt-land.com> References: <486C7101.7020005@matt-land.com> Message-ID: <002601c8dd04$10dac6c0$660a0a0a@oneunified.local> Adding an example file (instantiate, connect, send, receive, close, disconnect) may be a worthy, valuable addition to your library. -- Scanned for viruses and dangerous content at http://www.oneunified.net and is believed to be clean. From matt at matt-land.com Thu Jul 3 09:14:51 2008 From: matt at matt-land.com (Matthew Nicholson) Date: Thu, 03 Jul 2008 09:14:51 -0500 Subject: [Astxx-devel] Example File In-Reply-To: <002601c8dd04$10dac6c0$660a0a0a@oneunified.local> References: <486C7101.7020005@matt-land.com> <002601c8dd04$10dac6c0$660a0a0a@oneunified.local> Message-ID: <486CDEDB.6020808@matt-land.com> There are some examples in the tests/ directory. But having a formal example or tutorial would be good. Ray Burkholder wrote: > Adding an example file (instantiate, connect, send, receive, close, > disconnect) may be a worthy, valuable addition to your library. > > -- Matthew Nicholson matt-land.com From mcrane at novell.com Wed Jul 23 14:01:43 2008 From: mcrane at novell.com (Matthew Crane) Date: Wed, 23 Jul 2008 13:01:43 -0600 Subject: [Astxx-devel] Thread safe or not? Message-ID: <488747D7.566D.00B7.0@novell.com> I noticed that there's a warning in the comments to connection.h: "This library is not thread safe. Only one thread of execution should call functions in the library at a time." Is this still really true? I'm working on a project where I'll need to maintain connections to more than one Asterisk server in my application. I'll be sending actions to and receiving responses and events from one or more servers. My plan was to use one thread for any actions that would be sent and have a separate thread for each server's event processing. I've got a bit more work to do if I can't work with multiple threads this way. :-( If astxx::manager isn't thread safe, I assume that I'm going to need to queue up all of the actions I want to send to my asterisk servers and have the queue serviced by a worker thread that looks like the following: while (true) { pull action off action queue and send over appropriate conection; for (each connection) { pump_messages(); process_events(); } } Comments? -Matt -- Matthew Crane Novell, Inc. 12 Clocktower Place Suite 210 Maynard, MA 01754 +1-978-450-2239 From matt at matt-land.com Thu Jul 24 08:51:24 2008 From: matt at matt-land.com (Matthew Nicholson) Date: Thu, 24 Jul 2008 08:51:24 -0500 Subject: [Astxx-devel] Thread safe or not? In-Reply-To: <488747D7.566D.00B7.0@novell.com> References: <488747D7.566D.00B7.0@novell.com> Message-ID: <488888DC.1000506@matt-land.com> Multiple connections can be used with multiple threads safely, but there are no thread safety provisions elsewhere. If two threads were calling pump_messages(), process_events(), or process_messages() there could be problems. The same with multiple calls to send_action() and send_action_async(). All of those functions modify queues for events, responses, and response handlers. I don't think std::queue is thread safe. In order to use the library safely in a multiple threaded environment, all actions would need to be sent serialized (i.e. only send_action running at any time). Also the pump_messages(), wait_...(), and process_...() functions must also be called serialized. In fact send_action() should not be run while any of the wait_...(), pump_...(), or process_...() functions are being run. They all may call read_message() which will add items to the queue and read from the socket. The library could be made thread safe, if a thread safe version of std::queue was used and mutexes were employed in certain places, such that only one instance of read_message() is ever running, and such that messages are sent and async response handlers are queued in the same order. Matthew Crane wrote: > I noticed that there's a warning in the comments to connection.h: > > "This library is not thread safe. Only one thread of execution should call functions in the library at a time." > > Is this still really true? I'm working on a project where I'll need to maintain connections to more than one Asterisk server in my application. I'll be sending actions to and receiving responses and events from one or more servers. My plan was to use one thread for any actions that would be sent and have a separate thread for each server's event processing. I've got a bit more work to do if I can't work with multiple threads this way. :-( > > If astxx::manager isn't thread safe, I assume that I'm going to need to queue up all of the actions I want to send to my asterisk servers and have the queue serviced by a worker thread that looks like the following: > > while (true) { > pull action off action queue and send over appropriate conection; > for (each connection) { > pump_messages(); > process_events(); > } > } > > Comments? > > -Matt -- Matthew Nicholson matt-land.com From mcrane at novell.com Thu Jul 24 09:25:53 2008 From: mcrane at novell.com (Matthew Crane) Date: Thu, 24 Jul 2008 08:25:53 -0600 Subject: [Astxx-devel] Thread safe or not? In-Reply-To: <488888DC.1000506@matt-land.com> References: <488747D7.566D.00B7.0@novell.com> <488888DC.1000506@matt-land.com> Message-ID: <488858B1.566D.00B7.0@novell.com> >>> Matthew Nicholson wrote: > Multiple connections can be used with multiple threads safely, but there > are no thread safety provisions elsewhere. If two threads were > calling pump_messages(), process_events(), or process_messages() there > could be problems. The same with multiple calls to send_action() and > send_action_async(). All of those functions modify queues for events, > responses, and response handlers. I don't think std::queue is thread safe. Got it. All calls to send_action() would be within the same thread. However, I had planned to have one thread per connection for event processing which leads us to... > In order to use the library safely in a multiple threaded environment, > all actions would need to be sent serialized (i.e. only send_action > running at any time). Also the pump_messages(), wait_...(), and > process_...() functions must also be called serialized. In fact > send_action() should not be run while any of the wait_...(), pump_...(), > or process_...() functions are being run. They all may call > read_message() which will add items to the queue and read from the socket. Okay. I think my plan will be to have a mutex for each connection and I will lock/unlock around send_action(), pump_messages(), and process_events(). Thread 1: ... connection_mutex_lock(); send_action(); // in actuality, this will be the synchronous overloaded function call operator, e.g. command(), redirect(), etc connection_mutex_unlock(); ... Thread 2..n (one for each connection): ... while (true) { connection_mutex_lock(); pump_messages(); process_events(); connection_mutex_unlock(); sleep(a few milliseconds); } read_message() calls to each connection will be serialized under this scenario as far as I can tell. I don't necessarily need wait_message() since pump_messages() is being called anyway, correct? Thanks for your help! -Matt -- Matthew Crane Novell, Inc. 12 Clocktower Place Suite 210 Maynard, MA 01754 +1-978-450-2239 From matt at matt-land.com Thu Jul 24 09:32:05 2008 From: matt at matt-land.com (Matthew Nicholson) Date: Thu, 24 Jul 2008 09:32:05 -0500 Subject: [Astxx-devel] Thread safe or not? In-Reply-To: <488858B1.566D.00B7.0@novell.com> References: <488747D7.566D.00B7.0@novell.com> <488888DC.1000506@matt-land.com> <488858B1.566D.00B7.0@novell.com> Message-ID: <48889265.5090401@matt-land.com> Matthew Crane wrote: > > read_message() calls to each connection will be serialized under this scenario as far as I can tell. I don't necessarily need wait_message() since pump_messages() is being called anyway, correct? > Right. The pump_messages() function does the same thing wait_messages() does, except without blocking. I think your plan should work. Be sure to do lots of testing though :). -- Matthew Nicholson matt-land.com