Hi.
I am trying to do some hotdesking.
The main idea is that people dial code then password and will be logged in to queue.
But before that i want to write to mysql whenever they where logged in or out.
At now, i m stuck at log in. The problem is, that i don’t understand why asterisk keeps saying that function is not registered.
Here is my dialplan
[agents]
exten => *897,1,Goto(agent-status,begin,1)
exten => _9XXXXXXXX,Goto(queue-agents-outbound)
[agent-status]
exten => begin,1,NoOp
same => 2,Read(Extension,enter-username,4)
same => 3,Set(Pass=${AGENTS_INFO(${Extension})})
same => 4,Verbose(Login is ${Extension})
same => 5,Verbose(Password is ${Pass})
same => 6,Read(Getpasswd,password-enter,4)
same => 7,Gotoif($["${Pass}" = “${Getpasswd}”]?8:bad,start,1)
same => 8,Playback(login-ok)
same => 9,Set(usrname=${CALLERID(num)})
same => 10,Verbose(Calledis is ${usrname})
same => 11,Set(AGENTS_LOGIN(${Extension})=${CALLERID(num)})
same => 12,Set(AGENTS_MONITOR()=${Extension})
same => 13,Hangup()
[bad]
exten => start,1,Playback(wrong-password)
same => 2,Hangup()
Here is func_odbc.conf
[INFO]
prefix=AGENTS
dsn=asterisk
readsql=SELECT password from agents where username = ‘${ARG1}’
[LOGIN]
prefix=AGENTS
dsn=asterisk
writesql=UPDATE agents set location = ‘${VAL1}’, status = 1 where username = ‘${ARG1}’
[MONITOR]
prefix=AGENTS
dns=asterisk
writesql=INSERT INTO cc_stats(user,event) values(’${VAL1}’,1)
Call log
[size=85]
[Nov 17 22:17:46] VERBOSE[2618] netsock2.c: == Using SIP RTP TOS bits 184
[Nov 17 22:17:46] VERBOSE[2618] netsock2.c: == Using SIP RTP CoS mark 5
[Nov 17 22:17:46] VERBOSE[5147] pbx.c: – Executing [*897@agents:1] Goto(“SIP/1101-00000045”, “agent-status,begin,1”) in new stack
[Nov 17 22:17:46] VERBOSE[5147] pbx.c: – Goto (agent-status,begin,1)
[Nov 17 22:17:46] VERBOSE[5147] pbx.c: – Executing [begin@agent-status:1] NoOp(“SIP/1101-00000045”, “”) in new stack
[Nov 17 22:17:46] VERBOSE[5147] pbx.c: – Executing [begin@agent-status:2] Read(“SIP/1101-00000045”, “Extension,enter-username,4”) in new stack
[Nov 17 22:17:47] VERBOSE[5147] app_read.c: – Accepting a maximum of 4 digits.
[Nov 17 22:17:47] VERBOSE[5147] file.c: – <SIP/1101-00000045> Playing ‘enter-username.slin’ (language ‘en’)
[Nov 17 22:17:49] VERBOSE[5147] app_read.c: – User entered ‘1101’
[Nov 17 22:17:49] VERBOSE[5147] pbx.c: – Executing [begin@agent-status:3] Set(“SIP/1101-00000045”, “Pass=2222”) in new stack
[Nov 17 22:17:49] VERBOSE[5147] pbx.c: – Executing [begin@agent-status:4] Verbose(“SIP/1101-00000045”, “Login is 1101”) in new stack
[Nov 17 22:17:49] VERBOSE[5147] app_verbose.c: Login is 1101
[Nov 17 22:17:49] VERBOSE[5147] pbx.c: – Executing [begin@agent-status:5] Verbose(“SIP/1101-00000045”, “Password is 2222”) in new stack
[Nov 17 22:17:49] VERBOSE[5147] app_verbose.c: Password is 2222
[Nov 17 22:17:49] VERBOSE[5147] pbx.c: – Executing [begin@agent-status:6] Read(“SIP/1101-00000045”, “Getpasswd,password-enter,4”) in new stack
[Nov 17 22:17:49] VERBOSE[5147] app_read.c: – Accepting a maximum of 4 digits.
[Nov 17 22:17:49] VERBOSE[5147] file.c: – <SIP/1101-00000045> Playing ‘password-enter.slin’ (language ‘en’)
[Nov 17 22:17:51] VERBOSE[5147] app_read.c: – User entered ‘2222’
[Nov 17 22:17:51] VERBOSE[5147] pbx.c: – Executing [begin@agent-status:7] GotoIf(“SIP/1101-00000045”, “1?8:bad,start,1”) in new stack
[Nov 17 22:17:51] VERBOSE[5147] pbx.c: – Goto (agent-status,begin,8)
[Nov 17 22:17:51] VERBOSE[5147] pbx.c: – Executing [begin@agent-status:8] Playback(“SIP/1101-00000045”, “login-ok”) in new stack
[Nov 17 22:17:51] VERBOSE[5147] file.c: – <SIP/1101-00000045> Playing ‘login-ok.slin’ (language ‘en’)
[Nov 17 22:17:53] VERBOSE[5147] pbx.c: – Executing [begin@agent-status:9] Set(“SIP/1101-00000045”, “usrname=1101”) in new stack
[Nov 17 22:17:53] VERBOSE[5147] pbx.c: – Executing [begin@agent-status:10] Verbose(“SIP/1101-00000045”, “Calledis is 1101”) in new stack
[Nov 17 22:17:53] VERBOSE[5147] app_verbose.c: Calledis is 1101
[Nov 17 22:17:53] VERBOSE[5147] pbx.c: – Executing [begin@agent-status:11] Set(“SIP/1101-00000045”, “AGENTS_LOGIN(1101)=1101”) in new stack
[Nov 17 22:17:53] VERBOSE[5147] pbx.c: – Executing [begin@agent-status:12] Set(“SIP/1101-00000045”, “AGENTS_MONITOR()=1101”) in new stack
[Nov 17 22:17:53] ERROR[5147] pbx.c: Function AGENTS_MONITOR not registered
[Nov 17 22:17:53] VERBOSE[5147] pbx.c: – Executing [begin@agent-status:13] Hangup(“SIP/1101-00000045”, “”) in new stack
[Nov 17 22:17:53] VERBOSE[5147] pbx.c: == Spawn extension (agent-status, begin, 13) exited non-zero on ‘SIP/1101-00000045’
[/size]
Could somone tell me where is mistake?