Добиваю тему. =) Итак волею судьбы я не довел этот проект, как мне пришлось переподымать астер. Мой выбор в этот раз пал на фрипбх 4.2 с 11 астером, и, о чудо, он узнал все эти переменные, стал выдавать необходимую информацию и складывать в базу. Но, как всегда, "из коробки" у меня все не работает... Итак по порядку.
Код: Выделить всё
[opinion-ivr]
exten => _.,1,NoOp(Statrt IVR)
exten => _.,n,DIAL(SIP/${EXTEN},,trg) ;опция g позволяет звонку пройти далее по диалплану
exten => _.,n,Goto(opinion,,1)
[opinion]
exten => _X.,1,Answer
exten => _X.,n,Wait(1)
exten => _X.,n(skip),Set(IVR_MSG=en/beep)
exten => _X.,n(start),Set(TIMEOUT(digit)=1)
exten => _X.,n,ExecIf($["${IVR_MSG}" != ""]?Background(${IVR_MSG}))
exten => _X.,n,WaitExten(5,)
exten => 0,1,MYSQL(Connect connid localhost freepbxuser 123 asteriskcdrdb)
exten => 0,n,MYSQL(Query resultid ${connid} INSERT INTO opinion (id,date,callerid,idasternumder,exten,queues,opinion) VALUES(NULL,"${STRFTIME(${EPOCH},,%Y%m%d%H%M%S)}","${FROMEXTEN}","${UNIQUEID}","${DIALEDPEERNUMBER}","${NODEST}","0"))
exten => 0,n,MYSQL(Disconnect ${connid})
exten => 0,n,Playback(custom/fidel,skip)
exten => 1,1,MYSQL(Connect connid localhost freepbxuser 123 asteriskcdrdb)
exten => 1,n,MYSQL(Query resultid ${connid} INSERT INTO opinion (id,date,callerid,idasternumder,exten,queues,opinion) VALUES(NULL,"${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}","${FROMEXTEN}","${UNIQUEID}","${DIALEDPEERNUMBER}","${NODEST}","0"))
exten => 1,n,MYSQL(Disconnect ${connid})
exten => 1,n,Playback(custom/fidel,skip)
Проблема в том, что если звонок, после попадания в очередь, отбивается одним из участников очереди, то звонок отбивается у всех операторов, и сразу вкл диалплан opinion-ivr, где просят оценить работу.
Код: Выделить всё
-- Executing [+77273902829@from-trunk:1] Set("SIP/FirstTrunk-00000003", "__FROM_DID=+77273902829") in new stack
-- Executing [+77273902829@from-trunk:2] Set("SIP/FirstTrunk-00000003", "CHANNEL(language)=ru") in new stack
-- Executing [+77273902829@from-trunk:3] Gosub("SIP/FirstTrunk-00000003", "app-blacklist-check,s,1()") in new stack
-- Executing [s@app-blacklist-check:1] GotoIf("SIP/FirstTrunk-00000003", "0?blacklisted") in new stack
-- Executing [s@app-blacklist-check:2] Set("SIP/FirstTrunk-00000003", "CALLED_BLACKLIST=1") in new stack
-- Executing [s@app-blacklist-check:3] Return("SIP/FirstTrunk-00000003", "") in new stack
-- Executing [+77273902829@from-trunk:4] Set("SIP/FirstTrunk-00000003", "CDR(did)=+77273902829") in new stack
-- Executing [+77273902829@from-trunk:5] ExecIf("SIP/FirstTrunk-00000003", "1 ?Set(CALLERID(name)=87019650957)") in new stack
-- Executing [+77273902829@from-trunk:6] Set("SIP/FirstTrunk-00000003", "__CALLINGPRES_SV=allowed_not_screened") in new stack
-- Executing [+77273902829@from-trunk:7] Set("SIP/FirstTrunk-00000003", "CALLERPRES()=allowed_not_screened") in new stack
-- Executing [+77273902829@from-trunk:8] Goto("SIP/FirstTrunk-00000003", "ext-queues,123412,1") in new stack
-- Goto (ext-queues,123412,1)
-- Executing [123412@ext-queues:1] Macro("SIP/FirstTrunk-00000003", "user-callerid,") in new stack
-- Executing [s@macro-user-callerid:1] Set("SIP/FirstTrunk-00000003", "TOUCH_MONITOR=1382936423.7") in new stack
-- Executing [s@macro-user-callerid:2] Set("SIP/FirstTrunk-00000003", "AMPUSER=87019650957") in new stack
-- Executing [s@macro-user-callerid:3] GotoIf("SIP/FirstTrunk-00000003", "0?report") in new stack
-- Executing [s@macro-user-callerid:4] ExecIf("SIP/FirstTrunk-00000003", "1?Set(REALCALLERIDNUM=87019650957)") in new stack
-- Executing [s@macro-user-callerid:5] Set("SIP/FirstTrunk-00000003", "AMPUSER=") in new stack
-- Executing [s@macro-user-callerid:6] Set("SIP/FirstTrunk-00000003", "AMPUSERCIDNAME=") in new stack
-- Executing [s@macro-user-callerid:7] GotoIf("SIP/FirstTrunk-00000003", "1?report") in new stack
-- Goto (macro-user-callerid,s,15)
-- Executing [s@macro-user-callerid:15] GotoIf("SIP/FirstTrunk-00000003", "0?continue") in new stack
-- Executing [s@macro-user-callerid:16] Set("SIP/FirstTrunk-00000003", "__TTL=64") in new stack
-- Executing [s@macro-user-callerid:17] GotoIf("SIP/FirstTrunk-00000003", "1?continue") in new stack
-- Goto (macro-user-callerid,s,28)
-- Executing [s@macro-user-callerid:28] Set("SIP/FirstTrunk-00000003", "CALLERID(number)=87019650957") in new stack
-- Executing [s@macro-user-callerid:29] Set("SIP/FirstTrunk-00000003", "CALLERID(name)=87019650957") in new stack
-- Executing [s@macro-user-callerid:30] Set("SIP/FirstTrunk-00000003", "CDR(cnum)=87019650957") in new stack
-- Executing [s@macro-user-callerid:31] Set("SIP/FirstTrunk-00000003", "CDR(cnam)=87019650957") in new stack
-- Executing [s@macro-user-callerid:32] Set("SIP/FirstTrunk-00000003", "CHANNEL(language)=ru") in new stack
-- Executing [123412@ext-queues:2] Answer("SIP/FirstTrunk-00000003", "") in new stack
-- Executing [123412@ext-queues:3] Set("SIP/FirstTrunk-00000003", "__NODEST=123412") in new stack
-- Executing [123412@ext-queues:4] Set("SIP/FirstTrunk-00000003", "QCIDPP=") in new stack
-- Executing [123412@ext-queues:5] Set("SIP/FirstTrunk-00000003", "VQ_CIDPP=") in new stack
-- Executing [123412@ext-queues:6] ExecIf("SIP/FirstTrunk-00000003", "0?Macro(prepend-cid, )") in new stack
-- Executing [123412@ext-queues:7] Set("SIP/FirstTrunk-00000003", "QAINFO=") in new stack
-- Executing [123412@ext-queues:8] Set("SIP/FirstTrunk-00000003", "VQ_AINFO=") in new stack
-- Executing [123412@ext-queues:9] ExecIf("SIP/FirstTrunk-00000003", "0?Set(__ALERT_INFO=)") in new stack
-- Executing [123412@ext-queues:10] Set("SIP/FirstTrunk-00000003", "QJOINMSG=") in new stack
-- Executing [123412@ext-queues:11] Set("SIP/FirstTrunk-00000003", "VQ_JOINMSG=") in new stack
-- Executing [123412@ext-queues:12] Set("SIP/FirstTrunk-00000003", "QMOH=") in new stack
-- Executing [123412@ext-queues:13] Set("SIP/FirstTrunk-00000003", "VQ_MOH=") in new stack
-- Executing [123412@ext-queues:14] ExecIf("SIP/FirstTrunk-00000003", "0?Set(__MOHCLASS=)") in new stack
-- Executing [123412@ext-queues:15] Set("SIP/FirstTrunk-00000003", "QRETRY=") in new stack
-- Executing [123412@ext-queues:16] Set("SIP/FirstTrunk-00000003", "VQ_RETRY=") in new stack
-- Executing [123412@ext-queues:17] Set("SIP/FirstTrunk-00000003", "QOPTIONS=t") in new stack
-- Executing [123412@ext-queues:18] Set("SIP/FirstTrunk-00000003", "VQ_OPTIONS=") in new stack
-- Executing [123412@ext-queues:19] Set("SIP/FirstTrunk-00000003", "QGOSUB=") in new stack
-- Executing [123412@ext-queues:20] Set("SIP/FirstTrunk-00000003", "VQ_GOSUB=") in new stack
-- Executing [123412@ext-queues:21] Set("SIP/FirstTrunk-00000003", "QAGI=") in new stack
-- Executing [123412@ext-queues:22] Set("SIP/FirstTrunk-00000003", "VQ_AGI=") in new stack
-- Executing [123412@ext-queues:23] Set("SIP/FirstTrunk-00000003", "QRULE=") in new stack
-- Executing [123412@ext-queues:24] Set("SIP/FirstTrunk-00000003", "VQ_RULE=") in new stack
-- Executing [123412@ext-queues:25] Set("SIP/FirstTrunk-00000003", "QPOSITION=") in new stack
-- Executing [123412@ext-queues:26] Set("SIP/FirstTrunk-00000003", "VQ_POSITION=") in new stack
-- Executing [123412@ext-queues:27] Set("SIP/FirstTrunk-00000003", "__MIXMON_FORMAT=wav") in new stack
-- Executing [123412@ext-queues:28] Gosub("SIP/FirstTrunk-00000003", "sub-record-check,s,1(q,123412,always)") in new stack
-- Executing [s@sub-record-check:1] Set("SIP/FirstTrunk-00000003", "REC_POLICY_MODE_SAVE=") in new stack
-- Executing [s@sub-record-check:2] GotoIf("SIP/FirstTrunk-00000003", "1?check") in new stack
-- Goto (sub-record-check,s,7)
-- Executing [s@sub-record-check:7] Set("SIP/FirstTrunk-00000003", "__MON_FMT=wav") in new stack
-- Executing [s@sub-record-check:8] GotoIf("SIP/FirstTrunk-00000003", "1?next") in new stack
-- Goto (sub-record-check,s,11)
-- Executing [s@sub-record-check:11] ExecIf("SIP/FirstTrunk-00000003", "0?Return()") in new stack
-- Executing [s@sub-record-check:12] ExecIf("SIP/FirstTrunk-00000003", "1?Set(__REC_POLICY_MODE=always)") in new stack
-- Executing [s@sub-record-check:13] GotoIf("SIP/FirstTrunk-00000003", "0?q,1") in new stack
-- Executing [s@sub-record-check:14] Set("SIP/FirstTrunk-00000003", "__REC_STATUS=INITIALIZED") in new stack
-- Executing [s@sub-record-check:15] Set("SIP/FirstTrunk-00000003", "NOW=1382936423") in new stack
-- Executing [s@sub-record-check:16] Set("SIP/FirstTrunk-00000003", "__DAY=28") in new stack
-- Executing [s@sub-record-check:17] Set("SIP/FirstTrunk-00000003", "__MONTH=10") in new stack
-- Executing [s@sub-record-check:18] Set("SIP/FirstTrunk-00000003", "__YEAR=2013") in new stack
-- Executing [s@sub-record-check:19] Set("SIP/FirstTrunk-00000003", "__TIMESTR=20131028-110023") in new stack
-- Executing [s@sub-record-check:20] Set("SIP/FirstTrunk-00000003", "__FROMEXTEN=87019650957") in new stack
-- Executing [s@sub-record-check:21] Set("SIP/FirstTrunk-00000003", "__CALLFILENAME=q-123412-87019650957-20131028-110023-1382936423.7") in new stack
-- Executing [s@sub-record-check:22] Goto("SIP/FirstTrunk-00000003", "q,1") in new stack
-- Goto (sub-record-check,q,1)
-- Executing [q@sub-record-check:1] GosubIf("SIP/FirstTrunk-00000003", "1?recq,1(q,123412,87019650957)") in new stack
-- Executing [recq@sub-record-check:1] Set("SIP/FirstTrunk-00000003", "AUDIOHOOK_INHERIT(MixMonitor)=yes") in new stack
-- Executing [recq@sub-record-check:2] Set("SIP/FirstTrunk-00000003", "MONITOR_FILENAME=2013/10/28/q-123412-87019650957-20131028-110023-1382936423.7") in new stack
-- Executing [recq@sub-record-check:3] MixMonitor("SIP/FirstTrunk-00000003", "2013/10/28/q-123412-87019650957-20131028-110023-1382936423.7.wav,,") in new stack
-- Executing [recq@sub-record-check:4] Set("SIP/FirstTrunk-00000003", "__REC_STATUS=RECORDING") in new stack
== Begin MixMonitor Recording SIP/FirstTrunk-00000003
-- Executing [recq@sub-record-check:5] Set("SIP/FirstTrunk-00000003", "CDR(recordingfile)=q-123412-87019650957-20131028-110023-1382936423.7.wav") in new stack
-- Executing [recq@sub-record-check:6] Return("SIP/FirstTrunk-00000003", "") in new stack
-- Executing [q@sub-record-check:2] Return("SIP/FirstTrunk-00000003", "") in new stack
-- Executing [123412@ext-queues:29] Set("SIP/FirstTrunk-00000003", "__CWIGNORE=TRUE") in new stack
-- Executing [123412@ext-queues:30] Set("SIP/FirstTrunk-00000003", "__CFIGNORE=TRUE") in new stack
-- Executing [123412@ext-queues:31] Set("SIP/FirstTrunk-00000003", "__FORWARD_CONTEXT=block-cf") in new stack
-- Executing [123412@ext-queues:32] ExecIf("SIP/FirstTrunk-00000003", "0?Playback(, )") in new stack
-- Executing [123412@ext-queues:33] QueueLog("SIP/FirstTrunk-00000003", "123412,1382936423.7,NONE,DID,+77273902829") in new stack
-- Executing [123412@ext-queues:34] Set("SIP/FirstTrunk-00000003", "QAANNOUNCE=") in new stack
-- Executing [123412@ext-queues:35] Set("SIP/FirstTrunk-00000003", "VQ_AANNOUNCE=") in new stack
-- Executing [123412@ext-queues:36] Set("SIP/FirstTrunk-00000003", "QMAXWAIT=") in new stack
-- Executing [123412@ext-queues:37] Set("SIP/FirstTrunk-00000003", "VQ_MAXWAIT=") in new stack
-- Executing [123412@ext-queues:38] Queue("SIP/FirstTrunk-00000003", "123412,t,,,,,,,,") in new stack
-- Started music on hold, class 'default', on SIP/FirstTrunk-00000003
-- Called Local/8888@opinion-ivr/n
-- Executing [8888@opinion-ivr:1] NoOp("Local/8888@opinion-ivr-00000002;2", "Statrt IVR") in new stack
-- Executing [8888@opinion-ivr:2] Dial("Local/8888@opinion-ivr-00000002;2", "SIP/8888,,trg") in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- Called Local/6767@opinion-ivr/n
-- Executing [6767@opinion-ivr:1] NoOp("Local/6767@opinion-ivr-00000003;2", "Statrt IVR") in new stack
-- LazyMembers debugging - Numbusies: 0, Numnoans: 0, Nummems: 2
-- Executing [6767@opinion-ivr:2] Dial("Local/6767@opinion-ivr-00000003;2", "SIP/6767,,trg") in new stack
-- Called SIP/8888
-- Local/8888@opinion-ivr-00000002;1 is ringing
-- Local/8888@opinion-ivr-00000002;1 connected line has changed. Saving it until answer for SIP/FirstTrunk-00000003
-- Local/8888@opinion-ivr-00000002;1 connected line has changed. Saving it until answer for SIP/FirstTrunk-00000003
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
-- SIP/8888-00000004 is ringing
-- Local/8888@opinion-ivr-00000002;1 is ringing
-- Called SIP/6767
-- Local/6767@opinion-ivr-00000003;1 is ringing
-- Local/6767@opinion-ivr-00000003;1 connected line has changed. Saving it until answer for SIP/FirstTrunk-00000003
-- Local/6767@opinion-ivr-00000003;1 connected line has changed. Saving it until answer for SIP/FirstTrunk-00000003
-- Got SIP response 603 "Decline" back from 10.110.0.74:5060
-- SIP/8888-00000004 is busy
== Everyone is busy/congested at this time (1:1/0/0)
-- Executing [8888@opinion-ivr:3] Goto("Local/8888@opinion-ivr-00000002;2", "opinion,,1") in new stack
-- Goto (opinion,8888,1)
-- Executing [8888@opinion:1] Answer("Local/8888@opinion-ivr-00000002;2", "") in new stack
-- Local/8888@opinion-ivr-00000002;1 answered SIP/FirstTrunk-00000003
== Spawn extension (opinion-ivr, 6767, 2) exited non-zero on 'Local/6767@opinion-ivr-00000003;2'
-- Executing [h@opinion-ivr:1] NoOp("Local/6767@opinion-ivr-00000003;2", "Statrt IVR") in new stack
-- Executing [h@opinion-ivr:2] Dial("Local/6767@opinion-ivr-00000003;2", "SIP/h,,trg") in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
[2013-10-28 11:00:28] ERROR[4173][C-00000001]: netsock2.c:269 ast_sockaddr_resolve: getaddrinfo("h", "(null)", ...): Name or service not known
[2013-10-28 11:00:28] WARNING[4173][C-00000001]: chan_sip.c:6201 create_addr: No such host: h
[2013-10-28 11:00:28] WARNING[4173][C-00000001]: app_dial.c:2437 dial_exec_full: Unable to create channel of type 'SIP' (cause 20 - Subscriber absent)
== Everyone is busy/congested at this time (1:0/0/1)
-- Executing [h@opinion-ivr:3] Goto("Local/6767@opinion-ivr-00000003;2", "opinion,,1") in new stack
-- Goto (opinion,h,1)
-- Stopped music on hold on SIP/FirstTrunk-00000003
-- Executing [8888@opinion:2] Wait("Local/8888@opinion-ivr-00000002;2", "1") in new stack
-- Executing [8888@opinion:3] Set("Local/8888@opinion-ivr-00000002;2", "IVR_MSG=en/beep") in new stack
-- Executing [8888@opinion:4] Set("Local/8888@opinion-ivr-00000002;2", "TIMEOUT(digit)=1") in new stack
-- Digit timeout set to 1.000
-- Executing [8888@opinion:5] ExecIf("Local/8888@opinion-ivr-00000002;2", "1?Background(en/beep)") in new stack
-- <Local/8888@opinion-ivr-00000002;2> Playing 'en/beep.alaw' (language 'en')
-- Executing [8888@opinion:6] WaitExten("Local/8888@opinion-ivr-00000002;2", "5,") in new stack
== CDR updated on Local/8888@opinion-ivr-00000002;2
-- Executing [1@opinion:1] MYSQL("Local/8888@opinion-ivr-00000002;2", "Connect connid localhost freepbxuser 123 asteriskcdrdb") in new stack
-- Executing [1@opinion:2] MYSQL("Local/8888@opinion-ivr-00000002;2", "Query resultid 1 INSERT INTO opinion (id,date,callerid,idasternumder,exten,queues,opinion) VALUES(NULL,"20131028-110035","87019650957","1382936423.9","","123412","1")") in new stack
-- Executing [1@opinion:3] MYSQL("Local/8888@opinion-ivr-00000002;2", "Disconnect 1") in new stack
-- Executing [1@opinion:4] Playback("Local/8888@opinion-ivr-00000002;2", "custom/fidel,skip") in new stack
[2013-10-28 11:00:35] WARNING[4172][C-00000001]: mp3/interface.c:216 decodeMP3: Junk at the beginning of frame efbbbf49
-- <Local/8888@opinion-ivr-00000002;2> Playing 'custom/fidel.slin' (language 'en')
Packet timed out after 32000ms with no response
-- Executing [h@ext-queues:1] Macro("SIP/FirstTrunk-00000003", "hangupcall,") in new stack
-- Executing [s@macro-hangupcall:1] GotoIf("SIP/FirstTrunk-00000003", "1?theend") in new stack
-- Goto (macro-hangupcall,s,3)
-- Executing [s@macro-hangupcall:3] ExecIf("SIP/FirstTrunk-00000003", "0?Set(CDR(recordingfile)=)") in new stack
-- Executing [s@macro-hangupcall:4] Hangup("SIP/FirstTrunk-00000003", "") in new stack
== Spawn extension (macro-hangupcall, s, 4) exited non-zero on 'SIP/FirstTrunk-00000003' in macro 'hangupcall'
== Spawn extension (ext-queues, h, 1) exited non-zero on 'SIP/FirstTrunk-00000003'
== Spawn extension (opinion, 1, 4) exited non-zero on 'Local/8888@opinion-ivr-00000002;2'
== Spawn extension (ext-queues, 123412, 38) exited non-zero on 'SIP/FirstTrunk-00000003'
Понятное дело, это не правильно, да и выглядит нахально! xD Мелких вариантов на исправление этого в голове много, но какой был бы более верным... Не подскажите как лучше решить эту проблему?