tag:blogger.com,1999:blog-36319746051308149982024-03-13T05:55:17.262-07:00Audio/Video Mailbox for SIP-CommunicatorRyan Ricardhttp://www.blogger.com/profile/01581215456000508820noreply@blogger.comBlogger34125tag:blogger.com,1999:blog-3631974605130814998.post-36515413972201749452007-08-17T00:27:00.000-07:002007-08-17T00:29:12.298-07:00Patch it!I sent in my big patch today. Hopefully this is the first of many contributions to Sip-Communicator. I've had a whole lot of fun working on this project and I've got a whole big list of features that didn't make the cut for the Summer.Ryan Ricardhttp://www.blogger.com/profile/01581215456000508820noreply@blogger.com1tag:blogger.com,1999:blog-3631974605130814998.post-70997018621804744752007-08-14T01:09:00.000-07:002007-08-14T01:17:05.730-07:00well, it looks nice in my headSo I coded up the configuration form for the Mailbox. Right now it doesn't do anything, but I was hoping that I could at least do a build/run and see if the buttons ended up the way I wanted them to. <br /><br />Unfortunately, I can't get it to show in the GUI. <br /><br />I took the PluginManager as a template, and I think that the mailbox is doing everything that PluginManager is doing, including<br /><br />-A new class implements Configuration Form and Extends JPanel<br />-Activator Class Creates a new Instance of this class on Bundle Start<br />-Activator Class grabs the current configuration window from UIService.getConfigurationWindow()<br />-Activator Class calls addConfigurationForm() method to add my form to the configuration window<br /><br />...but nothing happens. Not even an exception. A few logger.logInfo() statements suggest that the Mailbox form is being properly added to the list of config forms. I'm out of ideas.Ryan Ricardhttp://www.blogger.com/profile/01581215456000508820noreply@blogger.com0tag:blogger.com,1999:blog-3631974605130814998.post-67382058902705357762007-08-13T20:19:00.000-07:002007-08-13T20:21:49.371-07:00where the hell am Iafter a long hiatus I am back to hacking! It feels very good to be getting work done again... I think that working on this project is going to be hard to stop once the school year starts ;) Anyway, I've got the message cap working properly... the mailbox hangs up on the call when the incoming message hits X seconds (60 seconds is the default). <br /><br />Up next is coding up a GUI form for the mailbox config parameters. I'm a bit worried that my Swing-fu has gotten weak from lack of exercise, so I may have my nose buried in a tutorial for a good portion of the rest of this evening. <br /><br />Wish me luck.Ryan Ricardhttp://www.blogger.com/profile/01581215456000508820noreply@blogger.com0tag:blogger.com,1999:blog-3631974605130814998.post-82975999542485325442007-07-25T20:30:00.001-07:002007-07-25T20:37:40.978-07:00well that was easyI got it working so that the incoming message starts recording just as the outgoing message finishes. <br /><br />So the mailbox sort of works. I'm pretty excited. Frankly I'm not sure what I should do next. <br /><br />Some of the possible candidates:<br /><br />-expose some sort of GUI functionality for playing received messages and/or alerting the user to the fact that messages were received. Seems like this would go on the "call list" tab on the SIP-communicator GUI. <br /><br />-enable a time or size maximum on incoming messages. As it stands if the caller forgets to hang up it's possible that the incoming message might fill up the hard drive, which would be bad. <br /><br />-Right now the incoming message is audio-only. Perhaps I could auto-detect if there is an incoming video stream and record to video if that is the case<br /><br />-Set up custom outgoing messages, IE associate each outgoing message file with a contact so that if your mom calls she hears message A but if your boss calls he hears message B. <br /><br />-Perhaps have a "record outgoing message" function from within SIP-Communicator? IDK if this is necessary as all the OSes SC comes on have some sort of sound recorder built in. <br /><br /><br /><br />At first glance it seems as though a size cap on incoming messages is most important, followed by some sort of GUI exposure. But I'll probably put it to Emil and whoever else and see what rises to the top.Ryan Ricardhttp://www.blogger.com/profile/01581215456000508820noreply@blogger.com0tag:blogger.com,1999:blog-3631974605130814998.post-3003130278501530822007-07-25T07:47:00.000-07:002007-07-25T07:53:21.444-07:00Good news in many varietiesFinally a bit of good news.<br /><br />-Merged all the changes from mainline into the necessary media files. Also learned that <a href="http://meld.sourceforge.net/">meld</a> is, for lack of a better phrase, pretty goddamned sweet. <br /><br />-The config file works as expected. <br /><br />-I figured out a way to get the output media file's duration (so I can wait that long to start recording). It seemed that the sanest way was to add a field in MediaControl called getOutputDuration(). This field performs a call to getDuration() on the Processor object it is using for outgoing media. This won't mean a whole lot if the output source is a microphone/webcam, but if it's a file then it properly returns how long the file is. This means that I can call mediaServCallBack.getMediaControl().getOutputDuration().getSeconds() and I know how many seconds I need to wait to start recording. Hopefully I'll have that implemented by the end of the day.Ryan Ricardhttp://www.blogger.com/profile/01581215456000508820noreply@blogger.com0tag:blogger.com,1999:blog-3631974605130814998.post-55448539685486446922007-07-24T23:27:00.000-07:002007-07-24T23:28:13.276-07:00found itsomeone made substantial changes to CallSessionImpl.java that need to be merged into my version. <br /><br />Why it took me so long to realize that, I'll leave that as an exercise for the reader.Ryan Ricardhttp://www.blogger.com/profile/01581215456000508820noreply@blogger.com0tag:blogger.com,1999:blog-3631974605130814998.post-26900908019121029642007-07-24T23:04:00.000-07:002007-07-24T23:08:37.863-07:00shouldn't have done thatWell, I committed the sin of "implementing feature B before testing feature A," and now here's where I am at:<br /><br />Whenever I try to connect a call (either via clicking the answer button or via letting the mailbox pick it up) I get "java.net.BindException: Address already in use." This also happens when I try to create an outgoing call. This is caused by one of the following:<br /><br />-something I did while trying to move some values to the configuration files<br />-something I did while trying to get the incoming message to wait for the outgoing message to finish before recording starts<br />-something else entirely.<br /><br />Right now neither scenario is looking very likely.Ryan Ricardhttp://www.blogger.com/profile/01581215456000508820noreply@blogger.com0tag:blogger.com,1999:blog-3631974605130814998.post-85853020596089698512007-07-15T21:43:00.000-07:002007-07-15T21:44:24.961-07:00check one more thing off my listThe Mailbox now loads the settings for the outgoing message location, incoming message location, and wait time from the config file. <br /><br />At least I think it does. I haven't had time to test it yet. <br /><br />It does compile, though, so I am checking in and going to bed.Ryan Ricardhttp://www.blogger.com/profile/01581215456000508820noreply@blogger.com0tag:blogger.com,1999:blog-3631974605130814998.post-16102688999871040202007-07-11T12:46:00.001-07:002007-07-11T12:48:49.882-07:00can you hear me knockin?Outgoing message works. Incoming message works. Neither of them try to run when you pick up the phone. <br /><br />This is good. <br /><br />Anyway, I've got two things to fix right away:<br /><br />1. The incoming message starts recording as soon as the call connects, so it picks up some of the outgoing message as well. <br /><br />2. I need to move the settings for the location of the outgoing/incoming messages out of the code and into the config file.Ryan Ricardhttp://www.blogger.com/profile/01581215456000508820noreply@blogger.com0tag:blogger.com,1999:blog-3631974605130814998.post-3311800363595147842007-07-10T13:23:00.000-07:002007-07-10T13:26:52.453-07:00Leave a message after the toneAfter messing around with all the quirks in manager.createDataSink, I finally got incoming audio to record to a file. Very exciting. <br /><br />Now I need to have the mailbox tell the media service which calls it needs to record and which it needs to play as normal.Ryan Ricardhttp://www.blogger.com/profile/01581215456000508820noreply@blogger.com0tag:blogger.com,1999:blog-3631974605130814998.post-26256171728525381462007-07-10T08:06:00.000-07:002007-07-10T08:09:06.589-07:00breaking rocks in the hot sunYesterday I did some code tidying to get my project ready for some additional midterm eyeballs. This included removing the unnecessary Mailbox Service that I was exporting and changing the outgoing message to a location inside the repository instead of /home/ryan. Eventually I will use a config file entry to point to the outgoing messsage, but in the mean time at least it will work after a fresh checkout.Ryan Ricardhttp://www.blogger.com/profile/01581215456000508820noreply@blogger.com0tag:blogger.com,1999:blog-3631974605130814998.post-16305754218078747202007-07-06T15:12:00.000-07:002007-07-06T15:14:48.437-07:00the internet is nice sometimeTried to get sip-communicator recording all incoming audio to a file today (figured that was a good first step in getting it to record incoming audio to a file some of the time). My first go at it came back with an empty file and a NoDataSinkException. It turns out that someone else had a similar experience and the process for creating a data sink is <a href="http://archives.java.sun.com/cgi-bin/wa?A2=ind0010&L=jmf-interest&D=0&P=49436">a bit more complicated</a>. However, it does appear fairly straightforward to create a processor and do a transcode, so hopefully I'll have incoming audio working soon.Ryan Ricardhttp://www.blogger.com/profile/01581215456000508820noreply@blogger.com0tag:blogger.com,1999:blog-3631974605130814998.post-90258533999590685672007-07-05T21:46:00.000-07:002007-07-05T21:50:11.312-07:00in your head, in your head. zombieHad a major setback the last few days in the form of a rather nasty sinus/throat/sneeze/cough thing. Tried to sit down and hack a few times but I'm more or less useless in my sick/medicated state. On the bright side it feels like it's about to pass, so I should hopefully be able to get some definite progress on getting an incoming message recorded over the weekend. Hopefully. <br /><br />At the very least, I'll try to keep posting more, even if it's a few more days of "too sick to code, drank lots of tea and watched movies all day."Ryan Ricardhttp://www.blogger.com/profile/01581215456000508820noreply@blogger.com0tag:blogger.com,1999:blog-3631974605130814998.post-66128129513780643682007-06-28T12:48:00.001-07:002007-06-28T12:54:10.325-07:00It works better!Based on a conversation with Emil today, I changed the way that the DataSource is switched over to a file. Instead of changing the default data source, I have sip-communicator make a new instance of MediaControl, instantiate it with the outgoing message file, and place the mapping of that particular mediacontrol to that particular call in a hashmap. Once the call ends, said mapping is removed. In this way, calls that are picked up normally get the usual DataSource while calls that are picked up by the mailbox get the outgoing message. <br /><br />And to top it all off, it actually works!<br /><br />I suppose that My next goal is to get the input from the remote caller redirected to a file and save the incoming message. Wish me luck.Ryan Ricardhttp://www.blogger.com/profile/01581215456000508820noreply@blogger.com0tag:blogger.com,1999:blog-3631974605130814998.post-7263193598679811502007-06-27T14:33:00.001-07:002007-06-27T14:42:15.417-07:00It Works!I got an outgoing message to play today!<br /><br />So what was that insidious bug, lurking around in my code, preventing the file from playing?<br /><br />I forgot to tell the Mailbox to quit waiting after it starts to connect the call. It just kept looping, re-starting the call every 10 seconds. <br /><br />D'oh. <br /><br /><br />Right away I noticed that I forgot to set SIP-Communicator's data source back to default after the call ends, so the next call gets connected to the outgoing message even if you click the "connect" button. so fixing that is my next step.<br /><br />Luckily, the CallListener interface (that Mailbox already implements) has a CallEnded method that will be called when a call ends. So I will insert code there that will check to see if the data source is set to default and re-initialize it if it is not. <br /><br />Easy, right? Ah, the hubris of optimism.Ryan Ricardhttp://www.blogger.com/profile/01581215456000508820noreply@blogger.com0tag:blogger.com,1999:blog-3631974605130814998.post-33810085555605516002007-06-25T10:26:00.000-07:002007-06-25T10:52:31.601-07:00Datasources in the mistThis morning I observed how sip-communicator plays out from a file while in its natural habitat. I knew that sip-communicator had such functionality from looking at the code, but as until a recent conversation with Emil I hadn't known how to turn it on. turns out that is as easy as adding the following little tidbit to sip-communicator.xml:<br /><br />(NOTE: Blogger ate my XML, so I replaced the angle brackets with square brackets. You get the idea)<br /><br />[media]<br />[debug_data_source_url value="file:///home/ryan/Desktop/lostinspace.mov"/]<br />[/debug_data_source_url]<br />[/media]<br />[/impl]<br /><br />notice that the <media> tag is nested within the <impl> tag. The namespace resolution for the system properties follows the structure of the xml document.<br />Some.System.Property.Here corresponds to [some][system][property][here value="stuff"/][/here][/property][/system][/some]<br /><br /><br /><br />I also installed JMStudio so that I can be sure that if a file doesn't play in the future that it is my fault and not JMF'sRyan Ricardhttp://www.blogger.com/profile/01581215456000508820noreply@blogger.com0tag:blogger.com,1999:blog-3631974605130814998.post-51002396493717272072007-06-21T11:47:00.000-07:002007-06-21T11:51:09.697-07:00Easier than I thoughtI found a much easier way to load up two instances of sip communicator with different config files (and therefore different sip accounts).<br /><br />It turns out that the first place that sip communicator looks for a configuration file is the current directory, IE the directory from which ant is called. So I just have a separate sip-communicator.xml file in my sc-avmailbox directory.<br /><br />I'm not going to mention the system that I had in place earlier. Such Kludges ought not be discussed in mixed company.Ryan Ricardhttp://www.blogger.com/profile/01581215456000508820noreply@blogger.com0tag:blogger.com,1999:blog-3631974605130814998.post-8791369103416030782007-06-20T08:08:00.000-07:002007-06-20T08:10:11.475-07:00more little issuesspent the morning tracking down some new problems with importing sip-communicator's build.xml. I want to say that I've got it all figured out and I can now focus all my energies on getting the mailbox to work properly, but I've said that before ;)<br /><br />Anyway, at least I know that my repository has everything it needs, in case I need to do a spontaneous reformat/reinstall like I did yesterday. Long story short, backups are good.Ryan Ricardhttp://www.blogger.com/profile/01581215456000508820noreply@blogger.com0tag:blogger.com,1999:blog-3631974605130814998.post-35705987920632663142007-06-19T16:45:00.000-07:002007-06-19T16:47:37.154-07:00I feel like I contributed somethingMy patch got accepted and I can now build sip-communicator and sc-avmailbox using the cvs copy.<br /><br />I figured out why files were mysteriously missing from my svn repository today after I did a checkout. It turns out that copying over backed-up files into a blank repository and including the ".svn" folder will make svn think that files are in the repository when they are not. I think I've got it all sorted out though.Ryan Ricardhttp://www.blogger.com/profile/01581215456000508820noreply@blogger.com0tag:blogger.com,1999:blog-3631974605130814998.post-64042283117141642642007-06-14T11:44:00.000-07:002007-06-14T11:48:03.558-07:00it works!I sent in what is (hopefully) my first working patch to the dev mailing list today.<br /><br />After tracking down a few nit-picky errors, I've got my project set up so that I can update sip-communicator from cvs, update sc-avmailbox from svn, and nothing breaks!<br /><br />yet.<br /><br />check back in a few days and see if I'm so optimistic.<br /><br />Anyway, back to work on getting an outgoing message to play. Last I checked the call to manager.createDataSource was coming back null. Since this method usually throws an exception when it messes up (IE the NoDataSourceException described earlier), I'm not even sure what that means.Ryan Ricardhttp://www.blogger.com/profile/01581215456000508820noreply@blogger.com0tag:blogger.com,1999:blog-3631974605130814998.post-89887354692593401612007-06-12T21:57:00.000-07:002007-06-12T22:00:41.414-07:00Modifying build.xml to be import-ableMy first hurdle in setting up the parallel repositories for my code and sip-communicator is the fact that the sip-communicator build.xml file does not refer to itself in a way that makes it importable.<br /><br />I'd go on and explain, but really the apache documentation on the <a href="http://ant.apache.org/manual/CoreTasks/import.html">import </a>function does a much better job. Basically I need to change the file so that input files are taken from /path/to/where/the/buildfile/is/src, but output files go to /path/to/where/the/buildfile/isrun/from/sc-bundles<br /><br />Basically this post was written to give me a break in the find- and replacing.<br /><br />:)Ryan Ricardhttp://www.blogger.com/profile/01581215456000508820noreply@blogger.com0tag:blogger.com,1999:blog-3631974605130814998.post-64165644666224611042007-06-12T20:49:00.000-07:002007-06-12T20:54:58.635-07:00just realized that the blog is quite outdatedall that business I was talking about before, forget it.<br /><br />Here is the new new strategy for getting my code to work alongside sip-communicator:<br /><br />-have both projects stored under /home/ryan/sip, side by side. My code is in /home/ryan/sip/sc-avmailbox and the sip-communicator sources are in /home/ryan/sip/sip-communicator.<br /><br />-have the build.xml in sc-avmailbox <a href="http://ant.apache.org/manual/CoreTasks/import.html">import</a> the build.xml in sip-communicator, redefining targets as necessary to build the files that I've added to sip-comm<br /><br />-using some ant trickery, make sure that for any files in sip-comm that I modified, my version is built instead of the sip-comm version.<br /><br />After a conversation with emil, I think that I'm ready to get all the little details in this strategy ironed out. Hopefully after I do so I'll be able to make a template that other people in a similar situation (having to develop an addon while staying current with main) can follow.Ryan Ricardhttp://www.blogger.com/profile/01581215456000508820noreply@blogger.com0tag:blogger.com,1999:blog-3631974605130814998.post-74749282274438414132007-06-04T22:04:00.000-07:002007-06-04T22:07:51.187-07:00late breaking newssvn is a working, building, complete copy of sip-communicator.<br /><br />project website looks like it should.<br /><br />I feel so fresh, so clean.<br /><br />Anyway, back to work.Ryan Ricardhttp://www.blogger.com/profile/01581215456000508820noreply@blogger.com0tag:blogger.com,1999:blog-3631974605130814998.post-31225634405715207432007-06-04T21:58:00.000-07:002007-06-04T22:04:34.887-07:00a little progress on both frontson rebooting the repository:<br /><br />Wow, was that a mess. But once I figured out that doing a "cp -R *" on a working copy retains a bunch of '.svn' files that mess up my attempts at cleaning out the repository and starting over. Duh. Ah well, after a bit of wasted time I think I'm waiting through the one great file transfer that will give me a real repository. Let's hope.<br /><br />I also figured out that the project's website is copied in the www folder, so the website is currently blank. Should be able to fix that by the end of the night.<br /><br />On the code:<br />I fixed all the compiler/design level problems (I think), but I get a <a href="http://mia.ece.uic.edu/%7Epapers/MediaBot/jmfspecs/javax/media/NoDataSourceException.html">NoDataSourceException</a> when I try to set up a sendstream on the outgoing message file. More on that as I get to the bottom of it.Ryan Ricardhttp://www.blogger.com/profile/01581215456000508820noreply@blogger.com0tag:blogger.com,1999:blog-3631974605130814998.post-70685190968279209262007-06-02T14:15:00.001-07:002007-06-02T14:18:16.454-07:00fork thisI'm trying to see if my modifications to the MediaService class/interface to handle incoming calls worked, and I've got all sorts of build errors in different parts of the project. My original intent in setting up a build environment was to have an update-able copy of SIP-Communicator alongside any copies of files I'd need to modify in a separate folder connected to my svn repository.<br /><br />That was a bad idea.<br /><br />Later tonight I am going to make a checkout of sip-communicator, move the necessary files over to my project folder, and do a reboot of my svn repository. I'll worry about merging back into mainline at a later date. Better than worrying about it every time I want to do a build.Ryan Ricardhttp://www.blogger.com/profile/01581215456000508820noreply@blogger.com0