Need unique events for each dial attempt consisting caller number and dialed pattern


(Wolk) #1

Hello all.

I’m using Asterisk 16.6.2 and FreePBX 15.0.16.44.

What I need is a possibility to monitor each dial attempt (even if an internal user tries to dial a number or feature code, such as incoming calls from trunk) with a unique verbose output in real time like ‘[NUMBER_1] has called [NUBER_2]’.
Ideal would be if I could generate a custom event for the REST API because it’s what I hope to achieve finally…

What I tried to do was simple adding an app string for Verbose() or NoOp() to the extensions_custom.conf in the [from-internal] context as follows:
exten => _[*#0-9]!,1,Verbose(Attention: ${CALLERID(num)} has dialed ${CALLERID(dnid)}!)

I tried it also with ‘exten => _[*#0-9].’, exten => _.’, ‘exten => _X!’ and ‘exten => _X.’, but always with the same result:

I’m also using paging and paging groups with the noncommercial Paging and Intercom module - and after adding this line all worked perfectly (including the verbose output), but paging groups stop working - even if I try to call an intercom device directly all is OK, but if I try to call a paging group the routing goes to an external trunk and hangs there…

Any help would be appreciated!

This is currently the content of my extensions_custom.conf:
[from-internal]
_exten => [*#0-9]!,1,Verbose(Attention: ${CALLERID(num)} has dialed ${CALLERID(dnid)}!)

[from-internal-custom]
include => custom_1
include => custom_2

exten => *724,1,Originate(Local/360@from-internal,exten,message-1,s,1)
_ same => n,Playback(beep)_
_ same => n,HangUp()_

exten => *725,1,Originate(Local/360@from-internal,exten,morse-1,s,1)
_ same => n,Playback(beep)_
_ same => n,HangUp()_

exten => *726,1,Originate(Local/360@from-internal,exten,time-1,s,1)
_ same => n,Playback(beep)_
_ same => n,HangUp()_

exten => *727,1,Originate(Local/360@from-internal,exten,sos-1,s,1)
_ same => n,Playback(beep)_
_ same => n,HangUp()_

exten => *728,1,Originate(Local/360@from-internal,exten,ip-1,s,1)
_ same => n,Playback(beep)_
_ same => n,HangUp()_

exten => *729,1,Originate(Local/360@from-internal,exten,voice-announce,s,1)
_ same => n,Playback(beep)_
_ same => n,HangUp()_

exten => *730,1,Answer()
exten => *730,n,Festival(‘The I P address of your IPPBX is 10.10.40.254’)
exten => *730,n,Hangup

exten => *731,1,Verbose(2,Performing Festival test)
_ same => n,Answer()_
_ same => n,System(echo “We are now doing Festival Test after successful installation” | /usr/bin/text2wave -scale 1.5 -F 8000 -o /tmp/test.wav)_
_ same => n,Playback(/tmp/test)_
_ same => n,System(rm -f /tmp/test.wav)_
_ same => n,Hangup()_

exten => *732,1,Originate(Local/360@from-internal,app,Festival,‘The I P address of your IPPBX is 10.10.40.254’)
_ same => n,Playback(beep)_
_ same => n,HangUp()_

exten => *733,1,Originate(Local/360@from-internal,exten,voice-file,s,1)
_ same => n,Playback(beep)_
_ same => n,HangUp()_

exten => *734,1,Originate(Local/360@from-internal,app,Playback,custom/message-24)
_ same => n,Playback(beep)_
_ same => n,HangUp()_

exten => *735,1,Originate(Local/360@from-internal,exten,from-internal,*501,1)
_ same => n,Playback(beep)_
_ same => n,HangUp()_

exten => 666,1,Macro(user-callerid)
_ same => n,Read(SPYNUM,agent-newlocation)_
_ same => n,ChanSpy(SIP/${SPYNUM},q)_
_ same => n,Hangup()_

exten => 667,1,Macro(user-callerid)
_ same => n,Read(SPYNUM,agent-newlocation)_
_ same => n,ExtenSpy(SIP/${SPYNUM},q)_
_ same => n,Hangup()_

exten => 980,1,Park()
_exten => 98Z,1,ParkedCall(${EXTEN})

exten => *20,1,ChanIsAvail(SIP/200,as)
exten => *20,n,NoOp(${AVAILSTATUS})
exten => *20,n,GotoIf($["${AVAILSTATUS}" =~ “2”]?busy:call)
exten => *20,n(call),Dial(SIP/200,3)
exten => *20,n(unavail),Park(custom_1,r|s|c(from-internal-custom,*20,1))
exten => *20,n,Hangup()
exten => *20,n(busy),Park(custom_1,r|s|c(from-internal-custom,*20,1))
exten => *20,n,Hangup()

exten => 990,1,Park()
_exten => 99Z,1,ParkedCall(${EXTEN})

exten => *22,hint,park:981@custom_1&park:982@custom_1&park:983@custom_1&park:984@custom_1&park:985@custom_1&park:986@custom_1&park:987@custom_1&park:988@custom_1&park:989@custom_1

exten => *22,1,ParkedCall(custom_1)

[message-1]
exten => s,1,Answer()
_ same => n,Wait(2)_
_ same => n,Playback(custom/message-24)_
_ same => n,Hangup()_

[morse-1]
exten => s,1,Answer()
_ same => n,Wait(2)_
_ same => n,Morsecode(“SOS”)_
_ same => n,Hangup()_

[time-1]
exten => s,1,Answer()
_ same => n,Wait(2)_
_ same => n,DateTime()_
_ same => n,Hangup()_

[sos-1]
exten => s,1,Answer()
_ same => n,Wait(2)_
_ same => n,SayAlpha(SOS)_
_ same => n,Wait(2)_
_ same => n,SayAlpha(SOS)_
_ same => n,Hangup()_

[ip-1]
exten => s,1,Answer()
_ same => n,Wait(2)_
_ same => n,SayAlpha(PBX)_
_ same => n,Wait(1)_
_ same => n,SayAlpha(IP)_
_ same => n,Wait(1)_
_ same => n,SayNumber(10)_
_ same => n,SayAlpha(.)_
_ same => n,SayNumber(10)_
_ same => n,SayAlpha(.)_
_ same => n,SayNumber(40)_
_ same => n,SayAlpha(.)_
_ same => n,SayNumber(254)_
_ same => n,Hangup()_

[voice-announce]
exten => s,1,Answer()
_ same => n,Wait(2)_
_ same => n,Festival(‘The I P address of your IPPBX is 10.10.40.254’)_
_ same => n,Hangup()_

[voice-file]
exten => s,1,Verbose(2,Performing Festival test)
_ same => n,Answer()_
_ same => n,System(echo “We are now doing Festival Test after successful installation” | /usr/bin/text2wave -scale 1.5 -F 8000 -o /tmp/test.wav)_
_ same => n,Wait(2)_
_ same => n,Playback(/tmp/test)_
_ same => n,System(rm -f /tmp/test.wav)_
_ same => n,Hangup()_

And this is the output if I try to call a paging group:
Executing [360@from-internal:1] Verbose(“SIP/950-00000003”, “Attention: 950 has dialed 360!”) in new stack
Attention: 950 has dialed 360!
_ – Executing [360@from-internal:2] Gosub(“SIP/950-00000003”, “sub-record-check,s,1(out,360,no)”) in new stack_
_ – Executing [s@sub-record-check:1] GotoIf(“SIP/950-00000003”, “0?initialized”) in new stack_
_ – Executing [s@sub-record-check:2] Set(“SIP/950-00000003”, "REC_STATUS=INITIALIZED") in new stack
_ – Executing [s@sub-record-check:3] Set(“SIP/950-00000003”, “NOW=1584031558”) in new stack

_ – Executing [s@sub-record-check:4] Set(“SIP/950-00000003”, "DAY=12") in new stack
_ – Executing [s@sub-record-check:5] Set(“SIP/950-00000003”, "MONTH=03") in new stack
_ – Executing [s@sub-record-check:6] Set(“SIP/950-00000003”, "YEAR=2020") in new stack
_ – Executing [s@sub-record-check:7] Set(“SIP/950-00000003”, "TIMESTR=20200312-174558") in new stack
_ – Executing [s@sub-record-check:8] Set(“SIP/950-00000003”, "FROMEXTEN=unknown") in new stack
_ – Executing [s@sub-record-check:9] Set(“SIP/950-00000003”, "MON_FMT=wav") in new stack
_ – Executing [s@sub-record-check:10] NoOp(“SIP/950-00000003”, “Recordings initialized”) in new stack

_ – Executing [s@sub-record-check:11] ExecIf(“SIP/950-00000003”, “0?Set(ARG3=dontcare)”) in new stack

_ – Executing [s@sub-record-check:12] Set(“SIP/950-00000003”, “REC_POLICY_MODE_SAVE=”) in new stack

_ – Executing [s@sub-record-check:13] ExecIf(“SIP/950-00000003”, “0?Set(REC_STATUS=NO)”) in new stack

_ – Executing [s@sub-record-check:14] GotoIf(“SIP/950-00000003”, “3?checkaction”) in new stack

_ – Goto (sub-record-check,s,17)

_ – Executing [s@sub-record-check:17] GotoIf(“SIP/950-00000003”, “1?sub-record-check,out,1”) in new stack_
_ – Goto (sub-record-check,out,1)_
_ – Executing [out@sub-record-check:1] NoOp(“SIP/950-00000003”, “Outbound Recording Check from unknown to 360”) in new stack_
_ – Executing [out@sub-record-check:2] Set(“SIP/950-00000003”, “RECMODE=”) in new stack_
_ – Executing [out@sub-record-check:3] ExecIf(“SIP/950-00000003”, “1?Goto(routewins)”) in new stack_
_ – Goto (sub-record-check,out,7)_
_ – Executing [out@sub-record-check:7] Gosub(“SIP/950-00000003”, “recordcheck,1(no,out,360)”) in new stack_
_ – Executing [recordcheck@sub-record-check:1] NoOp(“SIP/950-00000003”, “Starting recording check against no”) in new stack_
_ – Executing [recordcheck@sub-record-check:2] Goto(“SIP/950-00000003”, “no”) in new stack_
_ – Goto (sub-record-check,recordcheck,12)_
_ – Executing [recordcheck@sub-record-check:12] Set(“SIP/950-00000003”, "REC_POLICY_MODE=NO") in new stack
_ – Executing [recordcheck@sub-record-check:13] Return(“SIP/950-00000003”, “”) in new stack

_ – Executing [out@sub-record-check:8] Return(“SIP/950-00000003”, “”) in new stack_
_ – Executing [360@from-internal:3] ExecIf(“SIP/950-00000003”, “0 ?Set(CDR(accountcode)=)”) in new stack_
_ – Executing [360@from-internal:4] Set(“SIP/950-00000003”, “MOHCLASS=default”) in new stack_
_ – Executing [360@from-internal:5] Set(“SIP/950-00000003”, "NODEST=") in new stack
_ – Executing [360@from-internal:6] Macro(“SIP/950-00000003”, “dialout-trunk,1,360,off”) in new stack_
_ – Executing [s@macro-dialout-trunk:1] Set(“SIP/950-00000003”, “DIAL_TRUNK=1”) in new stack_
_ – Executing [s@macro-dialout-trunk:2] ExecIf(“SIP/950-00000003”, “0?Set(DIAL_OPTIONS=Hhtr)”) in new stack_
_ – Executing [s@macro-dialout-trunk:3] GosubIf(“SIP/950-00000003”, “0?sub-pincheck,s,1()”) in new stack_
_ – Executing [s@macro-dialout-trunk:4] ExecIf(“SIP/950-00000003”, “0?Set(CALLERID(num)=)”) in new stack_
_ – Executing [s@macro-dialout-trunk:5] GotoIf(“SIP/950-00000003”, “0?disabletrunk,1”) in new stack_
_ – Executing [s@macro-dialout-trunk:6] Set(“SIP/950-00000003”, “DIAL_NUMBER=360”) in new stack_
_ – Executing [s@macro-dialout-trunk:7] Set(“SIP/950-00000003”, “DIAL_TRUNK_OPTIONS=HhTtr”) in new stack_
_ – Executing [s@macro-dialout-trunk:8] Set(“SIP/950-00000003”, “OUTBOUND_GROUP=OUT_1”) in new stack_
_ – Executing [s@macro-dialout-trunk:9] Set(“SIP/950-00000003”, “DIAL_TRUNK_OPTIONS=T”) in new stack_
_ – Executing [s@macro-dialout-trunk:10] GotoIf(“SIP/950-00000003”, “0?nomax”) in new stack_
_ – Executing [s@macro-dialout-trunk:11] GotoIf(“SIP/950-00000003”, “0?chanfull”) in new stack_
_ – Executing [s@macro-dialout-trunk:12] GotoIf(“SIP/950-00000003”, “0?skipoutcid”) in new stack_
_ – Executing [s@macro-dialout-trunk:13] Macro(“SIP/950-00000003”, “outbound-callerid,1”) in new stack_
_ – Executing [s@macro-outbound-callerid:1] NoOp(“SIP/950-00000003”, “”) in new stack_
_ – Executing [s@macro-outbound-callerid:2] NoOp(“SIP/950-00000003”, “”) in new stack_
_ – Executing [s@macro-outbound-callerid:3] NoOp(“SIP/950-00000003”, “off”) in new stack_
_ – Executing [s@macro-outbound-callerid:4] ExecIf(“SIP/950-00000003”, “0?Set(CALLERPRES(name-pres)=)”) in new stack_
_ – Executing [s@macro-outbound-callerid:5] ExecIf(“SIP/950-00000003”, “0?Set(CALLERPRES(num-pres)=)”) in new stack_
_ – Executing [s@macro-outbound-callerid:6] Set(“SIP/950-00000003”, “HOTDESCKCHAN=950-00000003”) in new stack_
_ – Executing [s@macro-outbound-callerid:7] Set(“SIP/950-00000003”, “HOTDESKEXTEN=950”) in new stack_
_ – Executing [s@macro-outbound-callerid:8] Set(“SIP/950-00000003”, “HOTDESKCALL=0”) in new stack_
_ – Executing [s@macro-outbound-callerid:9] ExecIf(“SIP/950-00000003”, “0?Set(HOTDESKCALL=1)”) in new stack_
_ – Executing [s@macro-outbound-callerid:10] ExecIf(“SIP/950-00000003”, “0?Set(CALLERID(name)=)”) in new stack_
_ – Executing [s@macro-outbound-callerid:11] Set(“SIP/950-00000003”, “ALLOWTHISROUTE=NO”) in new stack_
_ – Executing [s@macro-outbound-callerid:12] ExecIf(“SIP/950-00000003”, “0?Set(ALLOWTHISROUTE=YES)”) in new stack_
_ – Executing [s@macro-outbound-callerid:13] ExecIf(“SIP/950-00000003”, “0?Hangup()”) in new stack_
_ – Executing [s@macro-outbound-callerid:14] ExecIf(“SIP/950-00000003”, “1?Set(REALCALLERIDNUM=950)”) in new stack_
_ – Executing [s@macro-outbound-callerid:15] ExecIf(“SIP/950-00000003”, “0?Set(AMPUSER=unknown)”) in new stack_
_ – Executing [s@macro-outbound-callerid:16] GotoIf(“SIP/950-00000003”, “1?normcid”) in new stack_
_ – Goto (macro-outbound-callerid,s,20)_
_ – Executing [s@macro-outbound-callerid:20] Set(“SIP/950-00000003”, “USEROUTCID=”) in new stack_
_ – Executing [s@macro-outbound-callerid:21] Set(“SIP/950-00000003”, “EMERGENCYCID=”) in new stack_
_ – Executing [s@macro-outbound-callerid:22] ExecIf(“SIP/950-00000003”, “0?Set(EMERGENCYCID=)”) in new stack_
_ – Executing [s@macro-outbound-callerid:23] Set(“SIP/950-00000003”, “TRUNKOUTCID=+12345678901”) in new stack_
_ – Executing [s@macro-outbound-callerid:24] GotoIf(“SIP/950-00000003”, “1?trunkcid”) in new stack_
_ – Goto (macro-outbound-callerid,s,30)_
_ – Executing [s@macro-outbound-callerid:30] ExecIf(“SIP/950-00000003”, “1?Set(CALLERID(all)=+12345678901)”) in new stack_
_ – Executing [s@macro-outbound-callerid:31] ExecIf(“SIP/950-00000003”, “0?Set(CALLERID(all)=)”) in new stack_
_ – Executing [s@macro-outbound-callerid:32] ExecIf(“SIP/950-00000003”, “0?Set(CALLERID(all)=)”) in new stack_
_ – Executing [s@macro-outbound-callerid:33] ExecIf(“SIP/950-00000003”, “0?Set(CALLERID(all)=950)”) in new stack_
_ – Executing [s@macro-outbound-callerid:34] Set(“SIP/950-00000003”, “TIOHIDE=no”) in new stack_
_ – Executing [s@macro-outbound-callerid:35] ExecIf(“SIP/950-00000003”, “0?Set(CALLERPRES(name-pres)=prohib_passed_screen)”) in new stack_
_ – Executing [s@macro-outbound-callerid:36] ExecIf(“SIP/950-00000003”, “0?Set(CALLERPRES(num-pres)=prohib_passed_screen)”) in new stack_
_ – Executing [s@macro-outbound-callerid:37] ExecIf(“SIP/950-00000003”, “0?Set(CALLERPRES(name-pres)=prohib_passed_screen)”) in new stack_
_ – Executing [s@macro-outbound-callerid:38] ExecIf(“SIP/950-00000003”, “0?Set(CALLERPRES(num-pres)=prohib_passed_screen)”) in new stack_
_ – Executing [s@macro-outbound-callerid:39] Set(“SIP/950-00000003”, “CDR(outbound_cnum)=+12345678901”) in new stack_
_ – Executing [s@macro-outbound-callerid:40] Set(“SIP/950-00000003”, “CDR(outbound_cnam)=”) in new stack_
_ – Executing [s@macro-dialout-trunk:14] GosubIf(“SIP/950-00000003”, “0?sub-flp-1,s,1()”) in new stack_
_ – Executing [s@macro-dialout-trunk:15] Set(“SIP/950-00000003”, “OUTNUM=360”) in new stack_
_ – Executing [s@macro-dialout-trunk:16] Set(“SIP/950-00000003”, “custom=SIP/M-Net”) in new stack_
_ – Executing [s@macro-dialout-trunk:17] ExecIf(“SIP/950-00000003”, “0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)T)”) in new stack_
_ – Executing [s@macro-dialout-trunk:18] ExecIf(“SIP/950-00000003”, “0?Set(DIAL_TRUNK_OPTIONS=TM(confirm))”) in new stack_
_ – Executing [s@macro-dialout-trunk:19] Macro(“SIP/950-00000003”, “dialout-trunk-predial-hook,”) in new stack_
_ – Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit(“SIP/950-00000003”, “”) in new stack_
_ – Executing [s@macro-dialout-trunk:20] GotoIf(“SIP/950-00000003”, “0?bypass,1”) in new stack_
_ – Executing [s@macro-dialout-trunk:21] ExecIf(“SIP/950-00000003”, “0?Set(CONNECTEDLINE(num,i)=360)”) in new stack_
_ – Executing [s@macro-dialout-trunk:22] ExecIf(“SIP/950-00000003”, “0?Set(CONNECTEDLINE(name,i)=CID:+12345678901)”) in new stack_
_ – Executing [s@macro-dialout-trunk:23] ExecIf(“SIP/950-00000003”, “0?Set(CONNECTEDLINE(name,i)=CID:(Hidden)+12345678901)”) in new stack_
_ – Executing [s@macro-dialout-trunk:24] GotoIf(“SIP/950-00000003”, “0?customtrunk”) in new stack_
_ – Executing [s@macro-dialout-trunk:25] ExecIf(“SIP/950-00000003”, “0?Set(DIAL_TRUNK_OPTIONS=)”) in new stack_
_ – Executing [s@macro-dialout-trunk:26] Dial(“SIP/950-00000003”, “SIP/M-Net/360,300,Tb(func-apply-sipheaders^s^1,(1))”) in new stack_
_ == Using SIP VIDEO TOS bits 136_
_ == Using SIP VIDEO CoS mark 6_
_ == Using SIP RTP TOS bits 184_
_ == Using SIP RTP CoS mark 5_
_ – SIP/M-Net-00000004 Internal Gosub(func-apply-sipheaders,s,1(1)) start_
_ – Executing [s@func-apply-sipheaders:1] NoOp(“SIP/M-Net-00000004”, “Applying SIP Headers to channel SIP/M-Net-00000004”) in new stack_
_ – Executing [s@func-apply-sipheaders:2] Set(“SIP/M-Net-00000004”, “TECH=SIP”) in new stack_
_ – Executing [s@func-apply-sipheaders:3] Set(“SIP/M-Net-00000004”, “SIPHEADERKEYS=”) in new stack_
_ – Executing [s@func-apply-sipheaders:4] While(“SIP/M-Net-00000004”, “0”) in new stack_
_ – Jumping to priority 12_
_ – Executing [s@func-apply-sipheaders:13] Return(“SIP/M-Net-00000004”, “”) in new stack_
_ == Spawn extension (from-trunk-sip-M-Net, 360, 1) exited non-zero on ‘SIP/M-Net-00000004’_
_ – SIP/M-Net-00000004 Internal Gosub(func-apply-sipheaders,s,1(1)) complete GOSUB_RETVAL=_
_ – Called SIP/M-Net/360_
_ == Spawn extension (macro-dialout-trunk, s, 26) exited non-zero on ‘SIP/950-00000003’ in macro ‘dialout-trunk’_
_ == Spawn extension (from-internal, 360, 6) exited non-zero on ‘SIP/950-00000003’_
_ – Executing [h@from-internal:1] Macro(“SIP/950-00000003”, “hangupcall”) in new stack_
_ – Executing [s@macro-hangupcall:1] GotoIf(“SIP/950-00000003”, “1?theend”) in new stack_
_ – Goto (macro-hangupcall,s,3)_
_ – Executing [s@macro-hangupcall:3] ExecIf(“SIP/950-00000003”, “0?Set(CDR(recordingfile)=)”) in new stack_
_ – Executing [s@macro-hangupcall:4] NoOp(“SIP/950-00000003”, "SIP/M-Net-00000004 montior file= ") in new stack_
_ – Executing [s@macro-hangupcall:5] GotoIf(“SIP/950-00000003”, “1?skipagi”) in new stack_
_ – Goto (macro-hangupcall,s,7)_
_ – Executing [s@macro-hangupcall:7] Hangup(“SIP/950-00000003”, “”) in new stack_
_ == Spawn extension (macro-hangupcall, s, 7) exited non-zero on ‘SIP/950-00000003’ in macro ‘hangupcall’_


(system) closed #2

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.