Menu

#83 UAC module

ver 1.2.x
closed-duplicate
nobody
modules (140)
5
2007-07-06
2007-05-04
No

RFC declare that SIP strings (at least From To Remote-Party-Id) can be utf8 encoded, but not all SIP terminals can correctly process that strings when thay are out of latin charset. In this case i want special processing for that uteminals (user-agents). For example i want enaple pass through utf8 for terminals with predefined user agent string and clear or transform for others.

I found the way to do it in branch_route handler instead of route handler (due to more than one terminal can be registered under same URI and they can be from different vendors).

branch_route[1] {
$avp(s:useragent)="";
avp_db_query("select user_agent from location where contact='$ru'","$avp(s:useragent)");
if ($avp(s:useragent)=~"SJphone") {return;};
uac_replace_from("transliterate","");
return;
}

But uac_replace_from in auc.c declared with REQUEST_ROUTE flag only. With attached patch i can solve proplem with some utf8 buggy sip terminals.

I thing that this simple patch will be usefull.

Discussion

  • Alexei Volkov

    Alexei Volkov - 2007-05-04

    Logged In: YES
    user_id=1779106
    Originator: YES

    File Added: branch_route_auc.patch

     
  • Alexei Volkov

    Alexei Volkov - 2007-05-04

    patch to make uac_replace_from available in branch_route handler

     
  • Alexei Volkov

    Alexei Volkov - 2007-05-04

    Logged In: YES
    user_id=1779106
    Originator: YES

    File Added: branch_route_uac.patch

     
  • Klaus Darilion

    Klaus Darilion - 2007-05-04

    Logged In: YES
    user_id=1318360
    Originator: NO

    Hi Alexei!

    if you have NATed clients and you use fix_nated_register() then the SQL query is wrong and should be

    avp_db_query("select user_agent from location where contact='$ru' and received='$du'","$avp(s:useragent)");

    Further, this query is dangerous because of SQL injection, thus you should use transformations (openser >=1.2):

    avp_db_query("select user_agent from location where contact='$ru.escape.common' and received='$du'","$avp(s:useragent)");

     
  • Alexei Volkov

    Alexei Volkov - 2007-07-02
    • status: open --> open-duplicate
     
  • Bogdan-Andrei Iancu

    • status: open-duplicate --> closed-duplicate
     

Log in to post a comment.

MongoDB Logo MongoDB