【发布时间】:2014-06-07 19:39:07
【问题描述】:
我正在尝试使用自定义字段来利用 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 出站呼叫的自定义字段?
【问题讨论】:
-
服务器配置问题与Stack Overflow 无关。你应该问Server Fault
-
那么为什么会有专门为星号 Mike 指定的标签?
-
这个问题不是关于管理我的星号系统所在的服务器,而是专门关于对拨号方案进行编程......与服务器无关?恐怕它比 serverfault 更适合 stackoverflow...
-
我不同意,但为了清楚了解这应该去哪里,我在Meta Stack Overflow 上发布了this question
-
我想说这比 StackOverflow 上的大多数 Asterisk 问题更合适。如果这被关闭为“离题”,您也可以关闭 90% 的其他 Asterisk 相关问题。