<p>I expect that tel2uri() was implemented based on the needs of initial developer as documented at:</p>
<ul>
<li><a href="https://www.kamailio.org/docs/modules/devel/modules/siputils.html#siputils.f.tel2sip">https://www.kamailio.org/docs/modules/devel/modules/siputils.html#siputils.f.tel2sip</a></li>
</ul>
<p>It can be improved if one needs/wants more.</p>
<p>Note also that specs are not implemented ad-litteram in a single function. The design of the application has been from the beginning to offer small tools (functions/statements) that can be blended in config script to get what you need. There are many functions and transformations that can help you replace/remove unwanted characters from user part of R-URI, such as subst_user(...), {re.subst} or {s...} transformations, etc. With all these I am pretty sure you can transfrorm tel to sip uri as per specs without using tel2sip() function.</p>
<p>To be clear: I am not against enhancing tel2sip() to do more that it does now, but wanted to highlight that many spec requirements can be done with a combination of functions and expressions. I am not the author of tel2sip() and actually I haven't used it many times. I do URI normalization with script operations.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/1173#issuecomment-312115866">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZTm0JCLVZgeIJSCNDk7td56u4mWIks5sJBkxgaJpZM4OJzVh">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AF36Zd2ea21EyWoGqY4maG-KYlJnIXuNks5sJBkxgaJpZM4OJzVh.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/kamailio/kamailio/issues/1173#issuecomment-312115866"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@miconda in #1173: I expect that tel2uri() was implemented based on the needs of initial developer as documented at:\r\n\r\n  * https://www.kamailio.org/docs/modules/devel/modules/siputils.html#siputils.f.tel2sip\r\n\r\nIt can be improved if one needs/wants more.\r\n\r\nNote also that specs are not implemented ad-litteram in a single function. The design of the application has been from the beginning to offer small tools (functions/statements) that can be blended in config script to get what you need. There are many functions and transformations that can help you replace/remove unwanted characters from user part of R-URI, such as subst_user(...), {re.subst} or {s...} transformations, etc. With all these I am pretty sure you can transfrorm tel to sip uri as per specs without using tel2sip() function.\r\n\r\nTo be clear: I am not against enhancing tel2sip() to do more that it does now, but wanted to highlight that many spec requirements can be done with a combination of functions and expressions. I am not the author of tel2sip() and actually I haven't used it many times. I do URI normalization with script operations."}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1173#issuecomment-312115866"}}}</script>