我试图使用自定义字段来利用cdr日志记录(到mysql)。我所面临的问题只是当一个出站呼叫被放置时,在入站呼叫期间,我能够记录没有问题的自定义字段。
我之所以有问题,是因为我需要的自定义cdr字段是系统上每个用户的唯一值。
sip.conf
...
...
[sales_department](!)
type=friend
host=dynamic
context=SalesAgents
disallow=all
allow=ulaw
allow=alaw
qualify=yes
qualifyfreq=30
;; company sales agents:
[11](sales_agent)
secret=xxxxxx
callerid="<...>"
[12](sales_agent)
secret=xxxxxx
callerid="<...>"
[13](sales_agent)
secret=xxxxxx
callerid="<...>"
[14](sales_agent)
secret=xxxxxx
callerid="<...>"extensions.conf
[SalesAgents]
include => Services
; Outbound calls
exten=>_1NXXNXXXXXX,1,Dial(SIP/${EXTEN}@myprovider)
; Inbound calls
exten=>100,1,NoOp()
same => n,Set(CDR(agent_id)=11)
same => n,CELGenUserEvent(Custom Event)
same => n,Dial(${11_1},25)
same => n,GotoIf($["${DIALSTATUS}" = "BUSY"]?busy:unavail)
same => n(unavail),VoiceMail(11@asterisk)
same => n,Hangup()
same => n(busy),VoiceMail(11@asterisk)
same => n,Hangup()
exten=>101,1,NoOp()
same => n,Set(CDR(agent_id)=12)
same => n,CELGenUserEvent(Custom Event)
same => n,Dial(${12_1},25)
same => n,GotoIf($["${DIALSTATUS}" = "BUSY"]?busy:unavail)
same => n(unavail),VoiceMail(12@asterisk)
same => n,Hangup()
same => n(busy),VoiceMail(12@asterisk)
same => n,Hangup()
...
...对于上述示例中拨号计划的入站部分,我可以插入自定义cdr (agent_id)。但在上面,您可以看到拨号计划的外接部分,我很困惑如何能够告诉拨号计划是哪个agent_id正在打出站电话。
我的问题是:如何将agent_id=11 & agent_id=12、agent_id=13和agent_id=14等作为cdr在出站呼叫中的自定义字段?
发布于 2014-06-06 20:43:21
您应该能够用呼叫函数来完成它。尝试在您的拨号计划中将其编码为一个测试:
exten=6599,1,Answer()
exten=6599,n,Verbose(Caller id name=${CALLERID(name)})
exten=6599,n,Verbose(Caller id num=${CALLERID(num)})
exten=6599,n,Verbose(Caller id all=${CALLERID(all)})
exten=6599,n,SayNumber(${CALLERID(num)})
exten=6599,n,Hangup()当您拨打6599,您应该看到您正在调用的号码显示在控制台,并听到您的号码播放给您。在这种情况下,您应该能够为日志记录执行这样的操作:
same => n,Set(CDR(agent_id)=${CALLERID(num)})
编辑
若要使用此方法,请不要使用sip.conf callerid=设置或隐藏调用方or。相反,在您阅读了调用方in供自己使用之后,在拨号计划中的代码。例如:
same => n, Set(CALLERID(all)=""<>)https://stackoverflow.com/questions/23944943
复制相似问题