title: how to configure asterisk instant messaging
body: <p>Does asterisk support instant messages? I have tried to configure asterisk for IM (<a href="https://groups.google.com/forum/#!msg/csipsimple-users/stBJYGQ88fw/OgLW8CLVvIkJ" rel="noreferrer">from this example</a>), but when I'm trying to send IM to another sip account asterisk returns warning:</p>
  
  <p><code>WARNING[20128]: chan_sip.c:16379 receive_message: Received message to sip:test3@192.168.21.153 from sip:test1@192.168.21.153; tag=d9fdcc28313946c5a2a6ae1eae997c62, dropped it...
    Content-Type:text/plain
    Message: hahaha
  </code>
  Additionally the SIP client returns message "method not allowed". This is my <strong>sip.conf</strong> file:</p>
  
  <pre><code>[general]
  context=internal
  allowguest=no
  allowoverlap=no
  bindport=5060
  bindaddr=0.0.0.0
  srvlookup=no
  disallow=all
  allow=ulaw
  alwaysauthreject=yes
  canreinvite=no
  nat=yes
  session-timers=refuse
  localnet=192.168.21.153/255.255.255.0
  accept_outofcall_message=yes
  outofcall_message_context=internal
  
  [test1]
  type=friend
  host=dynamic
  secret=test1
  context=internal
  
  [test2]
  type=friend
  host=dynamic
  secret=test2
  context=internal
  
  [test3]
  type=friend
  host=dynamic
  secret=test3
  context=internal
  </code></pre>
  
  <p>And this is my <strong>extensions.conf</strong> file:</p>
  
  <pre><code>[internal]
  exten =&gt; test1,1,Answer()
  exten =&gt; test1,2,Dial(SIP/test1,60)
  exten =&gt; test1,3,Playback(vm-nobodyavail)
  exten =&gt; test1,4,VoiceMail(test1@main)
  exten =&gt; test1,5,Hangup()
  
  exten =&gt; test2,1,Answer()
  exten =&gt; test2,2,Dial(SIP/test2,60)
  exten =&gt; test2,3,Playback(vm-nobodyavail)
  exten =&gt; test2,4,VoiceMail(test2@main)
  exten =&gt; test2,5,Hangup()
  
  exten =&gt; test3,1,Answer()
  exten =&gt; test3,2,Dial(SIP/test3,60)
  exten =&gt; test3,3,Playback(vm-nobodyavail)
  exten =&gt; test3,4,VoiceMail(test3@main)
  exten =&gt; test3,5,Hangup()
  
  exten =&gt; 8001,1,VoicemailMain(test1@main)
  exten =&gt; 8001,2,Hangup()
  
  exten =&gt; 8002,1,VoicemailMain(test2@main)
  exten =&gt; 8002,2,Hangup()
  
  exten =&gt; 8003,1,VoicemailMain(test3@main)
  exten =&gt; 8003,2,Hangup()
  
  exten =&gt; _.,1,NoOp(SMS receiving dialplan invoked) 
  exten =&gt; _.,n,NoOp(To ${MESSAGE(to)}) 
  exten =&gt; _.,n,NoOp(From ${MESSAGE(from)}) 
  exten =&gt; _.,n,NoOp(Body ${MESSAGE(body)}) 
  exten =&gt; _.,n,Set(ACTUALTO=${CUT(MESSAGE(to),@,1)}) 
  exten =&gt; _.,n,MessageSend(${ACTUALTO},${MESSAGE(from)}) 
  exten =&gt; _.,n,NoOp(Send status is ${MESSAGE_SEND_STATUS}) 
  exten =&gt; _.,n,GotoIf($["${MESSAGE_SEND_STATUS}" != "SUCCESS"]? 
  sendfailedmsg) 
  exten =&gt; _.,n,Hangup() 
  exten =&gt; h,1,Hangup() 
  ; 
  ; Handle failed messaging 
  exten =&gt; _.,n(sendfailedmsg),Set(MESSAGE(body)="[${STRFTIME(${EPOCH},, 
  %d%m%Y-%H:%M:%S)}] Your message to ${EXTEN} has failed. Retry later.") 
  exten =&gt; _.,n,Set(ME_1=${CUT(MESSAGE(from),&lt;,2)}) 
  exten =&gt; _.,n,Set(ACTUALFROM=${CUT(ME_1,@,1)}) 
  exten =&gt; _.,n,MessageSend(${ACTUALFROM},ServiceCenter) 
  exten =&gt; _.,n,Hangup() 
  exten =&gt; h,1,Hangup() 
  </code></pre>