Time Condition does not require PIN

Ok, I have an install that is running 12.76.2, the feature code of *271 has been created to override the time condition however it is ignoring the Override Pin Code. A user can just dial the *271 and the TC is changed without prompting.

I have tested this on another 12.76.2 system and it works as advertised.

Any thoughts or suggestions?

Andrew Birch

I am experiencing the same behavior on the same version. Following.

I am also experiencing this. Did someone figure out a fix? I am running FPBX version 12.0.76.2 and Asterisk version 11.21.2.

Any help would be greatly appreciated!

Sorry to say no. I went a different route with that customer

Works fine for me. Make sure you FreePBX modules are all up to date, and if the problem persists, post a call trace.

Everything is up to date, the first thing I did when the issue started. This is on a system that has used PIN’s on TC’s from the day it was deployed. It was working on this system and one day stopped working (not aware of any changes/updates to the system around the time it happened). A call trace is below. It seems the PIN (2288) is already in the trace without me entering it:

  == Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
       > [INSERT INTO cel (eventtype,eventtime,cid_name,cid_num,cid_ani,cid_rdnis,cid_dnid,exten,context,channame,appname,appdata,amaflags,accountcode,uniqueid,linkedid,peer,userdeftype,userfield) VALUES ('CHAN_START',{ts '2016-05-04 09:46:32.390661'},'TEST','999','','','','*276','from-internal','SIP/999-000000bc','','',3,'','1462376792.560','1462376792.560','','','')]
    -- Executing [*276@from-internal:1] Macro("SIP/999-000000bc", "user-callerid,") in new stack
    -- Executing [s@macro-user-callerid:1] Set("SIP/999-000000bc", "TOUCH_MONITOR=1462376792.560") in new stack
    -- Executing [s@macro-user-callerid:2] Set("SIP/999-000000bc", "AMPUSER=999") in new stack
    -- Executing [s@macro-user-callerid:3] GotoIf("SIP/999-000000bc", "0?report") in new stack
    -- Executing [s@macro-user-callerid:4] ExecIf("SIP/999-000000bc", "1?Set(REALCALLERIDNUM=999)") in new stack
    -- Executing [s@macro-user-callerid:5] Set("SIP/999-000000bc", "AMPUSER=999") in new stack
    -- Executing [s@macro-user-callerid:6] GotoIf("SIP/999-000000bc", "0?limit") in new stack
    -- Executing [s@macro-user-callerid:7] Set("SIP/999-000000bc", "AMPUSERCIDNAME=TEST") in new stack
    -- Executing [s@macro-user-callerid:8] GotoIf("SIP/999-000000bc", "0?report") in new stack
    -- Executing [s@macro-user-callerid:9] Set("SIP/999-000000bc", "AMPUSERCID=999") in new stack
    -- Executing [s@macro-user-callerid:10] Set("SIP/999-000000bc", "__DIAL_OPTIONS=Ttr") in new stack
    -- Executing [s@macro-user-callerid:11] Set("SIP/999-000000bc", "CALLERID(all)="TEST" <999>") in new stack
    -- Executing [s@macro-user-callerid:12] GotoIf("SIP/999-000000bc", "0?limit") in new stack
    -- Executing [s@macro-user-callerid:13] ExecIf("SIP/999-000000bc", "0?Set(GROUP(concurrency_limit)=999)") in new stack
    -- Executing [s@macro-user-callerid:14] GosubIf("SIP/999-000000bc", "7?sub-ccss,s,1(from-internal,*276)") in new stack
    -- Executing [s@sub-ccss:1] ExecIf("SIP/999-000000bc", "0?Return()") in new stack
    -- Executing [s@sub-ccss:2] Set("SIP/999-000000bc", "CCSS_SETUP=TRUE") in new stack
    -- Executing [s@sub-ccss:3] GosubIf("SIP/999-000000bc", "0?monitor_config,1(from-internal,*276):monitor_default,1(from-internal,*276)") in new stack
    -- Executing [monitor_default@sub-ccss:1] GotoIf("SIP/999-000000bc", "0?is_exten") in new stack
    -- Executing [monitor_default@sub-ccss:2] StackPop("SIP/999-000000bc", "") in new stack
    -- Executing [monitor_default@sub-ccss:3] Return("SIP/999-000000bc", "FALSE") in new stack
    -- Executing [s@macro-user-callerid:15] ExecIf("SIP/999-000000bc", "0?Set(CHANNEL(language)=)") in new stack
    -- Executing [s@macro-user-callerid:16] GotoIf("SIP/999-000000bc", "0?continue") in new stack
    -- Executing [s@macro-user-callerid:17] ExecIf("SIP/999-000000bc", "1?Set(__CALLEE_ACCOUNCODE=)") in new stack
    -- Executing [s@macro-user-callerid:18] Set("SIP/999-000000bc", "__TTL=64") in new stack
    -- Executing [s@macro-user-callerid:19] GotoIf("SIP/999-000000bc", "1?continue") in new stack
    -- Goto (macro-user-callerid,s,30)
    -- Executing [s@macro-user-callerid:30] Set("SIP/999-000000bc", "CALLERID(number)=999") in new stack
    -- Executing [s@macro-user-callerid:31] Set("SIP/999-000000bc", "CALLERID(name)=TEST") in new stack
    -- Executing [s@macro-user-callerid:32] Set("SIP/999-000000bc", "CDR(cnum)=999") in new stack
    -- Executing [s@macro-user-callerid:33] Set("SIP/999-000000bc", "CDR(cnam)=TEST") in new stack
    -- Executing [s@macro-user-callerid:34] Set("SIP/999-000000bc", "CHANNEL(language)=en") in new stack
    -- Executing [*276@from-internal:2] Macro("SIP/999-000000bc", "toggle-tc,6,2288") in new stack
    -- Executing [s@macro-toggle-tc:1] Set("SIP/999-000000bc", "INDEXES=6") in new stack
    -- Executing [s@macro-toggle-tc:2] Set("SIP/999-000000bc", "TCMAINT=RETURN") in new stack
    -- Executing [s@macro-toggle-tc:3] Set("SIP/999-000000bc", "TCSTATE=false") in new stack
    -- Executing [s@macro-toggle-tc:4] Set("SIP/999-000000bc", "TCINUSE=INUSE") in new stack
    -- Executing [s@macro-toggle-tc:5] Set("SIP/999-000000bc", "TCNOTINUSE=NOT_INUSE") in new stack
    -- Executing [s@macro-toggle-tc:6] Set("SIP/999-000000bc", "LOOPCNT=1") in new stack
    -- Executing [s@macro-toggle-tc:7] Set("SIP/999-000000bc", "ITER=1") in new stack
    -- Executing [s@macro-toggle-tc:8] Set("SIP/999-000000bc", "INDEX=6") in new stack
    -- Executing [s@macro-toggle-tc:9] Gosub("SIP/999-000000bc", "timeconditions,6,1()") in new stack
    -- Executing [6@timeconditions:1] Set("SIP/999-000000bc", "DB(TC/6/INUSESTATE)=INUSE") in new stack
    -- Executing [6@timeconditions:2] Set("SIP/999-000000bc", "DB(TC/6/NOT_INUSESTATE)=NOT_INUSE") in new stack
    -- Executing [6@timeconditions:3] GotoIfTime("SIP/999-000000bc", "10:00-16:00,mon,*,*?truestate") in new stack
    -- Executing [6@timeconditions:4] GotoIf("SIP/999-000000bc", "0?truegoto") in new stack
    -- Executing [6@timeconditions:5] ExecIf("SIP/999-000000bc", "0?Set(DB(TC/6)=)") in new stack
    -- Executing [6@timeconditions:6] Set("SIP/999-000000bc", "DEVICE_STATE(Custom:TC6)=INUSE") in new stack
    -- Executing [6@timeconditions:7] ExecIf("SIP/999-000000bc", "0?Set(NOT_INUSE)") in new stack
    -- Executing [6@timeconditions:8] GotoIf("SIP/999-000000bc", "0?timeconditions,4,1") in new stack
    -- Executing [6@timeconditions:9] Set("SIP/999-000000bc", "TCSTATE=false") in new stack
    -- Executing [6@timeconditions:10] Set("SIP/999-000000bc", "TCOVERRIDE=false") in new stack
    -- Executing [6@timeconditions:11] Return("SIP/999-000000bc", "") in new stack
    -- Executing [s@macro-toggle-tc:10] Set("SIP/999-000000bc", "TCSTATE_6=false") in new stack
    -- Executing [s@macro-toggle-tc:11] ExecIf("SIP/999-000000bc", "0?Set(OVERRIDE=true)") in new stack
    -- Executing [s@macro-toggle-tc:12] Set("SIP/999-000000bc", "ITER=2") in new stack
    -- Executing [s@macro-toggle-tc:13] GotoIf("SIP/999-000000bc", "0?begin1") in new stack
    -- Executing [s@macro-toggle-tc:14] Set("SIP/999-000000bc", "LOOPCNT=1") in new stack
    -- Executing [s@macro-toggle-tc:15] Set("SIP/999-000000bc", "ITER=1") in new stack
    -- Executing [s@macro-toggle-tc:16] Set("SIP/999-000000bc", "INDEX=6") in new stack
    -- Executing [s@macro-toggle-tc:17] Set("SIP/999-000000bc", "DB(TC/6)=true") in new stack
    -- Executing [s@macro-toggle-tc:18] Gosub("SIP/999-000000bc", "timeconditions,6,1()") in new stack
    -- Executing [6@timeconditions:1] Set("SIP/999-000000bc", "DB(TC/6/INUSESTATE)=INUSE") in new stack
    -- Executing [6@timeconditions:2] Set("SIP/999-000000bc", "DB(TC/6/NOT_INUSESTATE)=NOT_INUSE") in new stack
    -- Executing [6@timeconditions:3] GotoIfTime("SIP/999-000000bc", "10:00-16:00,mon,*,*?truestate") in new stack
    -- Executing [6@timeconditions:4] GotoIf("SIP/999-000000bc", "1?truegoto") in new stack
    -- Goto (timeconditions,6,14)
    -- Executing [6@timeconditions:14] Set("SIP/999-000000bc", "DEVICE_STATE(Custom:TC6)=NOT_INUSE") in new stack
  == Extension Changed *276[timeconditions-toggles] new state Idle for Notify User 601
  == Extension Changed *276[timeconditions-toggles] new state Idle for Notify User 999
  == Extension Changed *276[timeconditions-toggles] new state Idle for Notify User 208
  == Extension Changed *276[timeconditions-toggles] new state Idle for Notify User 600
    -- Executing [6@timeconditions:15] ExecIf("SIP/999-000000bc", "0?Set(NOT_INUSE)") in new stack
    -- Executing [6@timeconditions:16] GotoIf("SIP/999-000000bc", "0?ext-group,699,1") in new stack
    -- Executing [6@timeconditions:17] Set("SIP/999-000000bc", "TCSTATE=true") in new stack
    -- Executing [6@timeconditions:18] Set("SIP/999-000000bc", "TCOVERRIDE=true") in new stack
    -- Executing [6@timeconditions:19] Return("SIP/999-000000bc", "") in new stack
    -- Executing [s@macro-toggle-tc:19] Set("SIP/999-000000bc", "ITER=2") in new stack
    -- Executing [s@macro-toggle-tc:20] GotoIf("SIP/999-000000bc", "0?begin2") in new stack
    -- Executing [s@macro-toggle-tc:21] GotoIf("SIP/999-000000bc", "1?playback") in new stack
    -- Goto (macro-toggle-tc,s,23)
    -- Executing [s@macro-toggle-tc:23] Playback("SIP/999-000000bc", "beep&silence/1&time&de-activated") in new stack
       > [INSERT INTO cel (eventtype,eventtime,cid_name,cid_num,cid_ani,cid_rdnis,cid_dnid,exten,context,channame,appname,appdata,amaflags,accountcode,uniqueid,linkedid,peer,userdeftype,userfield) VALUES ('ANSWER',{ts '2016-05-04 09:46:32.558034'},'TEST','999','999','','*276','s','macro-toggle-tc','SIP/999-000000bc','Playback','beep&silence/1&time&de-activated',3,'','1462376792.560','1462376792.560','','','')]
       > 0xb5afce38 -- Probation passed - setting RTP source address to 10.125.2.59:2242
    -- <SIP/999-000000bc> Playing 'beep.gsm' (language 'en')
    -- <SIP/999-000000bc> Playing 'silence/1.gsm' (language 'en')
    -- <SIP/999-000000bc> Playing 'time.gsm' (language 'en')
    -- <SIP/999-000000bc> Playing 'de-activated.gsm' (language 'en')
    -- Executing [*276@from-internal:3] Hangup("SIP/999-000000bc", "") in new stack
  == Spawn extension (from-internal, *276, 3) exited non-zero on 'SIP/999-000000bc'
    -- Executing [h@from-internal:1] Hangup("SIP/999-000000bc", "") in new stack
  == Spawn extension (from-internal, h, 1) exited non-zero on 'SIP/999-000000bc'
       > [INSERT INTO cel (eventtype,eventtime,cid_name,cid_num,cid_ani,cid_rdnis,cid_dnid,exten,context,channame,appname,appdata,amaflags,accountcode,uniqueid,linkedid,peer,userdeftype,userfield) VALUES ('HANGUP',{ts '2016-05-04 09:46:36.180846'},'TEST','999','999','','*276','h','from-internal','SIP/999-000000bc','','',3,'','1462376792.560','1462376792.560','','','')]
       > [INSERT INTO cdr (calldate,clid,src,dst,dcontext,channel,lastapp,duration,billsec,disposition,amaflags,uniqueid,cnum,cnam) VALUES ({ ts '2016-05-04 09:46:32' },'"TEST" <999>','999','*276','from-internal','SIP/999-000000bc','Hangup',4,4,'ANSWERED',3,'1462376792.560','999','TEST')]
       > [INSERT INTO cel (eventtype,eventtime,cid_name,cid_num,cid_ani,cid_rdnis,cid_dnid,exten,context,channame,appname,appdata,amaflags,accountcode,uniqueid,linkedid,peer,userdeftype,userfield) VALUES ('CHAN_END',{ts '2016-05-04 09:46:36.190585'},'TEST','999','999','','*276','h','from-internal','SIP/999-000000bc','','',3,'','1462376792.560','1462376792.560','','','')]
       > [INSERT INTO cel (eventtype,eventtime,cid_name,cid_num,cid_ani,cid_rdnis,cid_dnid,exten,context,channame,appname,appdata,amaflags,accountcode,uniqueid,linkedid,peer,userdeftype,userfield) VALUES ('LINKEDID_END',{ts '2016-05-04 09:46:36.190710'},'TEST','999','999','','*276','h','from-internal','SIP/999-000000bc','','',3,'','1462376792.560','1462376792.560','','','')]

Issue identified and reported here:
http://issues.freepbx.org/browse/FREEPBX-12229