在星号上接收短信

时间:2013-02-25 06:07:43

标签: linux sms sip asterisk

我通过我的星号版本1.4.11上的sip在我的星号服务器上收到了短信,但是无法从agi路由它或将其发送到我可以在控制台上看到的某些网址。

[Feb 24 23:50:29] WARNING[23972]: chan_sip.c:9496 receive_message: Received message to <sip:13214375437576@16.151.18.14> from <sip:131231233214@164.36.74.30>;tag=sansay1824778355rdb15870, dropped it...
Content-Type:text/plain
Message: Test SMS

1 个答案:

答案 0 :(得分:2)

在1.4。*

上没有任何方式处理短信

您需要星号版本10或11

配置如下:

sip.conf

textsupport=yes                                                                                                                                                                               
accept_outofcall_message = yes                                                                                                                                  
outofcall_message_context = messages

的extensions.conf

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