IP04 Adventures - Day 6

Well, that didn't last. I got to thinking about my incoming context, and how I wanted it to work. Right now, it answers the PSTN, rings all the house phones, and hangs up (with a goodbye message, on occassion). I don't like that script much, and it is time to change that around a bit.

Let's go over that again, and I'll point out what I don't like.

  1. The PSTN line rings, and the IP04 Answer()s it. There's an audible hesitation when the IP04 picks up the line
  2. The IP04 Dial()s all the inside lines, and lets them ring for five seconds. That's not enough time for someone to pick up the line
  3. If no one picked up, the IP04 plays a set of tones that discourage autodialers, says that "no one is available", and hangs up. The canned soundclip is inappropriate for this action, and the tones should have played before trying to ring the extensions
  4. If all lines are busy, the IP04 plays a busy signal and hangs up. The action should be the same as if no one picks up
So I changed the incoming context a bit. It now reads:

[incoming]
comment = Handle calls coming in from the PSTN
exten = s,1,Answer()
exten = s,2,Zapateller()
exten = s,3,Playback(local-greeting)
exten = s,4,Dial(${Mainfloor}&${Basement}&${Bedrooms},15)
exten = s,5,Hangup
exten = s,103,Playback(tt-allbusy)
exten = s,104,Congestion()
exten = s,105,Hangup

This is a little better. The autodialer disconnect tone happens immediately after the IP04 answers the PSTN, and it now announces that it will transfer the call before it dials the extensions. Unanswered and busy extensions wind up with a simple Hangup rather than an audioclip and hangup. But this isn't the end; I have more changes to come, and I have to add voicemail.

One note, though: The incoming context now plays an audio clip called local-greeting. This clip didn't come from with the IP04 or from Digium; I made it myself. I added an extension to capture a sound clip to file.

Hanging under the features context, the extension looks like this

; temporary extension used to record sound bites
exten = 790,1,Answer
exten = 790,2,Playback(vm-intro)
exten = 790,3,Record(/var/lib/asterisk/sounds/local-greeting.ulaw,3,30)
exten = 790,4,Playback(vm-message)
exten = 790,5,Playback(/var/lib/asterisk/sounds/local-greeting)
exten = 790,6,Hangup

Again, this is crude and temporary, but it works.

And, now back to working on voicemail.