New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Append HF don't work in event_route #3006
Comments
The bug tracker is for tracking of bugs in Kamailio, not for discussing user related questions. Please contact our sr-users list instead. |
Didn't try to see it in log, I see the complete frame with $mb and I see my append is missing. |
when I try msg_apply_changes(), getting unknown command, missing loadmodule, textops is correctly loaded (loadmodule "textops.so"). |
Please read the quoted link, its textopsx module. For more question please consult the mailing list. |
Description
Hello,
I'm trying to connect kamailio to Microsoft Teams.
Dispatch is correctly configured and send SIP OPTION correctly.
Following this tutorial : https://skalatan.de/en/blog/kamailio-sbc-teams, I added an Event_Route to add contact header to SIP OPTION from dispath to MS :
event_route[tm:local-request] {
xlog("*** tm:local-request *** ");
if(is_method("OPTIONS") && $ru =~ "pstnhub.microsoft.com") {
xlog("L_INFO", "Append new contact !\n");
append_hf("Contact: sip:MY_SBC_NAME.COM:5061;transport=tls\r\n");
}
xlog("L_INFO", "Sent out tm request: $mb\n");
}
When I check the log to see my sended frame, I don't see a contact header field :
INFO: <script>: Append new contact !
INFO: <script>: Sent out tm request :
OPTIONS sip:sip.pstnhub.microsoft.com;transport=tls SIP/2.0
Via: SIP/2.0/TLS MY_SBC_NAME.COM:5061;branch=z9hG4bK4497.f3e5e754000000000000000000000000.0
To: sip:sip.pstnhub.microsoft.com;transport=tls
From: sip:MY_SBC_NAME.COM.fr;tag=a76e006ace3802951ed860e08df964af-7971
CSeq: 10 OPTIONS
Call-ID: 2e1278ea77796160-9837@MY_SBC_IP
Max-Forwards: 70
Content-Length: 0
User-Agent: kamailio (5.2.1 (x86_64/linux))
According the documentation about textop, append_hf(txt[, hdr]) :
This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE, FAILURE_ROUTE, BRANCH_ROUTE.
So my question is append HF can be used in Event_route ?
Is there any other way to add contact header ?
Regards,
Arnaud
Troubleshooting
Reproduction
Can be easily reproducted with the following code (don t forget to set SBC NAME)
event_route[tm:local-request] {
xlog("*** tm:local-request *** ");
if(is_method("OPTIONS") && $ru =~ "pstnhub.microsoft.com") {
xlog("L_INFO", "Append new contact !\n");
append_hf("Contact: sip:MY_SBC_NAME.COM:5061;transport=tls\r\n");
}
xlog("L_INFO", "Sent out tm request: $mb\n");
}
Log Messages
INFO: <script>: Append new contact !
INFO: <script>: Sent out tm request :
OPTIONS sip:sip.pstnhub.microsoft.com;transport=tls SIP/2.0
Via: SIP/2.0/TLS MY_SBC_NAME.COM:5061;branch=z9hG4bK4497.f3e5e754000000000000000000000000.0
To: sip:sip.pstnhub.microsoft.com;transport=tls
From: sip:MY_SBC_NAME.COM.fr;tag=a76e006ace3802951ed860e08df964af-7971
CSeq: 10 OPTIONS
Call-ID: 2e1278ea77796160-9837@MY_SBC_IP
Max-Forwards: 70
Content-Length: 0
User-Agent: kamailio (5.2.1 (x86_64/linux))
The text was updated successfully, but these errors were encountered: