<p></p>
<h3 dir="auto">Description</h3>
<p dir="auto">Hello,</p>
<p dir="auto">I'm trying to connect kamailio to Microsoft Teams.<br>
Dispatch is correctly configured and send SIP OPTION correctly.<br>
Following this tutorial : <a href="https://skalatan.de/en/blog/kamailio-sbc-teams" rel="nofollow">https://skalatan.de/en/blog/kamailio-sbc-teams</a>, I added an Event_Route to add contact header to SIP OPTION from dispath to MS :</p>
<p dir="auto">event_route[tm:local-request] {<br>
xlog("*** tm:local-request *** ");<br>
if(is_method("OPTIONS") && $ru =~ "pstnhub.microsoft.com") {<br>
xlog("L_INFO", "Append new contact !\n");<br>
append_hf("Contact: sip:MY_SBC_NAME.COM:5061;transport=tls\r\n");<br>
}<br>
xlog("L_INFO", "Sent out tm request: $mb\n");<br>
}</p>
<p dir="auto">When I check the log to see my sended frame, I don't see a contact header field :<br>
<em>INFO: <script>: Append new contact !<br>
INFO: <script>: Sent out tm request :<br>
OPTIONS sip:sip.pstnhub.microsoft.com;transport=tls SIP/2.0<br>
Via: SIP/2.0/TLS MY_SBC_NAME.COM:5061;branch=z9hG4bK4497.f3e5e754000000000000000000000000.0<br>
To: sip:sip.pstnhub.microsoft.com;transport=tls<br>
From: sip:MY_SBC_NAME.COM.fr;tag=a76e006ace3802951ed860e08df964af-7971<br>
CSeq: 10 OPTIONS<br>
Call-ID: 2e1278ea77796160-9837@MY_SBC_IP<br>
Max-Forwards: 70<br>
Content-Length: 0<br>
User-Agent: kamailio (5.2.1 (x86_64/linux))</em></p>
<p dir="auto">According the documentation about textop, append_hf(txt[, hdr]) :<br>
<em>This function can be used from REQUEST_ROUTE, ONREPLY_ROUTE, FAILURE_ROUTE, BRANCH_ROUTE.</em></p>
<p dir="auto">So my question is append HF can be used in Event_route ?<br>
Is there any other way to add contact header ?</p>
<p dir="auto">Regards,<br>
Arnaud</p>
<h3 dir="auto">Troubleshooting</h3>
<h4 dir="auto">Reproduction</h4>
<p dir="auto">Can be easily reproducted with the following code (don t forget to set SBC NAME)</p>
<p dir="auto">event_route[tm:local-request] {<br>
xlog("*** tm:local-request *** ");<br>
if(is_method("OPTIONS") && $ru =~ "pstnhub.microsoft.com") {<br>
xlog("L_INFO", "Append new contact !\n");<br>
append_hf("Contact: sip:MY_SBC_NAME.COM:5061;transport=tls\r\n");<br>
}<br>
xlog("L_INFO", "Sent out tm request: $mb\n");<br>
}</p>
<h4 dir="auto">Log Messages</h4>
<p dir="auto">INFO: <script>: Append new contact !<br>
INFO: <script>: Sent out tm request :<br>
OPTIONS sip:sip.pstnhub.microsoft.com;transport=tls SIP/2.0<br>
Via: SIP/2.0/TLS MY_SBC_NAME.COM:5061;branch=z9hG4bK4497.f3e5e754000000000000000000000000.0<br>
To: sip:sip.pstnhub.microsoft.com;transport=tls<br>
From: sip:MY_SBC_NAME.COM.fr;tag=a76e006ace3802951ed860e08df964af-7971<br>
CSeq: 10 OPTIONS<br>
Call-ID: 2e1278ea77796160-9837@MY_SBC_IP<br>
Max-Forwards: 70<br>
Content-Length: 0<br>
User-Agent: kamailio (5.2.1 (x86_64/linux))</p>
<pre><code>
#### SIP Traffic

Traffic is in TLS, can't be easily readed.

### Additional Information

version: kamailio 5.3.9 (x86_64/linux) a5fd0a
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: a5fd0a
compiled on 15:59:30 Jan 10 2022 with gcc 8.3.0

* **Operating System**:

No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 10 (buster)
Release:        10
Codename:       buster

Linux debian 4.19.0-17-amd64 #1 SMP Debian 4.19.194-3 (2021-07-18) x86_64 GNU/Linux

</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/3006">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABO7UZP6FPURRPA5ZEZZ2DLUXUPFPANCNFSM5MU4RALA">unsubscribe</a>.<br />Triage notifications on the go with GitHub Mobile for <a href="https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675">iOS</a> or <a href="https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub">Android</a>.
<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/ABO7UZNNFNQYKVRIGJRAO4DUXUPFPA5CNFSM5MU4RALKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4QSODHXQ.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><kamailio/kamailio/issues/3006</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/3006",
"url": "https://github.com/kamailio/kamailio/issues/3006",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>