About a messagesend question

hi everyone,
I configed as the following:
Add to sip.conf:
accept_outofcall_message=yes
outofcall_message_context=message
Add to dialplan:
[messages]
exten => _XXX,1,MessageSend(sip:${EXTEN},"${CALLERID(name)}"${MESSAGE(from)})

A send message to B ;but B cannot sent message to A as reply. how should I do?
could the feature about chatting by sip message be implemented in asterisk?

by the way:
A send to C:if c cannot be available in asterisk,how to process timeout in dialplan to end the session?

     thanks!

BR
suzaichuan

Command should be:

Messagesend(sip:${EXTEN},${MESSAGE(from)})