<div dir="ltr"><div>I followed Daniel's instructions and made some progress but not 100% there yet.<br><br>-------[Global section]----------<br>           <br>user_agent_header=""<br>     <br>-------[Main Routing Logic]-------<br><br># handle registrations<br>        if (is_method("REGISTER"))<br>        {  <br>        $avp(new_user_agent) = $ua;<br>        }<br>        route(REGISTRAR);<br>.<br>.<br><br># Forward REGISTER to Freeswitch<br>route[REGFWD] {<br><br>        if(!is_method("REGISTER"))<br>        {<br>                return;<br>        }<br>        route(DISPATCH);<br>        $uac_req(method)="REGISTER";<br>        $uac_req(ruri)=$du;<br>        $uac_req(furi)=$fn + "<sip:" + $au + "@" + $ar + ">";<br>        $uac_req(turi)=$tn + "<sip:" + $au + "@" + $ar + ">";<br>        $uac_req(hdrs)="Contact: <sip:" + $au + "@"<br>                                + $ar<br>                                + ";fs_path=sip:"<br>                                + $sel(cfg_get.kamailio.bindip)<br>                                + ":" + $sel(cfg_get.kamailio.bindport)<br>                                + ">"<br>                                + "\r\n";<br>        if($sel(contact.expires) != $null)<br>                $uac_req(hdrs)= $uac_req(hdrs) + "Expires: " + $sel(contact.expires) + "\r\n";<br>        else<br>                $uac_req(hdrs)= $uac_req(hdrs) + "Expires: " + $hdr(Expires) + "\r\n";<br>        $uac_req(hdrs)= $uac_req(hdrs) + "User-Agent: " + $avp(new_user_agent) + "\r\n";<br>        uac_req_send();<br>        exit;<br>}<br>#!endif<br><br>------------<br><br>Now the correct User-Agent appears in the REGISTER message but in Freeswitch it shows as unknown.<br><br>U 184.xx.xx.208:5060 -> 184.xx.xx.198:6060<br>REGISTER sip:184.x.x.198:6060 SIP/2.0.<br>Via: SIP/2.0/UDP 184.xx.xx.208;branch=z9hG4bKa764.668d6dc7.0.<br>To: <<a href="mailto:sip%3A1001@pbx.mydomain.com">sip:1001@pbx.mydomain.com</a>>.<br>From: <<a href="mailto:sip%3A1001@pbx.mydomain.com">sip:1001@pbx.mydomain.com</a>>;tag=6f72f76f3402bf7cf11f6917529ca761-2ceb.<br>CSeq: 10 REGISTER.<br>Call-ID: 4570a277563cdffc-61869@184.xx.xx.208.<br>Max-Forwards: 70.<br>Content-Length: 0.<br>.<br>Contact: <<a href="mailto:sip%3A1001@pbx.mydomain.com">sip:1001@pbx.mydomain.com</a>;fs_path=sip:184.xx.xx.208:5060>.<br>Expires: 120.<br>User-Agent: Yealink SIP-T46G 28.72.0.26.<br>.<br>----------------<br><br>Got some extra dots in there but not sure why they are there and how they got there.<br>Any ideas? Anything I missed?<br><br>BR<br><br></div>Errol<br><br><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 8, 2014 at 12:34 PM, Daniel-Constantin Mierla <span dir="ltr"><<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    Perhaps you can get it with adding User-Agent header to
    $uac_req(hdrs):<br>
    <br>
    $uac_req(hdrs)= $uac_req(hdrs) + "User-Agent: " + $ua + "\r\n";<br>
    <br>
    And sent the global parameter:<br>
    <br>
    user_agent_header=""<br>
    <br>
    But then no local generated request has user agent, which probably
    is ok for you.<br>
    <br>
    There are still ways to use event_route[tm:local-request] to set a
    custom user agent header, but would require something like:<br>
    - add $us in $uac_req(hdrs) as X-UA header<br>
    - in event_route[tm:local-request], remove User-Agent and X-UA
    headers and add again User-Agent taking the value from X-UA<br>
    <br>
    Cheers,<br>
    Daniel<div><div class="h5"><br>
    <br>
    <br></div></div></div>
<br></blockquote></div><br></div></div></div>