Asterisk 13 SIP SIMPLE消息到CDR

时间:2015-08-08 21:05:35

标签: asterisk sip messages cdr

我在Ubuntu 12.04.3上运行Asterisk 13.4.0,我需要将SIMPLE消息记录到MySQL CDR。

消息正在扩展之间发送,所有其他CDR都被正确记录,但CDR中没有任何SIMPLE记录。是否可以使用Asterisk内置功能或某种解决方法来解决此问题?

1 个答案:

答案 0 :(得分:0)

输入sip_general_custom.conf

accept_outofcall_message=yes
outofcall_message_context=messages
auth_message_requests=no

进入extensions_custom.conf

[messages]
exten => _.,1,NoOp(SMS receiving dialplan invoked)
exten => _.,n,NoOp(To ${MESSAGE(to)})
exten => _.,n,NoOp(From ${MESSAGE(from)})
exten => _.,n,NoOp(Body ${MESSAGE(body)})
exten => _.,n,Set(ACTUALTO=${CUT(MESSAGE(to),@,1)})
exten => _.,n,Set(CDR(message)=${MESSAGE(from)})
exten => _.,n,MessageSend(${ACTUALTO},${MESSAGE(from)})
exten => _.,n,NoOp(Send status is ${MESSAGE_SEND_STATUS})
exten => _.,n,GotoIf($["${MESSAGE_SEND_STATUS}" != «SUCCESS»]?sendfailedmsg)
exten => _.,n,Hangup()
;
; Handle failed messaging
exten => _.,n(sendfailedmsg),Set(MESSAGE(body)="[${STRFTIME(${EPOCH},,%d%m%Y-%H:%M:%S)}] Your message to ${EXTEN} has failed. Retry later.")
exten => _.,n,Set(ME_1=${CUT(MESSAGE(from),<,2)})
exten => _.,n,Set(ACTUALFROM=${CUT(ME_1,@,1)})
exten => _.,n,MessageSend(${ACTUALFROM},ServiceCenter)
exten => _.,n,Hangup()
exten => _.,n,Hangup() 

您还需要添加到表消息列类型文本