[asterisk-users] Dialplan / AGI autoanswer question

Matthew Harrell lists-sender-6a8aaf at bittwiddlers.com
Wed Aug 15 12:51:56 CDT 2007


Hi.  I've got a working dial plan on my home system but there are problems 
with it and I was hoping someone more comfortable with dial plans might be
able to help.  In a nutshell here's what I'm currently doing on an incoming
outside phone call

  [default]
    Set(TIMEOUT(digit)=3
    Set(TIMEOUT(response)=60

    exten => s,1,NoOp(Answering in default context)
    exten => s,2,Wait(1)

    ; look up the callerid name and state in the database
    exten => s,3,AGI(cid_fix.php)

    ; print callerid
    exten => s,4,NoOp(${CALLERID(name)} ${CALLERID(number)} ${CALLSTATE} ${DATETIME})

    ; short circuit the sequence if this is a blacklisted or whitelisted entry
    exten => s,5,GotoIf($["${CALLSTATE}" = "black"]?blacklisted,s,1)
    exten => s,6,GotoIf($["${CALLSTATE}" = "white"]?50)

    ; send a sit tone if we don't have a callerid
    ;
    exten => s,7,Zapateller(nocallerid)

    ; after a certain time I don't want phone calls
    ;
    exten => s,8,GotoIfTime(${AFTER_HOURS}|*|*|*?voicemail,s,1)

    ; no callerid
    ;
    exten => s,9,GotoIf($["${CALLERID(number)}" = ""]?voicemail,s,1)

    ; If 800 number
    ;
    exten => s,10,GotoIf($["${CALLERID(number):0:3}" = "866"]?voicemail,s,1)
    exten => s,11,GotoIf($["${CALLERID(number):0:3}" = "877"]?voicemail,s,1)
    exten => s,12,GotoIf($["${CALLERID(number):0:3}" = "888"]?voicemail,s,1)
    exten => s,13,GotoIf($["${CALLERID(number):0:3}" = "800"]?voicemail,s,1:50)

    ; ring the phones and go to voicemail if nobody answers
    ;
    exten => s,50,Dial(${LOCAL_LINES},20,tT)
    exten => s,51,Goto(voicemail,s,1)

The intent of this sequence is to take the incoming callerid, replace it if
known with something in the database, and branch on the state from the DB
and time of the day.  

One issue I'm having is that the AGI call seems to cause it to answer the
line.  Normally that wouldn't be an issue but that answer seems to trip up
a number of automated systems and some people in addition to leaving a half
second pause in the ringing.  Is there a way I can do the call to my lookup 
script without answering the line yet?  Or is there a better way to do what
I'm trying to do?

I'm working with asterisk 1.4.10

Thanks

-- 
  Matthew Harrell                        Managers are like cats in a litter 
  Bit Twiddlers, Inc.                     box. They're always rearranging 
  mharrell at bittwiddlers.com               trying to cover up what they've done



More information about the asterisk-users mailing list