SetGroup,CheckGroup.
Вот так я проверяю на звонки по одному пин коду:
[macro-one-call]
exten => s,1,SetGroup(${ARG1})
exten => s,2,CheckGroup(1)
exten => s,3,Answer
exten => s,4,Wait(1)
exten => s,103,Answer
exten => s,104,Wait(1)
exten => s,105,SayNumber(1)
exten => s,106,Playback(call)
exten => s,107,Playback(at-any-time)
exten => s,108,Wait(1)
exten => s,109,Hangup
[macro-prepaid-cards]
exten => s,1,Answer
exten => s,2,Wait(1)
exten => s,3,Read(PIN,card-number,10)
exten => s,4,Macro(one-call,${PIN})
exten => s,5,AGI(dtl_check_valid_account.py|${PIN})
exten => s,6,AGI(dtl_tell_balance.py|${PIN})
exten => s,7,Read(DST,telephone-number)
exten => s,8,AGI(dtl_tell_minutes.py,${PIN},${DST})
exten => s,9,SetCallerId(${PIN})
exten => s,10,Macro(routes,${DST})
exten => s,11,Playback(number-not-answering)
exten => s,12,Goto(s,7)
exten => s,111,Goto(busy,1)
exten => busy,1,Playback(the-number-u-dialed)
exten => busy,2,Playback(is-curntly-busy)
exten => busy,3,Hangup