Skip to content

Commit

Permalink
Dev (#9)
Browse files Browse the repository at this point in the history
* SetLogger and Verbosef added

* Verbose checked

* Command logging

* WaitForDigit

* Logging

* WaitForDigit: IsPrint fixed

* GetData updated

* GetData updated
  • Loading branch information
andrey-kolegov authored and Ulexus committed Mar 28, 2019
1 parent 1372c99 commit 7e9ddb0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions agi.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,12 @@ func (a *AGI) Get(key string) (string, error) {
}

// GetData plays a file and receives DTMF, returning the received digits
func (a *AGI) GetData(name string, timeout int, maxdigits int) (digit string, err error) {
return a.Command("GET DATA", name, strconv.Itoa(timeout), strconv.Itoa(maxdigits)).Val()
func (a *AGI) GetData(sound string, timeout time.Duration, maxdigits int) (digits string, err error) {
if sound == "" {
sound = "silence/1"
}
resp := a.Command("GET DATA", sound, toMSec(timeout), strconv.Itoa(maxdigits))
return resp.ResultString, resp.Error
}

// Hangup terminates the call
Expand Down

0 comments on commit 7e9ddb0

Please sign in to comment.