<div dir="ltr">Hi All,<div><br></div><div>we are trying to use the Kamailio as an UAC on a PBX. It should behave just like a normal SIP UAC (e.g. an SNOM phone).</div><div>The reason why we want that, is connecting a service to any other PBX with Client features and security (DA).</div><div><br></div><div>Our setup looks like:</div><div><br></div><div>Kamailio UAC w/ register <-> Kamailio OBP/SBC <-> PBX</div><div><br></div><div>The register is working fine. We insert the credentials into DB and trigger kamailio to reload the config (kamctl uac.reload).</div><div>Then the register is sent out including the unauth (401) handling. After than we are registered on the PBX. The Register is sent though the OBP as configured in DB.</div><div><br></div><div>We are trying to make calls:</div><div><br></div><div>Calls from PBX to Kamailio are working fine but we struggle with calls from kamailio torwards PBX.</div><div><br></div><div>We have the l_uuid in a variable and we try to get the PV ready for the invite.</div><div><br></div><div>First we need to do is rewrite the "from" URI. We thought we can get a proper FROM URI with the uuid we have. But the uac_replace_from just sets the $fu as given and does not make any logic with UAC credentials.</div><div>To handle the RURI, we trigger uac_reg_lookup with the uuid and it replaces the $ru with user-name and domain from the data stored in DB. In this case that makes no sense. The $rU should be what the user had dialed, the $rd should be the server given in uacreg DB table. The OBP given in DB is ignored completely.</div><div><br></div><div>After we managed to rewrite everything in SIP as needed we try to catch the 407 as it's shown in the module documentation with failure route. Here we have not found any way to get the credentials for the uuid.</div><div><br></div><div>Now we wonder if we have missed any global setting which sets everything right. If anybody has a similar setup and a working config, we appreciate any help we can get.</div><div><div><br></div><div><br></div><div>our config looks like:</div><div><br></div><div>...</div><div>loadmodule "uac.so"<br></div><div>....</div><div><div>modparam("uac","auth_realm_avp","$avp(arealm)")</div><div>modparam("uac","auth_username_avp","$avp(auser)")</div><div>modparam("uac","auth_password_avp","$avp(apass)")</div><div>modparam("uac","restore_from_avp","$avp(original_uri_from)")</div><div>modparam("uac","restore_to_avp","$avp(original_uri_to)")</div><div>modparam("uac","credential","username:domain:password")</div><div>modparam("uac", "reg_db_url","DBURI")</div><div>modparam("uac", "reg_timer_interval", 60)</div><div>modparam("uac", "reg_retry_interval", 300)</div><div>modparam("uac", "reg_contact_addr", "<a href="http://1.2.3.4:5060">1.2.3.4:5060</a>")</div><div>...</div></div><div>route {<br></div><div><br></div><div><div>        xlog("L_NOTICE", "INVITE: F=$fu T=$tu R=$ru\n");</div><div>        route("QUERY_UUID"); # <- sets $var(UUID) to l_uuid of the DB</div><div>        $var(request_user) = $rU;</div><div>        uac_reg_lookup("$var(UUID)", "$ru");</div><div>        $var(request_from_user) = $rU;</div><div>        $rU = $var(request_user);</div><div>        uac_replace_from("$var(request_from_user)","sip:$var(request_from_user)@<a href="http://1.2.3.4">1.2.3.4</a>");</div><div>        t_on_failure("TRUNKAUTH");<br></div><div>        xlog("L_NOTICE", "INVITE: F=$fu T=$tu R=$ru  $avp(auser) $avp(apass)\n"); # avp "auser and apass are "<null>"</div><div><br></div><div><div>        if (!t_relay()) {</div><div>                xlog("L_ERR", "error to <$tu> from <$fu>\n");</div><div>                sl_reply_error();</div><div>        };</div></div><div><br></div><div>}</div></div><div><div>failure_route[TRUNKAUTH] {</div><div>    if (t_is_canceled()) {</div><div>        exit;</div><div>    }</div><div>    if(t_check_status("401|407")) {</div><div>        # $avp(auser) = "test"; <-should be set from the l_uuid profile anyhow<br></div><div>        # $avp(apass) = "test";</div><div>        $var(request_user) = $rU;<br></div><div>        if (uac_auth()) {</div><div>                # We do never get here since uac_auth never returns true.</div><div>                $rU = $var(request_user);<br></div><div>                route("FORWARD_MESSAGE");</div><div>                exit;</div><div>        }</div><div>        xlog("L_NOTICE", "DAMN!!!");</div><div>    }</div><div>}</div></div><div><br></div><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><pre>Jöran Vinzens - <a href="mailto:vinzens@sipgate.de" target="_blank">vinzens[at]sipgate.de</a><br><br><br>sipgate GmbH - Gladbacher Str. 74 - 40219 Düsseldorf<br>HRB Düsseldorf 39841 - Geschäftsführer: Thilo Salmon, Tim Mois<br>Steuernummer: 106/5724/7147, Umsatzsteuer-ID: DE219349391<br><br><a href="http://www.sipgate.de" target="_blank">www.sipgate.de</a> - <a href="http://www.sipgate.co.uk" target="_blank">www.sipgate.co.uk</a><br></pre></div></div>
</div></div>