Макрос включения/отключения абонента.
[macro-en-peer]
exten => s,1,NoOp(CHANNEL(from):${CHANNEL(from)})
exten => s,n,MYSQL(Connect connid localhost user pass db)
exten => s,n,MYSQL(Query resultid ${connid} SELECT `enable_peer` FROM `sippeers` WHERE defaultuser = '${CHANNEL(peername)}')
exten => s,n,MYSQL(Fetch fetchid ${resultid} enable_peer )
exten => s,n,MYSQL(Clear ${resultid})
exten => s,n,MYSQL(Disconnect ${connid})
exten => s,n,Gotoif($["${enable_peer}" = "no"]?dis-peer)
exten => s,n,MacroExit
exten => s,n(dis-peer),Congestion(10)
exten => s,n,Hangup
Комментариев нет:
Отправить комментарий