<div dir="ltr">Hi Alex<div>Thanks to your pointers above, I am able to login into a custom table insert queries as needed. However, I am not sure how to define the correct variables, what I am doing now is the following :</div>

<div><br></div><div><div><br></div><div>sql_query(&quot;cb&quot;, &quot;insert into registrations (`user`,`agent`,`type`,`ip`,`unique`,`auth`) VALUES(&#39;test&#39;,&#39;VOS&#39;,&#39;IN&#39;,&#39;8.8.8.8&#39;, &#39;someID&#39; , &#39;register wrong &#39;) &quot;, &quot;ra&quot;);</div>

<div>           </div><div>sql_result_free(&quot;ra&quot;);</div><div><br></div><div>How do I get the variables for username,agent and IP.</div><div><br></div><div>Thanks</div><br><div class="gmail_quote">On Wed, Sep 5, 2012 at 3:25 PM, Alex Balashov <span dir="ltr">&lt;<a href="mailto:abalashov@evaristesys.com" target="_blank">abalashov@evaristesys.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Sure, just pull it out with the $ua or $hdr(User-Agent) PVs.<div class="im"><br>
<br>
On 09/05/2012 07:53 AM, Ali Jawad wrote:<br>
<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
Hi Alex<br>
Sounds good, thanks for the input so far, anyway I can add the useragent<br>
to the entry ?<br>
Regards<br>
<br>
On Wed, Sep 5, 2012 at 2:49 PM, Alex Balashov &lt;<a href="mailto:abalashov@evaristesys.com" target="_blank">abalashov@evaristesys.com</a><br></div><div><div class="h5">
&lt;mailto:<a href="mailto:abalashov@evaristesys.com" target="_blank">abalashov@evaristesys.<u></u>com</a>&gt;&gt; wrote:<br>
<br>
    Hi Ali,<br>
<br>
<br>
    On 09/05/2012 07:18 AM, Ali Jawad wrote:<br>
<br>
        Is it possible to store user logon/logout dates + user agent used. I<br>
        know that the info is in the location table but it is not<br>
        persistent,<br>
        and I am using the accounting table to store calls. But I am not<br>
        sure<br>
        there is a way to store logon/logout/user agent.<br>
<br>
<br>
    By &quot;logon&quot; and &quot;logout&quot; I assume you are referring to registration,<br>
    not something else.<br>
<br>
    You can capture a REGISTER request in the main request route and<br>
    call a SQL operation via &#39;sqlops&#39; to store that timestamp ($Ts)<br>
    wherever you want.<br>
<br>
    There is no such thing as an &quot;unregistration&quot;, technically, just a<br>
    REGISTER request with an ;expires=0 parameter in the Contact header,<br>
    or an Expires: 0 header.  If you look for those parameters in your<br>
    processing of the REGISTER request, e.g.<br>
<br>
        if((is_present_hf(&quot;Expires&quot;) &amp;&amp; $hdr(Expires) == &quot;0&quot;) ||<br>
           $hdr(Contact) =~ &quot;expires=0&quot;)<br>
<br>
    you can store those times, too.<br>
<br>
    -- Alex<br>
<br>
    --<br>
    Alex Balashov - Principal<br>
    Evariste Systems LLC<br>
    235 E Ponce de Leon Ave<br>
    Suite 106<br>
    Decatur, GA 30030<br>
    Tel: +1-678-954-0670<br>
    Fax: +1-404-961-1892<br>
    Web: <a href="http://www.evaristesys.com/" target="_blank">http://www.evaristesys.com/</a>, <a href="http://www.alexbalashov.com/" target="_blank">http://www.alexbalashov.com/</a><br>
<br></div></div>
    ______________________________<u></u>___________________<div class="im"><br>
    SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br></div>
    <a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a> &lt;mailto:<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-<u></u>router.org</a>&gt;<br>


    <a href="http://lists.sip-router.org/__cgi-bin/mailman/listinfo/sr-__users" target="_blank">http://lists.sip-router.org/__<u></u>cgi-bin/mailman/listinfo/sr-__<u></u>users</a><br>
    &lt;<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/<u></u>cgi-bin/mailman/listinfo/sr-<u></u>users</a>&gt;<br>
<br>
<br>
<br>
<br>
--<br>
*Ali Jawad<br>
*<br>
*Information Systems Manager<div class="im"><br>
CISSP - ITIL V3 - RHCE - VCP - C|EH - CCNA - MCSA<br></div>
*<br>
*Splendor Telecom (<a href="http://www.splendor.net" target="_blank">www.splendor.net</a> &lt;<a href="http://www.splendor.net/" target="_blank">http://www.splendor.net/</a>&gt;)<div class="im"><br>
Beirut, Lebanon<br>
Phone: +9611373725/ext 116<br>
FAX: +9611375554<br>
<br></div><div class="im">
*<br>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/<u></u>cgi-bin/mailman/listinfo/sr-<u></u>users</a><br>
<br>
</div></blockquote><div class="HOEnZb"><div class="h5">
<br>
<br>
-- <br>
Alex Balashov - Principal<br>
Evariste Systems LLC<br>
235 E Ponce de Leon Ave<br>
Suite 106<br>
Decatur, GA 30030<br>
Tel: +1-678-954-0670<br>
Fax: +1-404-961-1892<br>
Web: <a href="http://www.evaristesys.com/" target="_blank">http://www.evaristesys.com/</a>, <a href="http://www.alexbalashov.com/" target="_blank">http://www.alexbalashov.com/</a><br>
<br>
______________________________<u></u>_________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/<u></u>cgi-bin/mailman/listinfo/sr-<u></u>users</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div><div><font><font color="#888888"><b><br></b></font></font><div><div></div></div></div></div></div><br>
</div></div>