All pastes #559842 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-06-11 22:33 UTC
rendered paste body
old
----
exten => test,1,Answer() 
exten => test,2,Read(testtone||1) 
exten => test,3,GotoIf(${testtone} = "1"]?5)
exten => test,4,System(/usr/bin/php email_alert.php) 
exten => test,5,Hangup

new
---
[ibptestcall]
exten => test,1,Answer()
exten => test,2,Read(testtone||1)
exten => test,3,GotoIf($["${testtone}"="1"]?5)
;exten => test,3,GotoIf(${testtone} = "1"]?5)
exten => test,4,System(/usr/bin/php email_alert.php)
exten => test,5,Hangup

new-2
-----
[ibptestcall]
exten => test,1,SIPDtmfMode(inband)
exten => test,2,Answer()
exten => test,3,Read(testtone||1)
exten => test,4,GotoIf($["${testtone}"="1"]?6)
exten => test,5,System(/root/ifbyphone/email_alert)
exten => test,6,Hangup



CLI Output
----------

    -- Attempting call on SIP/sipmedia/1866******* for test@ibptestcall:1 (Retry 1)
       > Channel SIP/sipmedia-09dd32e8 was answered.
    -- Executing Answer("SIP/sipmedia-09dd32e8", "") in new stack
    -- Executing Read("SIP/sipmedia-09dd32e8", "testtone||1") in new stack
    -- Accepting a maximum of 1 digits.
    -- User disconnected
  == Spawn extension (ibptestcall, test, 2) exited non-zero on 'SIP/sipmedia-09dd32e8'
Jun 11 17:22:09 NOTICE[24221]: pbx_spool.c:279 attempt_thread: Call completed to SIP/sipmedia/1866*******


Read info
---------
  -= Info about application 'Read' =- 

[Synopsis]
Read a variable

[Description]
  Read(variable[|filename][|maxdigits][|option][|attempts][|timeout])

Reads a #-terminated string of digits a certain number of times from the
user in to the given variable.
  filename   -- file to play before reading digits.
  maxdigits  -- maximum acceptable number of digits. Stops reading after
                maxdigits have been entered (without requiring the user to
                press the '#' key).
                Defaults to 0 - no limit - wait for the user press the '#' key.
                Any value below 0 means the same. Max accepted value is 255.
  option     -- may be 'skip' to return immediately if the line is not up,
                or 'noanswer' to read digits even if the line is not up.
  attempts   -- if greater than 1, that many attempts will be made in the 
                event no data is entered.
  timeout    -- if greater than 0, that value will override the default timeout.

Read should disconnect if the function fails or errors out.