Support of RFC 3428

Hi all,

Excuse me in advance for my bad english but it’s not my native language.

I’m currently work to developp a SIP application that use the SIP MESSAGE which is an extension of the base RFC of SIP. SIP MESSAGE is defined by the RFC 3428 http://www.ietf.org/rfc/rfc3428.txt. This extension allows the transfer of Instant Message. It is not designed on session-model but more in pager-model. So it is possible to exchange SIP MESSAGE outside a call. (we can imaging two SIP user registered on asterisk and they want to exchange SIP message).

I want to know if asterisk supports this RFC and how to handle correctly SIP MESSAGE. Currently, I use a special dialplan to forward a SIP MESSAGE to the destination. This solution works well but I don’t know how to forward back to the source the 200 OK response of the destination. Actually, asterisk send back to the destination only the 202 Accepted response which prove that the message has been delivered to the asterisk but the source MUST NOT assume that the message has been delivered to the final destination.

If I capture the SIP network traffic, I can look the following behavior :

SOURCE-------------SIP MESSAGE---------->ASTERISK
SOURCE<-----------202 ACCEPTED---------ASTERISK-------------SIP MESSAGE---------->DESTINATION
(do nothing with 200 OK) X<-ASTERISK<-------------200 OK-----------------DESTINATION

So I want forward the 200 OK to the source. How can I do that ?

Above, you can look my custom dialplan which forward SIP MESSAGE to destination.

[sip-message]
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,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()

Thanks in advance

Cyrill Gremaud

  1. This is the wrong forum for a support question.

  2. Asterisk is not a proxy.

  3. Generally you can only have one 2xx response for a request. If Asterisk responds 202, I think you can assume that it is going to be its final response.

This is confirmed by the source code:

transmit_response(p, "202 Accepted", req); /* We respond 202 accepted, since we relay the message */

Correct. Excuse me.

[quote=“david55”]3) Generally you can only have one 2xx response for a request. If Asterisk responds 202, I think you can assume that it is going to be its final response.

This is confirmed by the source code:

transmit_response(p, "202 Accepted", req); /* We respond 202 accepted, since we relay the message */
[/quote]

Ok I understand. I never go in the code to see how asterisk works. Now, I would know if it is possible to transmit back to the sender the 200 OK or it’s really impossible.

thanks

Only by changing the source code.