Chatplan.php File does not exist

I tried to use the instant messaging functionality of asterisk with the following code in extensions_custom.conf

[astsms]
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,AGI(chatplan.php,${MESSAGE(from)})
;exten => _.,n,Set(ACTUALTO=${CUT(MESSAGE(to),@,1)})
;exten => _.,n,ExecIf($[“${ACTUALTO}” != “sip:${EXTEN}”]?Set(ACTUALTO=sip:${EXTEN}))
exten => _.,n,MessageSend(${ACTUALTOS},${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),NoOp(Sending error to user)
exten => _.,n,Set(SRC=${MESSAGE(from)})
exten => _.,n,Set(DST=${MESSAGE(to)})
exten => _.,n,Set(MSG=${MESSAGE(body)})
exten => _.,n,Set(MESSAGE(body)=“[${STRFTIME(${EPOCH},%d%m%Y-%H:%M:%S)}] Your message to ${EXTEN} has failed. Sending when available”)
exten => _.,n,Set(ME_1=${CUT(MESSAGE(from),<,2)})
exten => _.,n,Set(ACTUALFROM=${CUT(ME_1,@,1)})
exten => _.,n,MessageSend(${ACTUALFROM},ServiceCenter)
exten => _.,n,GotoIf($[“${INQUEUE}” != “1”]?startq)
exten => _.,n,Hangup()
;
exten => _.,n(startq),NoOp(Queueing messaging for offline)
exten => _.,n,Set(MSGTIME=${STRFTIME(${EPOCH},%d%m%Y-%H:%M:%S)})
exten => _.,n,SYSTEM(/var/lib/asterisk/agi-bin/astqueue.sh –SRC ‘${SRC}’ –DST ‘${DST}’ –MSG ‘${MSG}’)
exten => _.,n,Hangup()[app-fakeanswer]
exten => _.,1,NoCDR
exten => _.,n,Set(DESTDEV=${EXTEN})
exten => _.,n,Set(THISDEVSTATE=${DEVICE_STATE(SIP/${DESTDEV})})
exten => _.,n,GotoIf($[“${THISDEVSTATE}” = “UNAVAILABLE”]?hang)
exten => _.,n,GotoIf($[“${THISDEVSTATE}” = “UNKNOWN”]?hang)
exten => _.,n,Answer
exten => _.,n,Hangup()
exten => _.,n(hang),Hangup()

But “chatplan.php” is missing on my server. Is there a way get access to that file somewhere? I tried another solution which does not require that file, but in that case the messages are lost when the receiver is not available. I would like to try with this solution as well…

That is not a file included with Asterisk itself. You would have to determine what distributes it and get it from there.

Hi Joshua,

Thank you for a quick reply! Do you have any recommendation for implementation of instant messaging in asterisk? I could not find any official documentation. I found one solution which works only when the recipient is available, and the messages are lost of the recipient becomes unavailable.

Not particularly, sorry. I don’t know of anyone using the messaging functionality for that purpose.