03/25/2008

LotusScript to Make TAPI 3 call

Category   

This may be old hat for someone out there, but it was very new and very cool for me recently.

I just purchased a new telephone system, an Avaya IP Office 500, and have a mixture of hard and soft phones, all running over IP.  One area of interest for me in this purchase was the ability to integrate some of our Notes apps with the phone system, to have an 'Easy Dialer' capability.

I thought it would be easy enough to do, and sure it was...here is a document action button script I have cleaned up to publish...

        Dim wkspace As New NotesUIWorkspace  'Setup to get a handle to the current document
        Dim uidoc As NotesUIDocument
       
        Set uidoc = wkspace.CurrentDocument
       
        sNumToCall = uidoc.Document.phonenumber(0) 'this grabs the phone number to call from the current document
        If Len(sNumToCall) <> 4 Then  'If it is an internal number (4 digits) then don't do anything to the number
                If Left(sNumToCall,2) <> "9," Then  'Check to see if it starts with an outside line 'escape code', if not prefix to the number
                        sNumToCall = "9," & sNumToCall 'Clearly, if it is a long distance number or a toll free, then we need to add a '1' for the long distance escape code, but we will handle that later
                End If
        End If

        Dim gobjTAPI As Variant  'the base TAPI 3 object
        Dim gobjAddress As Variant 'this represents a placeholder TAPI device we will use to place the call
        Dim objCollAddresses As Variant 'this represents all of the TAPI devices on the machine
        Dim objCrtAddress As Variant 'this is THE TAPI device we will use for the call
       
        Set gobjTapi = createobject("tapi.tapi.1")  'Create the base object
        Call gobjTapi.Initialize 'Initialize the object (std call)
        Set objCollAddresses = gobjTapi.Addresses 'Get a collection of the TAPI devices available for the call
       
        bFound = False 'Set a check flag

        For indexAddr = 1 To objCollAddresses.Count  'Loop through the TAPI devices to find the one we want to use (my IP Office Phone Manager Pro softphone)
                Set objCrtAddress = objCollAddresses.Item(indexAddr) 'this allows us to look at the details of the selected TAPI device
                If Left(objCrtAddress.AddressName(), Len("IP Office")) = "IP Office" Then 'If the TAPI device's name begins with 'IP Office' then we have found what we are looking for
                                                                                        'the actual device will have a name like IP Office Ext #### and will change based on the extension, so we truncate
                        bFound = True
                        Set objCrtAddress = Nothing 'Clear the current object...not sure why to do this, but the API help code said it is a good practice
                End If
                If bFound = True Then Exit For
        Next indexAddr
       
        Set gobjAddress = objcollAddresses.Item(indexAddr) 'Set an object for the device
        Set gobjCall = gobjAddress.CreateCall(sNumToCall, 1, 8) 'make the call. The '1'(LINEADDRESSTYPE_PHONENUMBER ) ids this as a phonenumber call, the '8' (TAPIMEDIATYPE_AUDIO ) ids this as a audio media type call.
       
       
'Connect the call; False means that the call is made asynchronously.
        gobjCall.Connect (False) 'This actually makes the call happen - YEA!!!


Obviously, this is a pretty simple (and lacking in error check/control) example, but it is really pretty straight forward to get this type of functionality into your Notes apps, if you have the hardware/software telephony components available.  The cost of the Avaya IP Office system was pretty reasonable for functionality of this type, and I am sure something like an Asterisk type telephony system would be even less costly.

This kind of functionality really helps 'sell' Notes apps to your line of business users.

08/15/2007

Transformer's meme

Category
I AM 83% OPTIMUS PRIME

Take the Transformers Quiz

07/05/2007

Modifying OpenLog to Accept Additional LogEvent Info

Category    

I'll admit it:  I am an OpenLog fanboy.  It is the absolute best Notes/Domino Utility ever written, hands down, without a doubt, period!

I have several different OpenLog databases, some have processed over a million log documents (mostly logevents, but hey, who writes perfect code?)  I say processed because I have a very complex archiving process on these high volume logs.

I love it so much that I just had to extend its functionality to support more data being passed to the logdoc.
Read More

06/25/2007

Two year anniversary

Category

Since I didn't celebrate my one year blogging anniversary (completely forgot somehow,) I thought I might mention that today is my two year blogging anniversary.

06/22/2007

Dynamic Loading Script Libraries, Late Binding and a Flexible Parameter

Category   

Beginning on page 243 of the greatly revered 'Performance Considerations for Domino Applications' there is a discussion of the concept of dynamically loading Lotusscript libraries that contain individual object oriented custom classes.  I LOVE this technique.  I have an application that has close to 150 classes and loading them all at once is a huge performance drain; this technique alleviates that problem.

But it does introduce a different problem.

On page 246, there is a note:

Note We did not need to pass parameters to the class constructor in our
application. However, we could have allowed parameters to be passed
into NewObj, which in turn would be passed into the constructor if
necessary. This would impose the restriction that the constructors of all
classes to be used with NewObj would need to accept the same
parameter.

To this I say 'Bollocks'!  I really need to pass parameters to my classes...different parameters all the time...sometimes a string, sometimes a date, often an Notes object like a NotesUIDocument.  Sometimes I even need to pass a whole slew of parameters to the class.
Read More

06/08/2007

How cool is this?

Category

Maybe I can become a convert...

Mac OS-UX

06/06/2007

E's Flying Jump Kick

Category

From the March test (I just got the photo from one of the other students)

A picture named M2

06/01/2007

An incredibly bad start to a day

Category

