[asterisk-users] GET DATA Returning only a single digit
Akintayo Olusegun
trinisoftinc at gmail.com
Fri Oct 17 09:23:08 CDT 2008
--
jand. more than just a group
Asterisk AGI Command GET DATA is usually of this form
GET DATA timeout max_digits
When I execute this command, I get only a single digit, regardless of
what the value of max_digits is,
Also the script quits Immediately after the press of the digit
regardless of what the value of timeout is,
This is really un-desirable as I will like to GET multiple DTMF digits
at a time without having to put
GET DATA in a loop. Can anyone help me out in this please
This is my source code and the output in Asterisk Console
1#! /usr/bin/python
2
3 import sys
4
5 if __name__ == '__main__':
6 line = sys.stdin.readline()
7
8 while line.strip() != "":
9 line = sys.stdin.readline()
10
11 sys.stdout.write('STREAM FILE tt-monkeys 1 \n')
12 sys.stdout.flush()
13 line = sys.stdin.readline()
14 sys.stderr.write("DIGIT PRESSED: %s\n" % (line))
15
16 sys.stdout.write('GET DATA tt-monkeys 10 4\n')
17 sys.stdout.flush()
18 line = sys.stdin.readline()
Asterisk Console
AGI Tx >> agi_request: test.py
AGI Tx >> agi_channel: SIP/jane-09386dd0
AGI Tx >> agi_language: en
AGI Tx >> agi_type: SIP
AGI Tx >> agi_uniqueid: 1224244224.22
AGI Tx >> agi_callerid: unknown
AGI Tx >> agi_calleridname: john
AGI Tx >> agi_callingpres: 0
AGI Tx >> agi_callingani2: 0
AGI Tx >> agi_callington: 0
AGI Tx >> agi_callingtns: 0
AGI Tx >> agi_dnid: unknown
AGI Tx >> agi_rdnis: unknown
AGI Tx >> agi_context: outgoing
AGI Tx >> agi_extension: 111
AGI Tx >> agi_priority: 1
AGI Tx >> agi_enhanced: 0.0
AGI Tx >> agi_accountcode: 1
AGI Tx >>
AGI Rx << STREAM FILE tt-monkeys 1
-- Playing 'tt-monkeys' (escape_digits=1) (sample_offset 0)
AGI Tx >> 200 result=49 endpos=31680
DIGIT PRESSED: 200 result=49 endpos=31680
AGI Rx << GET DATA tt-monkeys 10 4
-- <SIP/jane-09386dd0> Playing 'tt-monkeys' (language 'en')
AGI Tx >> 200 result=-1
== Spawn extension (outgoing, 111, 1) exited non-zero on 'SIP/jane-09386dd0'
[Oct 17 12:50:48] NOTICE[9559]: pbx_spool.c:351 attempt_thread: Call
completed to SIP/jane
--
jand. more than just a group
More information about the asterisk-users
mailing list