Using The Luggage with Apps that have spaces in their names

Recently when trying to build a package using The Luggage, I noticed that it would choke on apps that had spaces in their names. Doing some searching, I discovered that making it work is as simple as adding a custom stanza to the makefile for each app/file that has a space. The package I was making was a custom installer for RMU's new VMware View remote access system. It included Microsoft's "Remote Desktop Connection", VMware's "VMware View Client", a postflight scipt to write the "view.rmu.edu" entry to a preference file, and a custom welcome message and background for the installer.

Here's my makefile:

include /usr/local/share/luggage/luggage.make

TITLE=RMU_VMware_View
REVERSE_DOMAIN=edu.rmu
PAYLOAD=unbz2-application-Remote_Desktop_Connection.app \
        unbz2-application-VMware_View_Client.app \
        pack-script-postflight \
        pack-resource-Welcome.rtf \
        pack-resource-background.gif
PACKAGE_VERSION=1

unbz2-application-Remote_Desktop_Connection.app: Remote_Desktop_Connection.app.tar.bz2 l_Applications
        @SUDO ${TAR} xjf Remote_Desktop_Connection.app.tar.bz2 -C ${WORK_D}/Applications
        @SUDO chown -R root:admin "${WORK_D}/Applications/Remote Desktop Connection.app"

unbz2-application-VMware_View_Client.app: VMware_View_Client.app.tar.bz2 l_Applications
        @SUDO ${TAR} xjf VMware_View_Client.app.tar.bz2 -C ${WORK_D}/Applications
        @SUDO chown -R root:admin "${WORK_D}/Applications/VMware View Client.app"

Notice that instead of the usual "unbz2-applications-XXXX.app" I used "unbz2-application-xxxx.app" and included those stanzas in the Makefile itself. Note the quotes around the names in the chown lines. The pack-xxx stanzas came from the included luggage.make file; it's not necessary to reproduce these in your makefile, so long as the files don't include spaces in their names.

Hope this helps someone!

Posted
 

Setting Asterisk 1.8 Caller ID from Legacy PBX Systems

Unfortunately we still have numbers registered to our old Nortel PBX. After many trials, we have been unsuccesful at passing the caller ID name from the Nortel PBX to our Asterisk systems.  We implemented the following solution/workaround into the [stdexten] subroutine.

After
exten => _X.,n,Set(LOCAL(mbx)="${ext}"$["${cntx}" ? "@${cntx}" :: ""])
but before
exten => _X.,n,Dial(${dev},20)                  ; Ring the interface, 20 seconds maximum
we added this line:

exten => _X.,n,Set(CALLERID(name)=${IF(${DB_EXISTS(cidname/${CALLERID(num)})}?${DB(cidname/${CALLERID(num)})}:${CALLERID(name)})})

That line checks to see if there is an Asterisk database entry for the caller ID number in the database family "cidname". We've loaded all of our Nortel users' names and extensions into astdb. If there is an entry in the databse, that line overrides whatever is in sip.conf or whatever, if anything, is coming over the wire.

Here's an example. Let's say I have a phone registered at extension 1000 with the caller ID line set to "Mike Boylan" <1000> in sip.conf. If I do the following, the caller ID will be changed when I dial (to any number that uses stdexten) to "Legacy PBX CID".

asterisk7*CLI> database put cidname 1000 "Legacy PBX CID"
Updated database successfully

asterisk7*CLI> database show cidname
/cidname/1000                                     : Legacy PBX CID 

You can see in the console that when I dial, the CID Name was changed:

asterisk7*CLI>
  == Using UDPTL CoS mark 5
  == Using SIP RTP CoS mark 5
    -- Executing [4805@rmuld:1] Gosub("SIP/1000-00000085", "4805,stdexten(SIP/4805)") in new stack
    -- Executing [4805@rmuld:50000] NoOp("SIP/1000-00000085", "Start stdexten") in new stack
    -- Executing [4805@rmuld:50001] Set("SIP/1000-00000085", "LOCAL(ext)=4805") in new stack
    -- Executing [4805@rmuld:50002] Set("SIP/1000-00000085", "LOCAL(dev)=SIP/4805") in new stack
    -- Executing [4805@rmuld:50003] Set("SIP/1000-00000085", "LOCAL(cntx)=") in new stack
    -- Executing [4805@rmuld:50004] Set("SIP/1000-00000085", "LOCAL(mbx)="4805"""") in new stack
    -- Executing [4805@rmuld:50005] Set("SIP/1000-00000085", "CALLERID(name)=Legacy PBX CID") in new stack
    -- Executing [4805@rmuld:50006] Dial("SIP/1000-00000085", "SIP/4805,20") in new stack
  == Using UDPTL CoS mark 5
  == Using SIP RTP CoS mark 5
    -- Called SIP/4805
    -- SIP/4805-00000086 is ringing
  == Spawn extension (rmuld, 4805, 50006) exited non-zero on 'SIP/1000-00000085'

If you can get your legacy PBX systems to send Caller ID information, including the name, to Asterisk, great. But if you're like us and struggle to do so, this is a very reasonable workaround. Your users will never know, nor do they care, how the CID information is being set.

Posted