I am trying to send a SIP CANCEL message using the t_uac_send() function from the tm module to cancel an INVITE message that was sent previously.
`$var(requestHeaders) = "Via: " + $var(via) +"\r\n" "To: sip:1010@172.16.100.76:6060;tag="+$var(tt)+"\r\n" "From: sip:rvrbt@172.16.100.76:6060;tag="+$var(ft)+"\r\n" "Call-ID: " + $ci + "\r\n" "CSeq: 1 CANCEL\r\n" "Max-Forwards: 62\r\n";
t_uac_send("CANCEL", "sip:1010@172.16.100.76:6060", "", "", "$var(requestHeaders)", "");`
I am encountering an issue where an additional Via header with a newly generated branch parameter is being added to the top of the headers. This behavior causes the CANCEL request to not be recognized as part of the existing transaction and I get "SIP/2.0 481 Call/Transaction Does Not Exist"
Logs and Debugging Information: Include relevant logs here, such as the generated CANCEL request and the 481 response. [cancleWithExtraViaHeader.zip](https://github.com/user-attachments/files/18310017/cancleWithExtraViaHeader....)
Have you tried to use the tmx t_cancel_callid(callid, cseq, flag) function? There have been reports that the t_uac_send(..) function is not working for CANCELs in the past.
Have your peers meetings been completed? If transactions were not conversational, why not use stateless SIP messages to respond to INVITIE requests? In these cases, it is better to use sl_relpy to send appropriate messages. With best regards. Mojtaba
On Sun, Jan 5, 2025, 15:09 Fateme Pardakhti via sr-dev < sr-dev@lists.kamailio.org> wrote:
I am trying to send a SIP CANCEL message using the t_uac_send() function from the tm module to cancel an INVITE message that was sent previously.
`$var(requestHeaders) = "Via: " + $var(via) +"\r\n" "To: sip:1010@172.16.100.76:6060;tag="+$var(tt)+"\r\n" "From: sip:rvrbt@172.16.100.76:6060;tag="+$var(ft)+"\r\n" "Call-ID: " + $ci + "\r\n" "CSeq: 1 CANCEL\r\n" "Max-Forwards: 62\r\n";
t_uac_send("CANCEL", "sip:1010@172.16.100.76:6060", "", "", "$var(requestHeaders)", "");`
I am encountering an issue where an additional Via header with a newly generated branch parameter is being added to the top of the headers. This behavior causes the CANCEL request to not be recognized as part of the existing transaction and I get "SIP/2.0 481 Call/Transaction Does Not Exist"
Logs and Debugging Information: Include relevant logs here, such as the generated CANCEL request and the 481 response. cancleWithExtraViaHeader.zip https://github.com/user-attachments/files/18310017/cancleWithExtraViaHeader.zip
— Reply to this email directly, view it on GitHub https://github.com/kamailio/kamailio/issues/4096, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABO7UZMXURL6CNPMGYKQGQ32JEJXRAVCNFSM6AAAAABUUBBFNCVHI2DSMVQWIX3LMV43ASLTON2WKOZSG43DSMRTGA3DANI . You are receiving this because you are subscribed to this thread.Message ID: kamailio/kamailio/issues/4096@github.com _______________________________________________ Kamailio - Development Mailing List -- sr-dev@lists.kamailio.org To unsubscribe send an email to sr-dev-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender!
Have you tried to use the tmx t_cancel_callid(callid, cseq, flag) function? There have been reports that the t_uac_send(..) function is not working for CANCELs in the past.
Yes, It works. Thanks!
Closed #4096 as completed.
Thanks for reporting back, closing it then.