Showing posts with label telephone reminders. Show all posts
Showing posts with label telephone reminders. Show all posts

Tuesday, July 7, 2009

Groundhog Day Reminders

Voice reminders via telephone input were not working properly. Every time the 8-digit date was entered, it would playback today's date instead of the date entered. The same problem occurred for the time: we would hear the current time rather than the entered time.

I snooped around extensions_custom.conf , in which the dialplan was located. The key parts were:

[reminder2] and [reminder4]

After looking up each command that was called, I noticed this:
http://www.voip-info.org/wiki/view/Asterisk+cmd+AGI

Thanks to my upgrade to Asterisk 1.6, the AGI command now has a different separator for arguments! ie. None of the arugments were being read, which is why Trixy decided to repeat the same day and time every time!

The fix for Asterisk 1.6:

Change all "|" in AGI commands to "," . ie:

[reminder2]
exten => s,1,Set(TIMEOUT(digit)=7)
exten => s,2,Set(TIMEOUT(response)=10)
exten => s,3,Read(APPTDT,custom/reminder2,8)
exten => s,4,AGI(checkdate.php|${APPTDT})
...
exten => s,4,AGI(checkdate.php|${APPTDT}) should be exten => s,4,AGI(checkdate.php,${APPTDT})


[reminder4]
exten => s,1,Set(TIMEOUT(digit)=7)
exten => s,2,Set(TIMEOUT(response)=10)
exten => s,3,Read(APPTTIME,custom/reminder3,4)
exten => s,4,GotoIf($["foo${APPTTIME}" < "foo1200"]?reminder5,s,1) exten => s,5,AGI(checktime.php|${APPTDT}|${APPTTIME}|0|${APPTPHONE})
...
exten => s,12,AGI(checktime.php|${APPTDT}|${APPTTIME}|1200|${APPTPHONE})
exten => s,5,AGI(checktime.php|${APPTDT}|${APPTTIME}|0|${APPTPHONE})... should be exten => s,5,AGI(checktime.php,${APPTDT},${APPTTIME},0,${APPTPHONE}) and
exten => s,12,AGI(checktime.php,${APPTDT},${APPTTIME},1200,${APPTPHONE})

I also found it in this section, which actually sets the reminder. This explains why no reminders were being sent out regardless of the time inputed.
[reminder9a]
exten => s,1,NoOp(APPTDT: ${APPTDT})
exten => s,2,NoOp(APPTTIME: ${APPTTIME})
exten => s,3,NoOp(APPTPHONE: ${APPTPHONE})
exten => s,4,NoOp(RECURRING: ${APPTRECUR})
exten => s,5,NoOp(APPTMSG: /var/lib/asterisk/sounds/custom/${APPTTIME}.${APPTDT}.${APPTP$
exten => s,6,Playback(your-msg-has-been-saved)
exten => s,7,Playback(goodbye)
exten => s,8,Wait(2)
exten => s,9,Hangup
exten => h,1,System(/bin/mv -f /var/lib/asterisk/sounds/custom/${TMPMSG}.gsm /var/lib/as$
exten => h,2,DeadAGI(reminder.php|${APPTDT}|${APPTTIME}|${APPTPHONE}|${APPTRECUR})
exten => h,3,Hangup

exten => h,2,DeadAGI(reminder.php|${APPTDT}|${APPTTIME}|${APPTPHONE}|${APPTRECUR}) should be
exten => h,2,DeadAGI(reminder.php,${APPTDT},${APPTTIME},${APPTPHONE},${APPTRECUR})

Do an amportal restart

NOW you have a functional prank call system.

DJ@Today

Friday, July 3, 2009

Important Reminder

Finally, it is successful. Voice reminders are able to be set right through the phone. I was missing an important part in the extensions_custom.conf:

nano -w /etc/asterisk/extensions_custom.conf

If your installation is fresh outa the box like mine, then you will have to ADD (entirely):

[from-internal-custom]
exten => 123,1,Answer
exten => 123,2,Wait(1)
exten => 123,3,Authenticate(12345678)
exten => 123,4,Goto(reminder,s,1)
The context [from-internal-custom] is important. It should not be [from-internal-trixbox] like somewhere mentioned...

Be sure to amportal restart

I also added the Misc Destinations module via FreePBX web gui. And added..
Dial: 123
Description: Telephone Reminders

I also noticed that we had a rogue extension installed called "TESTY" which was using ext 1234. I don't know how TESTY got into the box, but it may have been affecting things as well.

So, it works now... the voice menus are a dance && 1/2 but it works.

I should point out that these phone reminders are the same module as the ones that we make with the web gui, but they don't actually require the Cepstral thing since you record the reminder using your very own home-grown voice.

Congratulations, you now have a very complex prank calling system.

DJ@Reminderland

[EDIT]
Asterisk 1.6 ? Not quite done yet... see here