custom script - script should run after hangup

lev1987

Joined
Jan 8, 2010
Messages
25
Likes
0
Points
0
#1
Hello guys,
I have the following script,
Code:
[correctnumber]
exten => s,1,Macro(record-enable,${extension},IN,)
exten => s,n,Set(filename=http://192.168.100.254/ftp/${CALLFILENAME}.wav
exten => s,n,Set(file=${CALLFILENAME})
exten => s,n,Set(calerid=${CALLERID(num)})
exten => s,n,System(echo "|${number}|${extension}|${filename}|${calerid}|${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}|" > /usr/src/temp/${extension}.txt)
exten => s,n,Dial(SIP/${extension},60,tTre)
exten => h,1,wait(5)
exten => h,n,System(cp /astrec/${file}.*  /usr/src/temp/)
exten => h,n,Hangup
I'll describe in short what is supposed to do and what's not working correctly.

This script follows an IVR, the caller chooses which extension the call saved into "${extension}" and what number to save into "${number}"
after that it echo's a txt file with some information
and when the call is disconnected, the recording file copied into the same dir as the txt file.

script runs fine when the called extension (by the dial command) hangs up, but when the caller hangs up no recording file is copied.

Any idea how I fix this?

Thanks alot!
 

jgutierrez

Joined
Feb 28, 2008
Messages
5,737
Likes
0
Points
0
#2
Re: custom script - script run after hangup

Paste the CLI output
 

lev1987

Joined
Jan 8, 2010
Messages
25
Likes
0
Points
0
#3
Re: custom script - script run after hangup

Code:
    -- Goto (correctnumber,s,1)
    -- Executing [s@correctnumber:1] Macro("DAHDI/13-1", "record-enable|144|IN|") in new stack
    -- Executing [s@macro-record-enable:1] GotoIf("DAHDI/13-1", "1?check") in new stack
    -- Goto (macro-record-enable,s,4)
    -- Executing [s@macro-record-enable:4] AGI("DAHDI/13-1", "recordingcheck|20100723-142413|1279884231.3549") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/recordingcheck
  recordingcheck|20100723-142413|1279884231.3549: Inbound recording enabled.
  recordingcheck|20100723-142413|1279884231.3549: CALLFILENAME=20100723-142413-1279884231.3549
    -- AGI Script recordingcheck completed, returning 0
    -- Executing [s@macro-record-enable:999] MixMonitor("DAHDI/13-1", "/astrec/20100723-142413-1279884231.3549.wav||") in new stack
    -- Executing [s@correctnumber:2] Set("DAHDI/13-1", "filename=X:20100723-142413-1279884231.3549.wav") in new stack
    -- Executing [s@correctnumber:3] Set("DAHDI/13-1", "file=20100723-142413-1279884231.3549") in new stack
    -- Executing [s@correctnumber:4] Set("DAHDI/13-1", "calerid=") in new stack
    -- Executing [s@correctnumber:5] System("DAHDI/13-1", "echo "|305547772|144|X:20100723-142413-1279884231.3549.wav||20100723-142413|" > /usr/src/temp/144.txt") in new stack
  == Begin MixMonitor Recording DAHDI/13-1
    -- Executing [s@correctnumber:6] Dial("DAHDI/13-1", "SIP/144|60|tTre") in new stack
    -- Called 144
    -- SIP/144-08ea0ba8 is ringing
    -- SIP/144-08ea0ba8 is ringing
    -- SIP/144-08ea0ba8 answered DAHDI/13-1
    -- Executing [h@correctnumber:1] Wait("DAHDI/13-1", "5") in new stack
    -- Executing [h@correctnumber:2] System("DAHDI/13-1", [b]"cp /astrec/20100723-142413-1279884231.3549.*  /usr/src/temp/")[/b] in new stack
    -- Executing [h@correctnumber:3] Hangup("DAHDI/13-1", "") in new stack
  == Spawn h extension (correctnumber, h, 3) exited non-zero on 'DAHDI/13-1'
  == Spawn extension (correctnumber, s, 6) exited non-zero on 'DAHDI/13-1'
when called ext hangs up the file is copied, here the same when the caller hangs up
Code:
 -- Goto (correctnumber,s,1)
    -- Executing [s@correctnumber:1] Macro("DAHDI/13-1", "record-enable|144|IN|") in new stack
    -- Executing [s@macro-record-enable:1] GotoIf("DAHDI/13-1", "1?check") in new stack
    -- Goto (macro-record-enable,s,4)
    -- Executing [s@macro-record-enable:4] AGI("DAHDI/13-1", "recordingcheck|20100723-142957|1279884577.3555") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/recordingcheck
  recordingcheck|20100723-142957|1279884577.3555: Inbound recording enabled.
  recordingcheck|20100723-142957|1279884577.3555: CALLFILENAME=20100723-142957-1279884577.3555
    -- AGI Script recordingcheck completed, returning 0
    -- Executing [s@macro-record-enable:999] MixMonitor("DAHDI/13-1", "/astrec/20100723-142957-1279884577.3555.wav||") in new stack
    -- Executing [s@correctnumber:2] Set("DAHDI/13-1", "filename=X:20100723-142957-1279884577.3555.wav") in new stack
    -- Executing [s@correctnumber:3] Set("DAHDI/13-1", "file=20100723-142957-1279884577.3555") in new stack
    -- Executing [s@correctnumber:4] Set("DAHDI/13-1", "calerid=") in new stack
    -- Executing [s@correctnumber:5] System("DAHDI/13-1", "echo "|305547785|144|X:20100723-142957-1279884577.3555.wav||20100723-142957|" > /usr/src/temp/144.txt") in new stack
  == Begin MixMonitor Recording DAHDI/13-1
    -- Executing [s@correctnumber:6] Dial("DAHDI/13-1", "SIP/144|60|tTre") in new stack
    -- Called 144
    -- SIP/144-08ea0ba8 is ringing
    -- SIP/144-08ea0ba8 is ringing
    -- Remote UNIX connection
    -- Remote UNIX connection disconnected
    -- SIP/144-08ea0ba8 answered DAHDI/13-1
    -- Channel 0/1, span 2 got hangup request, cause 16
    -- Executing [h@correctnumber:1] Wait("DAHDI/13-1", "5") in new stack
  == Spawn h extension (correctnumber, h, 1) exited non-zero on 'DAHDI/13-1'
  == Spawn extension (correctnumber, s, 6) exited non-zero on 'DAHDI/13-1'
    -- Hungup 'DAHDI/13-1'
  == End MixMonitor Recording DAHDI/13-1
 

lev1987

Joined
Jan 8, 2010
Messages
25
Likes
0
Points
0
#4
somebody?
 

lev1987

Joined
Jan 8, 2010
Messages
25
Likes
0
Points
0
#5
bump.
anyone? please it's very urgent..
BTW elastix version is 1.5.2
 

jgutierrez

Joined
Feb 28, 2008
Messages
5,737
Likes
0
Points
0
#6
Edit /etc/asterisk/logger.conf
add the following line at the end of the file:
console => notice,warning,error,debug,verbose
Then execute from the shell:
asterisk -rx "module reload"
Then execute again the scenario that causes the issue.
 

Members online

No members online now.

Latest posts

Forum statistics

Threads
30,913
Messages
130,917
Members
17,589
Latest member
cristian.saiz
Top