Skip to content

Instantly share code, notes, and snippets.

View rdegges's full-sized avatar

Randall Degges rdegges

View GitHub Profile
rdegges@cora:~/code$ ./pyannoy-skeleton.py 18182223333 5
Placing call... 0 to 18182223333 using caller ID 19408593936 and playing soundfile hello-world at 2010-01-15 22:48:10.438817
Placing call... 1 to 18182223333 using caller ID 16010809634 and playing soundfile hello-world at 2010-01-15 22:49:10
Placing call... 2 to 18182223333 using caller ID 15756315902 and playing soundfile hello-world at 2010-01-15 22:50:10
Placing call... 3 to 18182223333 using caller ID 13633763891 and playing soundfile hello-world at 2010-01-15 22:51:10
Placing call... 4 to 18182223333 using caller ID 14111207078 and playing soundfile hello-world at 2010-01-15 22:52:10
#!/usr/bin/python
"""
pyannoy.py
@author: Randall Degges
@email: rdegges@gmail.com
@date: 1-15-2010
@license: GPLv3 (http://www.gnu.org/licenses/gpl-3.0.txt)
rdegges@cora:~/code$ ./pyannoy.py 18882223333 5
Placing call... 0 to 18882223333 using caller ID 13237589975 and playing soundfile hello-world at 2010-01-16 02:09:06.285090
Placing call... 1 to 18882223333 using caller ID 14944527639 and playing soundfile hello-world at 2010-01-16 02:10:06
Placing call... 2 to 18882223333 using caller ID 16170548852 and playing soundfile hello-world at 2010-01-16 02:11:06
Placing call... 3 to 18882223333 using caller ID 18298520261 and playing soundfile hello-world at 2010-01-16 02:12:06
Placing call... 4 to 18882223333 using caller ID 16292306101 and playing soundfile hello-world at 2010-01-16 02:13:06
rdegges@cora:~/code$ ls -la /var/spool/asterisk/outgoing/
total 28
drwxr-xr-x 2 rdegges rdegges 4096 2010-01-16 02:09 .
#!/usr/bin/python
"""
pyannoy-skeleton.py
@author: Randall Degges
@email: rdegges@gmail.com
@date: 1-15-2010
@license: GPLv3 (http://www.gnu.org/licenses/gpl-3.0.txt)
/*
* Code hijacked and modified from: http://devdaily.com/java/edu/pj/pj010016/
*/
import java.io.*;
public class JavaRunCommand {
public static void main(String args[]) {
[Feb 16 19:14:15] ERROR[25770]: utils.c:1126 ast_carefulwrite: write()
returned error: Broken pipe
[Feb 16 19:14:15] ERROR[25770]: utils.c:1126 ast_carefulwrite: write()
returned error: Broken pipe
#!/bin/bash
echo "ANSWER"
echo "NOOP hello, world!"
echo "HANGUP"
; This dial plan code passes all call processing to the call-processor.sh
; shell script.
[incoming]
exten => _X.,1,AGI(call-processor.sh)
<SIP/flowroute-ac10d3c8>AGI Tx >> agi_request: hello-world.sh
<SIP/flowroute-ac10d3c8>AGI Tx >> agi_channel: SIP/flowroute-ac10d3c8
<SIP/flowroute-ac10d3c8>AGI Tx >> agi_language: en
<SIP/flowroute-ac10d3c8>AGI Tx >> agi_type: SIP
<SIP/flowroute-ac10d3c8>AGI Tx >> agi_uniqueid: 1266365654.10672
<SIP/flowroute-ac10d3c8>AGI Tx >> agi_version: 1.6.1.1
<SIP/flowroute-ac10d3c8>AGI Tx >> agi_callerid: <removed>
<SIP/flowroute-ac10d3c8>AGI Tx >> agi_calleridname: unknown
<SIP/flowroute-ac10d3c8>AGI Tx >> agi_callingpres: 0
<SIP/flowroute-ac10d3c8>AGI Tx >> agi_callingani2: 0
; This dial plan code passes all call processing to the call-processor.sh
; shell script with command line arguments.
[incoming]
exten => _X.,1,AGI(call-processor.sh,arg1,arg2,arg3,...,arg127)