<head><title></title></head>
<body><div class="iw_mail" dir="ltr">Hello,<br><br>As a SIP Provider, we implementing the ability to provide SIP trunks to customers with a PBX or Dialer that require Registration. With this in mind,<br>the customer wants to be able to set the CallerID on at least on the basis of the devices connected tho them, but potentially on a per call basis.<br><br>For the challenge-response to the non-Register methods, we have implemented the script as follows (seems to be a very standard way). My question is<br>for the case of the CallerID not being the same as the username/authorization name, how do we do this? Because the "FROM" user is different from the<br>authorized user, the db_check_from fails. I don't believe all phone systems support P-Asserted-ID, so we can't really go that route. So can we just remove<br>the "db_check_from"? What risk does that expose us to?<br><br><pre style="background-color:#ffffff;color:#000000;font-family:'DejaVu Sans Mono';font-size:11.3pt;">if ( !(is_method("REGISTER")) ) {<br> if (is_from_local("$var(reg_domain_attr)")) { # from Registered device<br> $avp(callee_number_type) := "Registered";<br><br> # authenticate if from local subscriber<br> # authenticate all initial non-REGISTER request that pretend to be<br> # generated by local subscriber (domain from FROM URI is local)<br> if (!proxy_authorize("", "subscriber")) {<br> proxy_challenge("", "0");<br> exit;<br> }<br><br> if (!db_check_from()) {<br> sl_send_reply("403","Forbidden auth ID");<br> exit;<br> }<br><br> consume_credentials();<br> # caller authenticated<br> }<br>}<br></pre>
<span data-mce-style="color: #808080; font-family: arial,helvetica,sans-serif; font-size: 11pt;" style="color: rgb(128, 128, 128); font-size: 11pt;">Regards,</span><div class="signature"><div style="font-family: arial, helvetica, sans-serif; font-size: 16px;">
<span data-mce-style="color: #808080; font-family: arial,helvetica,sans-serif; font-size: 11pt;" style="color: rgb(128, 128, 128); font-size: 11pt;"><strong>Pat Burke</strong></span><br><br>
</div></div>
</div></body>