Koozali.org: home of the SME Server

Wake-up Calls

Offline peterpan746

  • ***
  • 55
  • +0/-0
Wake-up Calls
« on: June 17, 2008, 01:25:49 AM »
Hi there,

Hope you can help.  I need to find out how to do wake-up calls.  I have found a :script: called wakeup.1.31

Here is the instructions:
Code: [Select]
2008/02/21 - Version 1.31
This code was tested with ASTERISK Rel 1.4.11


 1 - Copy the run_wakeups and the wakeup.php files into
the /var/lib/asterisk/agi-bin
make sure the PHP file is executable

2 - Next update your extensions file to include an extension to call
to schedule your wakeup calls.

exten => 77,1,agi,wakeup.php
exten => 77,n,Hangup

3 - Reload your extensions table in asterisk with "dialplan reload" or stop and
start asterisk.

When you call into Extension 77 you should be prompted for all your
wakeup call time.  This program uses the standard and additional sound
files.  So nothing else should be needed.

This is how I modified (mangled)  the extensions.conf file

Code: [Select]
[extensions]
include => internal-presets
include => parkedcalls

      exten => *77,1,agi,wakeup.php   
      exten => *77,n,Hangup

exten => 101,1,ParkedCall(101)
exten => 101,hint,park:101@parkedcalls

When I did it like the instruction said it didn't work, so I tried with *77, but didn't work either.

This is what I'm getting from a Putty session:
Code: [Select]
-- Executing [*77*@internal:1] BackGround("SIP/5002-085d6b08", "silence/1") in new stack
    -- <SIP/5002-085d6b08> Playing 'silence/1' (language 'en')
    -- Executing [*77*@internal:2] AGI("SIP/5002-085d6b08", "selintra|*77*") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/selintra
    -- AGI Script selintra completed, returning 0
  == Auto fallthrough, channel 'SIP/5002-085d6b08' status is 'UNKNOWN'
    -- Executing [h@internal:1] Hangup("SIP/5002-085d6b08", "") in new stack
  == Spawn extension (internal, h, 1) exited non-zero on 'SIP/5002-085d6b08'

I hope that you can help.

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: Wake-up Calls
« Reply #1 on: June 17, 2008, 10:29:58 AM »
You created *77 in extensions but dialled *77* which automatically gets processed by SAIL and ignored.  Also, if you hack extensions then it will just get overwritten the next time you do a commit in SAIL.  so...  do this instead.

Create a custom-app (call it whatever you like and set its span to internal). Paste the original code into it...

Code: [Select]
exten => 77,1,agi,wakeup.php
exten => 77,n,Hangup


Er..  that's it.  dialling 77 will get you to the wake-up app (assuming the app works OK).

Also - you need to be running sail-2.2.1-631 - there was a small bug in custom apps in the low 600 releases.

Let us know how you get on with it.

Kind Regards


Offline peterpan746

  • ***
  • 55
  • +0/-0
Re: Wake-up Calls
« Reply #2 on: June 17, 2008, 07:00:57 PM »
Thanks for your patience with me.  OK, I did like you tol dme too, and now '77' is working but I get the following in Putty:

Code: [Select]
[Jun 17 18:09:08] WARNING[4646]: file.c:602 ast_openstream_full: File please-try-again does not exist in any format
[Jun 17 18:09:08] WARNING[4646]: file.c:602 ast_openstream_full: File please-enter-the does not exist in any format
[Jun 17 18:09:08] WARNING[4646]: file.c:602 ast_openstream_full: File time does not exist in any format
[Jun 17 18:09:08] WARNING[4646]: file.c:602 ast_openstream_full: File for does not exist in any format
[Jun 17 18:09:08] WARNING[4646]: file.c:602 ast_openstream_full: File your does not exist in any format
[Jun 17 18:09:08] WARNING[4646]: file.c:602 ast_openstream_full: File wakeup-call does not exist in any format
[Jun 17 18:09:08] WARNING[4646]: file.c:912 ast_streamfile: Unable to open wakeup-call (format 0x4 (ulaw)): No such file or directory

It seems that I don't have all the sound files I need.  I'm trying to find a site where I can download the extra files, but no success thus far.

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: Wake-up Calls
« Reply #3 on: June 17, 2008, 09:19:42 PM »
Which rpm packages are using for Asterisk?  Is it the ATrpms stuff?

Offline peterpan746

  • ***
  • 55
  • +0/-0
Re: Wake-up Calls
« Reply #4 on: June 17, 2008, 09:30:50 PM »
I just did a fresh install with the sark-sme-7.3-2.2.1-617.iso

So I think I need to update

Offline peterpan746

  • ***
  • 55
  • +0/-0
Re: Wake-up Calls
« Reply #5 on: June 18, 2008, 12:35:30 AM »
It is working now.  For others that might be interested.

This is important:
You need to run dos2unix on the wakeup.php file
You need to have the asterisk extra sound or it will not work.

At first I had problems with getting the actual call, but when I switched to military time it worked great.

Thanks for the help.

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: Wake-up Calls
« Reply #6 on: June 18, 2008, 01:00:19 AM »
Well done,

How about publishing where the php app is and maybe a little howto so others might use it if they wish?  It looks like a useful little app.

Kind Regards

Offline NetDreamer

  • *
  • 11
  • +0/-0
Re: Wake-up Calls
« Reply #7 on: June 18, 2008, 02:31:53 PM »
This gets my vote - Programmable wake up calls would be a handy feature.

Offline peterpan746

  • ***
  • 55
  • +0/-0
Re: Wake-up Calls
« Reply #8 on: June 18, 2008, 08:47:45 PM »
The files can be found here:

http://www.voip-info.org/tiki-index.php?page=Asterisk+tips+Wake-Up+Call+PHP

1.  The files (wakeup.php and wakeconfirm.agi) are placed in /var/lib/asterisk/agi-bin
2.  Make sure that wakeup.php is executable
3.  Run dos2unix on wakeup.php (dos2unix wakeup.php)
4.  Make sure that you have the additional asterisk sounds installed (ATrpms have them)
5.  Create add-on in server-manager and name it whatever you want and paste these lines in there:
Code: [Select]
exten => 77,1,agi,wakeup.php
exten => 77,n,Hangup
6.  Reload your extensions table in asterisk with "dialplan reload" or stop and
start asterisk.

And that should get the script going.  The README file contains most of the information, but if you get stuck I will do my best to help.

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: Wake-up Calls
« Reply #9 on: June 19, 2008, 10:36:43 AM »
I've cleaned this up a little and included it into the /docs howtos here...

http://www.selintra.com/docs/cgi-bin/view/Main/DocChapter2519

Kind Regards

S