E, my 5th grade daughter, and I have had a standing Friday morning breakfast 'date' during the school year ever since her first month of 1st grade...today was the last date for her 5th grade year.  It is a great time to get caught up with each other and spend some much needed quality time together.  As always, the breakfast and company/companionship was good this morning...but the rest of the morning was horrible.

My aging GMC Jimmy SUV (1999 with 205,000 miles) has an ongoing problem with its driver side door hinge pins...they wear and fall out frequently.  It happened this morning as I was closing the door to leave for our breakfast.  Only the upper pin fell out and the door sort of hung on, slightly.  The problem was the door is heavy and the bottom hinge will get 'tweaked' and bend.  I realized that this was happening, so I quickly moved to close the door.  I must be some sort of direct descendant of freakish gorillas that have instantaneous strength in stressful situations because I yanked the door so hard that the door panel separated from the door, breaking all of those single direction panel attachers clean off.

The hinge pin is a frequent problem like I said, so I thought that I could at least get the pin back in place and support the door properly, and then E and I would head off to breakfast...I needed to get away from the problem to calm down and the Friday morning 'date' was a great way to do that.

So I held the door on my shoulder and tried to get the pin back in place.  And I was successful!

Unfortunately, the pin was not the only problem.  Not only was there enough force to break the door panel free, I also materially broke the latching mechanism some how in the same process.

I shut off the truck and told E that we would take Mommy's car...and we did.

After dropping E off at school I returned to survey the damage. Sure enough the latch was completely unusable and the bottom hinge bent severely and I didn't have a way to get to work...so I headed upstairs and woke up S and Z, and told S that I needed a ride to the office.  As she got ready I realized that I had gotten grease on my shirt and figured I should change.  So standing in the middle of our bedroom, the same bedroom I have slept in for the past 10 years, I started to take off my shirt and promptly stuck my hand into the turning ceiling fan immediately over my head.

It has been one of those mornings.

05/25/2007

Near Instant ROI

Category

If I need to do something in Notes/Domino I can generally do whatever I need to do by writing some code.  This, however, is not always the most efficient or expedient process to follow, especially if vast changes need to be made in a timely and accurate manner.

Yesterday I purchased YTria's EZSuite and I am happy to announce that I could have very easily completely cost justified my purchase with just one day's usage of two of the tools (the designPropsEZ and actionBarEZ.)

YTria has built this toolset to be exactly what developers and administrators need: good tools that do their jobs well.

In my first usage, only minutes after executing the transaction and downloading the installation file, I updated 3 databases' 95 views' action bar properties, checking and setting 20 different properties on each view's bar, in a little less than 3 minutes.  I figure that each view would have taken at least a minute, maybe two, to process manually and in total it would have been 1900 items to check.  And then I figured out how to really get going fast by selecting an existing element as a template for the changes I wanted to make...even if it is in a different database on a different server...talk about cool!

My new multi-database application has a total of 14 different databases, and each database has the same basic navigation structure, an average of 30-40 views and/or folders, 10-15 forms and a few pages here and there.  One of my main goals in building this application is to provide a consistent look and feel to our previously disparate collection of applications.  Consistently setting all of those action bar element properties is a NIGHTMARE if I decide to make a UI look/feel change...and it is early in the design life of the UI so this is happening frequently.  This one tool, actionBarEZ, alone is going to save me countless hours of tedious error prone work!

Did I mention that there are 4 more tools in the suite that I haven't even begun to consider?

I can't believe that it has taken me this long to take the plunge and buy these things!

05/22/2007

E's LAX Season Wrap-Up

Category

Last night marked the end of the spring lacrosse season for E's 5/6th Grade Boy's team.  They finished the season 12-2-1 (if I counted correctly, if not then it was either 10 or 11 or 12 wins) with loses to Hamilton SouthEastern's A Team and Heritage Christian.  They tied with Carmel's Navy team.

It has been an incredibly fun sport to watch and I am sure E would tell you the same about playing.  I think that the athletes and their families are greatly responsible for our enjoyment of the game.  It has truly been a pleasure learning about the sport over the past few months.  We can hardly wait for indoor lacrosse to start in the fall in prep for next year's outdoor season.

E (#14) ended the season with a total of 3 goals.  Each of her goals was celebrated by both the team and the parents; especially the mothers in the crowd. They seem to really enjoy it when she scores.

E's first goal kind of just occurred, the result of being in the right place at the right time with her stick in the right place at the right time; but her second and third goals were definitely made with the intent of effort.

During the last game at home, on the N'Ville High School's turfed stadium, late in the third quarter, trailing Westfield 5-2 with no goals since the first period, our Miller's #8 received a good pass from one of our defenders from the our end of the field.  Brock charged down the near side of the field and made a break across field towards the front of the goal.  E fell in line at a trotting pace behind him, and as he drew the defense towards the far side of the goal, he shuffle passed the 'rock' over his shoulder back to E, who was waiting on the near side of the goalie's crease.  She caught the pass, cocked her arms and fired just as the goalie turned to block.  E's shot was aimed at the upper farside corner of the goal and found its mark, the goalie cowering slightly at the inbound shot (or so told by our #20 who watched the whole scenario unfold.)  E's goal rallied the team who then pounded in 3 more shots to win 6-5 over Westfield.

A picture named M2

Then last night, at St Simon Elementary, E' scored her 3rd goal off a goalie deflection that came her way.  Shot caught the ball in air, turned a partial dodge, took a step and then shot on goal, this time aiming towards the harder to block near lower corner with success.  The crowd went wild! and E received numerous compliments regarding her proper playing of her position.

misc links

search my blog

domino blogger search

coComments

tag cloud