0

I'm trying to solve a very painful problem that impedes on my world utilizing my amazing powers as a programmer... (my front gate makes my friends call my cell phone, then I have to press "9" and it lets them in)...

So, my amazing powers have gotten me very far, except this last part I can't get (perhaps due to lack of sleep).

I've got every thing worked out so far: The call-box now dials my Google Voice account, which forwards it to my virtual machine on my laptop running the latest 'trixbox' (Asterisk), which will receives the call via Gizmo5/SIP junk.

What I need now is to have the phone call answered, and then "press" the number "9"... wait about 5 seconds, then hang-up.

I'm sure it's as easy as putting this code somewhere in a config file:

exten => 1234,1,Answer
exten => 1234,n,Press("the flippin 9 key")
exten => 1234,n,Wait(5)
exten => 1234,n,Hangup

But I don't know:

1) Is this possible (pretty sure it is) 2) What file do I edit? 3) Do I need to make an extension first? 4) Is that code in my example above anywhere close? 5) What do I actually need to do!

I greatly appreciate any help on this one.

Timothy Khouri
  • 31,315
  • 21
  • 88
  • 128

1 Answers1

3

You're close, try:

exten => 1234,1,Answer
exten => 1234,2,Wait(2)      ; Safety time
exten => 1234,3,SendDTMF(9)
exten => 1234,4,Wait(5)
exten => 1234,5,Hangup

This tells Asterisk how to handle a call coming in for 1234

In a "standard" Asterisk installation, this goes in extensions.conf and 1234 should be whatever extension/number the incoming call is coming in on.

extensions.conf has different sections, which can vary based on distribution and local setup, but it's usually best to put this in the [default] section.

payne
  • 13,833
  • 5
  • 42
  • 49
  • Do I need to first make an extension called 1234? also, do I just paste this at the bottom of the file? or do I need an "[blahblah]" above it? – Timothy Khouri Feb 22 '11 at 22:43
  • You don't need to "make" an extension -- the existence of these lines in extensions.conf tells Asterisk how to handle calls coming in for 1234. You should replace 1234 with whatever number you're using for Gizmo5/SIP. (For where to put it, I edited the answer, above). – payne Feb 23 '11 at 02:32