Откуда мы тут получаем переменную pin ? Откуда * знает что в ней должен содержаться значение поля pin из базы SQL ?
вроде переменная pin запрашивается из таблицы SQL
Код: Выделить всё
-- Executing [s@fromgorod:3] MYSQL("SIP/call-inband-outband-0000005d", "Connect connid localhost asterisk passwordMysqlasterisk") in new stack
-- Executing [s@fromgorod:4] MYSQL("SIP/call-inband-outband-0000005d", "Query resultid 1 select pin, callback from callback where phone=06XXXXXXXX") in new stack
-- Executing [s@fromgorod:5] MYSQL("SIP/call-inband-outband-0000005d", "Fetch fetchid 2 pin callback") in new stack
-- Executing [s@fromgorod:6] NoOp("SIP/call-inband-outband-0000005d", "pin -> 3212 callback# -> 06XXXXXXXX") in new stack
дело в том что без callback в ivr-pass, с прежней конфигурацией SQL и без выполнения скрипта .call то есть с такой конфигурацией:
Код: Выделить всё
mysql> SELECT * FROM callback WHERE 1;
+------------+------+----------+-------+
| phone | pin | callback | user |
+------------+------+----------+-------+
| 06XXXXXXXX | 3212 | 0 | Vitas |
+------------+------+----------+-------+
Код: Выделить всё
[ivr-pass]
exten => s,1,Background(/var/lib/asterisk/sounds/ru/dir-welcome)
exten => s,n,WaitExten(10)
exten => _XXXX,1,GoToIf($["${EXTEN}" = "${pin}"]?ivr,s,1)
exten => _XXXX,n,Hangup
exten => t,1,Hangup
exten => i,1,Hangup
extension.conf
Код: Выделить всё
[ivr]
exten => s,1,Set(inum=0)
exten => s,n,Set(tnum=0)
exten => s,n,Background(/var/lib/asterisk/sounds/ru/dir-welcome)
exten => s,n,WaitExten(10)
exten => 1,1,GoTo(ivr-out,s,1)
exten => 2,1,GoTo(ivr-ch-pin,s,1)
exten => i,1,Playback(pbx-invalid)
exten => i,n,Set(inum=$[${inum} + 1])
exten => i,n,GotoIf($["${inum}" < "3"]?s,1)
exten => i,n,Hangup()
exten => t,1,Set(tnum=$[${tnum} + 1])
exten => t,n,GotoIf($["${tnum}" < "3"]?s,1)
exten => t,n,Hangup()
[ivr-out]
exten => s,1,Set(inum=0)
exten => s,n,Set(tnum=0)
exten => s,n,Background(beep)
exten => s,n,WaitExten(10)
exten => _0[1-6]XXXXXXXX,1,Dial(SIP/call-inband-outband/${EXTEN})
exten => _01XXXXXXXX,n,Hangup
;exten => 01XXXXXXXX,1,Dial(SIP/bla2/${EXTEN}
;exten => 01XXXXXXXX ,n,Hangup
;exten => 8[2-8]XXXXXXXXX,1,Dial(SIP/blabla3/${EXTEN}
;exten => 8[2-8]XXXXXXXXX ,n,Hangup
exten => i,1,Playback(pbx-invalid)
exten => i,n,Set(inum=$[${inum} + 1])
exten => i,n,GotoIf($["${inum}" < "3"]?s,1)
exten => i,n,Hangup()
exten => t,1,Set(tnum=$[${tnum} + 1])
exten => t,n,GotoIf($["${tnum}" < "3"]?s,1)
exten => t,n,Hangup()
работает. > звоню на SIP, * отвечает и проигрывает /var/lib/asterisk/sounds/ru/dir-welcome, я ввожу свой pin опять воспроизводится /var/lib/asterisk/sounds/ru/dir-welcome жму на 1, появляется гудок и набираю номер из контекста ivr-out > разговариваю...
CLI>
Код: Выделить всё
== Using SIP RTP CoS mark 5
-- Executing [s@fromgorod:1] NoOp("SIP/call-inband-outband-00000060", " "06XXXXXXXXX" <06XXXXXXXXX>") in new stack
-- Executing [s@fromgorod:2] NoOp("SIP/call-inband-outband-00000060", "29.12.2015-01:17:42") in new stack
-- Executing [s@fromgorod:3] MYSQL("SIP/call-inband-outband-00000060", "Connect connid localhost asterisk passwordMysql asterisk") in new stack
-- Executing [s@fromgorod:4] MYSQL("SIP/call-inband-outband-00000060", "Query resultid 1 select pin, callback from callback where phone=06XXXXXXXXX") in new stack
-- Executing [s@fromgorod:5] MYSQL("SIP/call-inband-outband-00000060", "Fetch fetchid 2 pin callback") in new stack
-- Executing [s@fromgorod:6] NoOp("SIP/call-inband-outband-00000060", "pin -> 3212 callback# -> 0") in new stack
-- Executing [s@fromgorod:7] MYSQL("SIP/call-inband-outband-00000060", "Clear 2") in new stack
-- Executing [s@fromgorod:8] MYSQL("SIP/call-inband-outband-00000060", "Disconnect 1") in new stack
-- Executing [s@fromgorod:9] GotoIf("SIP/call-inband-outband-00000060", "1?ivr-pass,s,1") in new stack
-- Goto (ivr-pass,s,1)
-- Executing [s@ivr-pass:1] GotoIf("SIP/call-inband-outband-00000060", "0?callback,s,1") in new stack
-- Executing [s@ivr-pass:2] BackGround("SIP/call-inband-outband-00000060", "/var/lib/asterisk/sounds/ru/dir-welcome") in new stack
-- <SIP/call-inband-outband-00000060> Playing '/var/lib/asterisk/sounds/ru/dir-welcome.alaw' (language 'en')
-- Executing [s@ivr-pass:3] WaitExten("SIP/call-inband-outband-00000060", "10") in new stack
== CDR updated on SIP/call-inband-outband-00000060
-- Executing [3212@ivr-pass:1] GotoIf("SIP/call-inband-outband-00000060", "1?ivr,s,1") in new stack
-- Goto (ivr,s,1)
-- Executing [s@ivr:1] Set("SIP/call-inband-outband-00000060", "inum=0") in new stack
-- Executing [s@ivr:2] Set("SIP/call-inband-outband-00000060", "tnum=0") in new stack
-- Executing [s@ivr:3] BackGround("SIP/call-inband-outband-00000060", "/var/lib/asterisk/sounds/ru/dir-welcome") in new stack
-- <SIP/call-inband-outband-00000060> Playing '/var/lib/asterisk/sounds/ru/dir-welcome.alaw' (language 'en')
-- Executing [s@ivr:4] WaitExten("SIP/call-inband-outband-00000060", "10") in new stack
== CDR updated on SIP/call-inband-outband-00000060
-- Executing [1@ivr:1] Goto("SIP/call-inband-outband-00000060", "ivr-out,s,1") in new stack
-- Goto (ivr-out,s,1)
-- Executing [s@ivr-out:1] Set("SIP/call-inband-outband-00000060", "inum=0") in new stack
-- Executing [s@ivr-out:2] Set("SIP/call-inband-outband-00000060", "tnum=0") in new stack
-- Executing [s@ivr-out:3] BackGround("SIP/call-inband-outband-00000060", "beep") in new stack
-- <SIP/call-inband-outband-00000060> Playing 'beep.gsm' (language 'en')
-- Executing [s@ivr-out:4] WaitExten("SIP/call-inband-outband-00000060", "10") in new stack
== CDR updated on SIP/call-inband-outband-00000060
-- Executing [01XXXXXXXX@ivr-out:1] Dial("SIP/call-inband-outband-00000060", "SIP/call-inband-outband/01XXXXXXXX") in new stack
== Using SIP RTP CoS mark 5
-- Called SIP/call-inband-outband/01XXXXXXXX
-- SIP/call-inband-outband-00000061 is ringing
-- SIP/call-inband-outband-00000061 is making progress passing it to SIP/call-inband-outband-00000060
-- SIP/call-inband-outband-00000061 answered SIP/call-inband-outband-00000060
-- Remotely bridging SIP/call-inband-outband-00000060 and SIP/call-inband-outband-00000061
== Spawn extension (ivr-out, 01XXXXXXXX, 1) exited non-zero on 'SIP/call-inband-outband-00000060
получается с изменением таблицы SQL и включением callback > callaback работает а перехода в контекст ivr нет и как только ввожу pin > * срывает линию
конфигурация с изменением в SQL
Код: Выделить всё
mysql> SELECT * FROM callback WHERE 1;
+------------+------+------------+-------+
| phone | pin | callback | user |
+------------+------+------------+-------+
| 06XXXXXXXX| 3212 | 06XXXXXXXX | Vitas |
+------------+------+------------+-------+
Код: Выделить всё
[ivr-pass]
exten => s,1,GoToIf($["${callback}" != "0"]?callback,s,1)
exten => s,n,Background(/var/lib/asterisk/sounds/ru/dir-welcome) ;
exten => s,n,WaitExten(10)
exten => _XXXX,1,GoToIf($["${EXTEN}" = "${pin}"]?ivr,s,1)
exten => _XXXX,n,Hangup
exten => t,1,Hangup
exten => i,1,Hangup
Код: Выделить всё
== Using SIP RTP CoS mark 5
-- Executing [s@fromgorod:1] NoOp("SIP/call-inband-outband-00000046", " "06XXXXXXXXX" <06XXXXXXXXX>") in new stack
-- Executing [s@fromgorod:2] NoOp("SIP/call-inband-outband-00000046", "28.12.2015-23:19:43") in new stack
-- Executing [s@fromgorod:3] MYSQL("SIP/call-inband-outband-00000046", "Connect connid localhost asterisk passwordMysql asterisk") in new stack
-- Executing [s@fromgorod:4] MYSQL("SIP/call-inband-outband-00000046", "Query resultid 1 select pin, callback from callback where phone=06XXXXXXXXX") in new stack
-- Executing [s@fromgorod:5] MYSQL("SIP/call-inband-outband-00000046", "Fetch fetchid 2 pin callback") in new stack
-- Executing [s@fromgorod:6] NoOp("SIP/call-inband-outband-00000046", "pin -> 3212 callback# -> 06XXXXXXXXX") in new stack
-- Executing [s@fromgorod:7] MYSQL("SIP/call-inband-outband-00000046", "Clear 2") in new stack
-- Executing [s@fromgorod:8] MYSQL("SIP/call-inband-outband-00000046", "Disconnect 1") in new stack
-- Executing [s@fromgorod:9] GotoIf("SIP/call-inband-outband-00000046", "1?ivr-pass,s,1") in new stack
-- Goto (ivr-pass,s,1)
-- Executing [s@ivr-pass:1] GotoIf("SIP/call-inband-outband-00000046", "1?callback,s,1") in new stack
-- Goto (callback,s,1)
-- Executing [s@callback:1] AGI("SIP/call-inband-outband-00000046", "/usr/share/asterisk/agi-bin/callback.agi,06XXXXXXXXX,1451344783.146") in new stack
-- Launched AGI Script /usr/share/asterisk/agi-bin/callback.agi
-- Attempting call on Dongle/dongle0/06XXXXXXXXX for s@ivr-pass:2 (Retry 1)
-- <SIP/call-inband-outband-00000046>AGI Script /usr/share/asterisk/agi-bin/callback.agi completed, returning 0
-- Executing [s@callback:2] Hangup("SIP/call-inband-outband-00000046", "") in new stack
== Spawn extension (callback, s, 2) exited non-zero on 'SIP/call-inband-outband-00000046'
-- Executing [s@ivr-pass:2] BackGround("Dongle/dongle0-010000004c", "/var/lib/asterisk/sounds/ru/dir-welcome") in new stack
-- <Dongle/dongle0-010000004c> Playing '/var/lib/asterisk/sounds/ru/dir-welcome.alaw' (language 'en')
-- Executing [s@ivr-pass:3] WaitExten("Dongle/dongle0-010000004c", "10") in new stack
== CDR updated on Dongle/dongle0-010000004c
-- Executing [3212@ivr-pass:1] GotoIf("Dongle/dongle0-010000004c", "0?ivr,s,1") in new stack
-- Executing [3212@ivr-pass:2] Hangup("Dongle/dongle0-010000004c", "") in new stack
== Spawn extension (ivr-pass, 3212, 2) exited non-zero on 'Dongle/dongle0-010000004c'
[Dec 28 23:20:02] NOTICE[4199]: pbx_spool.c:402 attempt_thread: Call completed to Dongle/dongle0/06XXXXXXXXX
В чем же тут может быть проблема никак не пойму ...
приметил что при переходе с ivr-pass в ivr, вижу такую строку
Код: Выделить всё
-- Executing [3212@ivr-pass:1] GotoIf("SIP/call-inband-outband-00000060", "1?ivr,s,1") in new stack
-- Goto (ivr,s,1)
-- Executing [s@ivr:1] Set("SIP/call-inband-outband-00000060", "inum=0") in new stack
-- Executing [s@ivr:2] Set("SIP/call-inband-outband-00000060", "tnum=0") in new stack
-- Executing [s@ivr:3] BackGround("SIP/call-inband-outband-00000060", "/var/lib/asterisk/sounds/ru/dir-welcome") in new stack
а вот когда перехода нет
Код: Выделить всё
-- Executing [3212@ivr-pass:1] GotoIf("Dongle/dongle0-010000004c", "0?ivr,s,1") in new stack
-- Executing [3212@ivr-pass:2] Hangup("Dongle/dongle0-010000004c", "") in new stack
== Spawn extension (ivr-pass, 3212, 2) exited non-zero on 'Dongle/dongle0-010000004c'
[Dec 28 23:20:02] NOTICE[4199]: pbx_spool.c:402 attempt_thread: Call completed to Dongle/dongle0/06XXXXXXXX
перед ?ivr стоит или 1 или 0 при каких обстоятельствах эти значения меняются