Custom Dialplan Problem

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

Custom Dialplan Problem

Postby mumin37 » Sat Feb 21, 2015 9:14 am

Hello, I've got problem with my Custom DIalplan.
I'd like to exec some bash script after hangup using variables set at the beggining , but it doesn't work from vicidial, but it does when using manual dial from softphone.

My Dialplan:
Code: Select all
exten => _9XXXXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _9XXXXXXXXX,n,Set(camp=123)
exten => _9XXXXXXXXX,n,Set(from=997)
exten => _9XXXXXXXXX,n,Set(to=996)
exten => _9XXXXXXXXX,n,Set(zgoda=1-zgoda)
exten => _9XXXXXXXXX,n,Set(phone=${EXTEN:1})
exten => _9XXXXXXXXX,n,Dial(${op2}/${EXTEN:1},21,tTr)

exten => h,2,System(/usr/bin/sh /opt/skrypty/go.sh ${from} ${to} ${zgoda} ${camp} ${phone})


If I make call from console or direct from softphone it transfers variables to script:
Code: Select all
[Feb 21 14:54:41]     -- Executing [9123456789@default:1] AGI("Console/dsp", "agi://127.0.0.1:4577/call_log") in new stack
[Feb 21 14:54:41]     -- <Console/dsp>AGI Script agi://127.0.0.1:4577/call_log completed, returning 0
[Feb 21 14:54:41]     -- Executing [9123456789@default:2] Set("Console/dsp", "camp=123") in new stack
[Feb 21 14:54:41]     -- Executing [9123456789@default:3] Set("Console/dsp", "from=997") in new stack
[Feb 21 14:54:41]     -- Executing [9123456789@default:4] Set("Console/dsp", "to=996") in new stack
[Feb 21 14:54:41]     -- Executing [9123456789@default:5] Set("Console/dsp", "zgoda=1-zgoda") in new stack
[Feb 21 14:54:41]     -- Executing [9123456789@default:6] Set("Console/dsp", "phone=123456789") in new stack
[Feb 21 14:54:41]     -- Executing [9123456789@default:7] Dial("Console/dsp", "SIP/op2/123456789,21,tTr") in new stack
[Feb 21 14:54:41]   == Using SIP RTP CoS mark 5
[Feb 21 14:54:41]     -- Called SIP/op2/123456789
[Feb 21 14:54:41]     -- SIP/op2-00000009 is ringing
[Feb 21 14:54:44]     -- SIP/op2-00000009 is making progress passing it to Console/dsp
[Feb 21 14:54:44]     -- SIP/op2-00000009 is ringing
[Feb 21 14:54:44]     -- SIP/op2-00000009 is making progress passing it to Console/dsp
serwer*CLI> console hangup
[Feb 21 14:54:46]   == Spawn extension (default, 9123456789, 7) exited non-zero on 'Console/dsp'
[Feb 21 14:54:46]     -- Executing [h@default:1] AGI("Console/dsp", "agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----16-----CANCEL----------") in new stack
[Feb 21 14:54:46]     -- <Console/dsp>AGI Script agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----16-----CANCEL---------- completed, returning 0
[Feb 21 14:54:46]     -- Executing [h@default:2] System("Console/dsp", "/usr/bin/sh /opt/skrypty/go.sh 997 996 1-zgoda 123 123456789") in new stack


If I make call from Vicidial (Remote Agent Survey) it looks like that - it doesn't transfer variables to the script:
Code: Select all
[Feb 21 15:00:00]     -- Executing [9123456789@default:1] AGI("Local/9123456789@default-00000003;2", "agi://127.0.0.1:4577/call_log") in new stack
[Feb 21 15:00:00]     -- AGI Script Executing Application: (EXEC) Options: (Set(_CAMPCUST=999))
[Feb 21 15:00:00]     -- <Local/9123456789@default-00000003;2>AGI Script agi://127.0.0.1:4577/call_log completed, returning 0
[Feb 21 15:00:00]     -- Executing [9123456789@default:2] Set("Local/9123456789@default-00000003;2", "camp=123") in new stack
[Feb 21 15:00:00]     -- Executing [9123456789@default:3] Set("Local/9123456789@default-00000003;2", "from=997") in new stack
[Feb 21 15:00:00]     -- Executing [9123456789@default:4] Set("Local/9123456789@default-00000003;2", "to=996") in new stack
[Feb 21 15:00:00]     -- Executing [9123456789@default:5] Set("Local/9123456789@default-00000003;2", "zgoda=1-zgoda") in new stack
[Feb 21 15:00:00]     -- Executing [9123456789@default:6] Set("Local/9123456789@default-00000003;2", "phone=123456789") in new stack
[Feb 21 15:00:00]     -- Executing [9123456789@default:7] Dial("Local/9123456789@default-00000003;2", "SIP/op2/123456789,21,tTr") in new stack
[Feb 21 15:00:04]     -- SIP/op2-0000000a is making progress passing it to Local/9123456789@default-00000003;2
[Feb 21 15:00:05]     -- SIP/op2-0000000a is ringing
[Feb 21 15:00:05]     -- SIP/op2-0000000a is making progress passing it to Local/9123456789@default-00000003;2
[Feb 21 15:00:17]     -- SIP/op2-0000000a answered Local/9123456789@default-00000003;2
[Feb 21 15:00:17]        > Channel Local/9123456789@default-00000003;1 was answered.
[Feb 21 15:00:31]   == Spawn extension (default, 8373, 5) exited non-zero on 'SIP/op2-0000000a'
[Feb 21 15:00:31]     -- Executing [h@default:1] AGI("SIP/op2-0000000a", "agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----0---------------") in new stack
[Feb 21 15:00:31]     -- <SIP/op2-0000000a>AGI Script agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----0--------------- completed, returning 0
[Feb 21 15:00:31]     -- Executing [h@default:2] System("SIP/op2-0000000a", "/usr/bin/sh /opt/skrypty/go.sh     ") in new stac


The only difference I can see in Asterisk console is that in Console dial "Call ID" is everywhere set to "Console/dsp", but using Vicidial it changes from: "Local/9123456789@default-00000003;2" when calling to "SIP/op2-0000000a" when hangups.

Does anyone know how to transfer variables set before Dial to my hangup script, or maybe there is another way to do this?

Thanks in advance.


My Vicidial Version:
ViciBox Redux v.6.0.2-140825 from ISO
VERSION: 2.10-451a
BUILD: 140902-0816
mumin37
 
Posts: 31
Joined: Wed Jan 04, 2012 3:38 am

Return to Support

Who is online

Users browsing this forum: Google [Bot] and 88 guests