What I am doing is get an incoming call and write uniqid and caller id to db. After that another process writes a redırectıon number to db.After that redirect number ıs selected from the db and call is redırected to that number.
This is the full log.
localhostCLI>
localhostCLI>
localhostCLI>
localhostCLI>
localhostCLI>
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
== Extension Changed 6001[ext-local] new state InUse for Notify User 8000
– Executing [00442030269224@from-internal:1] Macro(“SIP/6001-0000000f”, “user-callerid,SKIPTTL,”) in new stack
– Executing [s@macro-user-callerid:1] Set(“SIP/6001-0000000f”, “AMPUSER=6001”) in new stack
– Executing [s@macro-user-callerid:2] GotoIf(“SIP/6001-0000000f”, “0?report”) in new stack
– Executing [s@macro-user-callerid:3] ExecIf(“SIP/6001-0000000f”, “1?Set(REALCALLERIDNUM=6001)”) in new stack
– Executing [s@macro-user-callerid:4] Set(“SIP/6001-0000000f”, “AMPUSER=6001”) in new stack
– Executing [s@macro-user-callerid:5] Set(“SIP/6001-0000000f”, “AMPUSERCIDNAME=6001”) in new stack
– Executing [s@macro-user-callerid:6] GotoIf(“SIP/6001-0000000f”, “0?report”) in new stack
– Executing [s@macro-user-callerid:7] Set(“SIP/6001-0000000f”, “AMPUSERCID=6001”) in new stack
– Executing [s@macro-user-callerid:8] Set(“SIP/6001-0000000f”, “CALLERID(all)=“6001” <6001>”) in new stack
– Executing [s@macro-user-callerid:9] GotoIf(“SIP/6001-0000000f”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,18)
– Executing [s@macro-user-callerid:18] NoOp(“SIP/6001-0000000f”, “Using CallerID “6001” <6001>”) in new stack
– Executing [00442030269224@from-internal:2] Set(“SIP/6001-0000000f”, “_NODEST=”) in new stack
– Executing [00442030269224@from-internal:3] Macro(“SIP/6001-0000000f”, “record-enable,6001,OUT,”) in new stack
– Executing [s@macro-record-enable:1] GotoIf(“SIP/6001-0000000f”, “1?check”) in new stack
– Goto (macro-record-enable,s,4)
– Executing [s@macro-record-enable:4] ExecIf(“SIP/6001-0000000f”, “0?MacroExit()”) in new stack
– Executing [s@macro-record-enable:5] GotoIf(“SIP/6001-0000000f”, “0?Group:OUT”) in new stack
– Goto (macro-record-enable,s,16)
– Executing [s@macro-record-enable:16] GotoIf(“SIP/6001-0000000f”, “0?IN”) in new stack
– Executing [s@macro-record-enable:17] ExecIf(“SIP/6001-0000000f”, “1?MacroExit()”) in new stack
– Executing [00442030269224@from-internal:4] Macro(“SIP/6001-0000000f”, “dialout-trunk,2,00442030269224,”) in new stack
– Executing [s@macro-dialout-trunk:1] Set(“SIP/6001-0000000f”, “DIAL_TRUNK=2”) in new stack
– Executing [s@macro-dialout-trunk:2] GosubIf(“SIP/6001-0000000f”, “0?sub-pincheck,s,1”) in new stack
– Executing [s@macro-dialout-trunk:3] GotoIf(“SIP/6001-0000000f”, “0?disabletrunk,1”) in new stack
– Executing [s@macro-dialout-trunk:4] Set(“SIP/6001-0000000f”, “DIAL_NUMBER=00442030269224”) in new stack
– Executing [s@macro-dialout-trunk:5] Set(“SIP/6001-0000000f”, “DIAL_TRUNK_OPTIONS=tr”) in new stack
– Executing [s@macro-dialout-trunk:6] Set(“SIP/6001-0000000f”, “OUTBOUND_GROUP=OUT_2”) in new stack
– Executing [s@macro-dialout-trunk:7] GotoIf(“SIP/6001-0000000f”, “0?nomax”) in new stack
– Executing [s@macro-dialout-trunk:8] GotoIf(“SIP/6001-0000000f”, “0?chanfull”) in new stack
– Executing [s@macro-dialout-trunk:9] GotoIf(“SIP/6001-0000000f”, “0?skipoutcid”) in new stack
– Executing [s@macro-dialout-trunk:10] Set(“SIP/6001-0000000f”, “DIAL_TRUNK_OPTIONS=”) in new stack
– Executing [s@macro-dialout-trunk:11] Macro(“SIP/6001-0000000f”, “outbound-callerid,2”) in new stack
– Executing [s@macro-outbound-callerid:1] ExecIf(“SIP/6001-0000000f”, “0?Set(CALLERPRES()=)”) in new stack
– Executing [s@macro-outbound-callerid:2] ExecIf(“SIP/6001-0000000f”, “0?Set(REALCALLERIDNUM=6001)”) in new stack
– Executing [s@macro-outbound-callerid:3] GotoIf(“SIP/6001-0000000f”, “1?normcid”) in new stack
– Goto (macro-outbound-callerid,s,6)
– Executing [s@macro-outbound-callerid:6] Set(“SIP/6001-0000000f”, “USEROUTCID=6001”) in new stack
– Executing [s@macro-outbound-callerid:7] Set(“SIP/6001-0000000f”, “EMERGENCYCID=”) in new stack
– Executing [s@macro-outbound-callerid:8] Set(“SIP/6001-0000000f”, “TRUNKOUTCID=”) in new stack
– Executing [s@macro-outbound-callerid:9] GotoIf(“SIP/6001-0000000f”, “1?trunkcid”) in new stack
– Goto (macro-outbound-callerid,s,12)
– Executing [s@macro-outbound-callerid:12] ExecIf(“SIP/6001-0000000f”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [s@macro-outbound-callerid:13] ExecIf(“SIP/6001-0000000f”, “1?Set(CALLERID(all)=6001)”) in new stack
– Executing [s@macro-outbound-callerid:14] ExecIf(“SIP/6001-0000000f”, “0?Set(CALLERID(all)=)”) in new stack
– Executing [s@macro-outbound-callerid:15] ExecIf(“SIP/6001-0000000f”, “0?Set(CALLERPRES()=prohib_passed_screen)”) in new stack
– Executing [s@macro-dialout-trunk:12] ExecIf(“SIP/6001-0000000f”, “0?AGI(fixlocalprefix)”) in new stack
– Executing [s@macro-dialout-trunk:13] Set(“SIP/6001-0000000f”, “OUTNUM=00442030269224”) in new stack
– Executing [s@macro-dialout-trunk:14] Set(“SIP/6001-0000000f”, “custom=SIP/mydivert”) in new stack
– Executing [s@macro-dialout-trunk:15] ExecIf(“SIP/6001-0000000f”, “0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^))”) in new stack
– Executing [s@macro-dialout-trunk:16] Macro(“SIP/6001-0000000f”, “dialout-trunk-predial-hook,”) in new stack
– Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit(“SIP/6001-0000000f”, “”) in new stack
– Executing [s@macro-dialout-trunk:17] GotoIf(“SIP/6001-0000000f”, “0?bypass,1”) in new stack
– Executing [s@macro-dialout-trunk:18] GotoIf(“SIP/6001-0000000f”, “0?customtrunk”) in new stack
– Executing [s@macro-dialout-trunk:19] Dial(“SIP/6001-0000000f”, “SIP/mydivert/00442030269224,300,”) in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Called mydivert/00442030269224
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Executing [6001@from-sip-external:1] NoOp(“SIP/78.46.42.74-00000011”, “Received incoming SIP connection from unknown peer to 6001”) in new stack
– Executing [6001@from-sip-external:2] Set(“SIP/78.46.42.74-00000011”, “DID=6001”) in new stack
– Executing [6001@from-sip-external:3] Goto(“SIP/78.46.42.74-00000011”, “s,1”) in new stack
– Goto (from-sip-external,s,1)
– Executing [s@from-sip-external:1] GotoIf(“SIP/78.46.42.74-00000011”, “1?checklang:noanonymous”) in new stack
– Goto (from-sip-external,s,2)
– Executing [s@from-sip-external:2] GotoIf(“SIP/78.46.42.74-00000011”, “0?setlanguage:from-trunk,6001,1”) in new stack
– Goto (from-trunk,6001,1)
– Executing [6001@from-trunk:1] Answer(“SIP/78.46.42.74-00000011”, “1”) in new stack
– SIP/mydivert-00000010 is ringing
– SIP/mydivert-00000010 answered SIP/6001-0000000f
– Packet2Packet bridging SIP/6001-0000000f and SIP/mydivert-00000010
– Executing [6001@from-trunk:2] Set(“SIP/78.46.42.74-00000011”, “_DB_UNIQCALLID=1293421225.17”) in new stack
– Executing [6001@from-trunk:3] Set(“SIP/78.46.42.74-00000011”, “_CALLERID=02030269224”) in new stack
– Executing [6001@from-trunk:4] AGI(“SIP/78.46.42.74-00000011”, “agi://192.168.0.22:9110/DatabaseQuery.agi?db=mysql&callbackApp=Gosub&query=YAZ+CALLID+CALLERNAME&callback=&as=192.168.0.120”) in new stack
== Manager ‘is_user’ logged on from 192.168.0.22
– <SIP/78.46.42.74-00000011>AGI Script agi://192.168.0.22:9110/DatabaseQuery.agi?db=mysql&callbackApp=Gosub&query=YAZ+CALLID+CALLERNAME&callback=&as=192.168.0.120 completed, returning 0
– Executing [6001@from-trunk:5] Playback(“SIP/78.46.42.74-00000011”, “dir-intro-fnln”) in new stack
– <SIP/78.46.42.74-00000011> Playing ‘dir-intro-fnln.gsm’ (language ‘en’)
– Executing [6001@from-trunk:6] AGI(“SIP/78.46.42.74-00000011”, “agi://192.168.0.22:9110/DatabaseQuery.agi?vars=YONLEN_BIT&db=mysql&query=yonlen+bit+sorgu&as=192.168.0.120”) in new stack
– <SIP/78.46.42.74-00000011>AGI Script agi://192.168.0.22:9110/DatabaseQuery.agi?vars=YONLEN_BIT&db=mysql&query=yonlen+bit+sorgu&as=192.168.0.120 completed, returning 0
– Executing [6001@from-trunk:7] GotoIf(“SIP/78.46.42.74-00000011”, “1?:lbl_vdp-inbound_0”) in new stack
– Executing [6001@from-trunk:8] AGI(“SIP/78.46.42.74-00000011”, “agi://192.168.0.22:9110/DatabaseQuery.agi?vars=YONLEN_NUM&db=mysql&query=yonlennum+ceken+redirecte+veren&as=192.168.0.120”) in new stack
– <SIP/78.46.42.74-00000011>AGI Script agi://192.168.0.22:9110/DatabaseQuery.agi?vars=YONLEN_NUM&db=mysql&query=yonlennum+ceken+redirecte+veren&as=192.168.0.120 completed, returning 0
– Executing [6001@from-trunk:9] Transfer(“SIP/78.46.42.74-00000011”, “SIP/8000”) in new stack
– Executing [6001@from-trunk:10] Hangup(“SIP/78.46.42.74-00000011”, “”) in new stack
== Spawn extension (from-trunk, 6001, 10) exited non-zero on ‘SIP/78.46.42.74-00000011’
– Executing [h@from-trunk:1] NoOp(“SIP/78.46.42.74-00000011”, “Catch-All DID Match - Found h - You probably want a DID for this.”) in new stack
– Executing [h@from-trunk:2] Goto(“SIP/78.46.42.74-00000011”, “ext-did,s,1”) in new stack
– Goto (ext-did,s,1)
– Executing [s@ext-did:1] Set(“SIP/78.46.42.74-00000011”, “__FROM_DID=s”) in new stack
– Executing [s@ext-did:2] ExecIf(“SIP/78.46.42.74-00000011”, “0 ?Set(CALLERID(name)=02030269224)”) in new stack
– Executing [s@ext-did:3] Set(“SIP/78.46.42.74-00000011”, “__CALLINGPRES_SV=allowed_not_screened”) in new stack
– Executing [s@ext-did:4] Set(“SIP/78.46.42.74-00000011”, “CALLERPRES()=allowed_not_screened”) in new stack
– Executing [s@ext-did:5] Goto(“SIP/78.46.42.74-00000011”, “app-blackhole,hangup,1”) in new stack
– Goto (app-blackhole,hangup,1)
– Executing [hangup@app-blackhole:1] NoOp(“SIP/78.46.42.74-00000011”, “Blackhole Dest: Hangup”) in new stack
– Executing [hangup@app-blackhole:2] Hangup(“SIP/78.46.42.74-00000011”, “”) in new stack
== Spawn extension (app-blackhole, hangup, 2) exited non-zero on ‘SIP/78.46.42.74-00000011’
== Manager ‘is_user’ logged off from 192.168.0.22
– Executing [h@macro-dialout-trunk:1] Macro(“SIP/6001-0000000f”, “hangupcall,”) in new stack
– Executing [s@macro-hangupcall:1] GotoIf(“SIP/6001-0000000f”, “1?skiprg”) in new stack
– Goto (macro-hangupcall,s,4)
– Executing [s@macro-hangupcall:4] GotoIf(“SIP/6001-0000000f”, “1?skipblkvm”) in new stack
– Goto (macro-hangupcall,s,7)
– Executing [s@macro-hangupcall:7] GotoIf(“SIP/6001-0000000f”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,9)
– Executing [s@macro-hangupcall:9] Hangup(“SIP/6001-0000000f”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 9) exited non-zero on ‘SIP/6001-0000000f’ in macro ‘hangupcall’
== Spawn extension (macro-dialout-trunk, h, 1) exited non-zero on ‘SIP/6001-0000000f’
== Spawn extension (macro-dialout-trunk, s, 19) exited non-zero on ‘SIP/6001-0000000f’ in macro ‘dialout-trunk’
== Spawn extension (from-internal, 00442030269224, 4) exited non-zero on ‘SIP/6001-0000000f’
– Executing [h@from-internal:1] Macro(“SIP/6001-0000000f”, “hangupcall”) in new stack
– Executing [s@macro-hangupcall:1] GotoIf(“SIP/6001-0000000f”, “1?skiprg”) in new stack
– Goto (macro-hangupcall,s,4)
– Executing [s@macro-hangupcall:4] GotoIf(“SIP/6001-0000000f”, “1?skipblkvm”) in new stack
– Goto (macro-hangupcall,s,7)
– Executing [s@macro-hangupcall:7] GotoIf(“SIP/6001-0000000f”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,9)
– Executing [s@macro-hangupcall:9] Hangup(“SIP/6001-0000000f”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 9) exited non-zero on ‘SIP/6001-0000000f’ in macro ‘hangupcall’
== Spawn extension (from-internal, h, 1) exited non-zero on ‘SIP/6001-0000000f’
== Extension Changed 6001[ext-local] new state Idle for Notify User 8000
localhostCLI>