<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">I am using OpenSIPS 1.11 and I am recently getting some weird behavior from the DROUTING module. The module is corrupting the Carrier ID that is being returned via AVP. This behavior is occurring only with the Carrier ID, not the gateway
 or rule IDs, and only when it is returned from the DROUTING module via dr_is_gw() or do_routing(). If I query the database directly using AVPOPS, the Carrier ID is returned correctly.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">I have the following configuration. The startup_route was added specifically for this issue.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">####&nbsp; Dynamic ROUTING module<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">loadmodule &quot;drouting.so&quot;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">modparam(&quot;drouting&quot;, &quot;db_url&quot;, &quot;CFG_DB_URL&quot;)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">modparam(&quot;drouting&quot;, &quot;persistent_state&quot;, DISABLE)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">modparam(&quot;drouting&quot;, &quot;probing_interval&quot;, ENABLE)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">modparam(&quot;drouting&quot;, &quot;force_dns&quot;, ENABLE)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">modparam(&quot;drouting&quot;, &quot;ruri_avp&quot;, '$avp(dr_ruri)')<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">modparam(&quot;drouting&quot;, &quot;gw_id_avp&quot;, '$avp(dr_gw_id)')<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">modparam(&quot;drouting&quot;, &quot;gw_priprefix_avp&quot;, '$avp(dr_gw_prfx)')<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">modparam(&quot;drouting&quot;, &quot;rule_id_avp&quot;, '$avp(dr_rule_id)')<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">modparam(&quot;drouting&quot;, &quot;rule_prefix_avp&quot;, '$avp(dr_rule_prfx)')<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">modparam(&quot;drouting&quot;, &quot;carrier_id_avp&quot;, '$avp(dr_carr_id)')<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">startup_route {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp; avp_db_query(&quot;select carrierid from dr_carriers&quot;, &quot;$avp(ids)&quot;);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp; for ($var(id) in $(avp(ids)[*]))<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp;&nbsp;&nbsp; xlog(&quot;L_INFO&quot;, &quot;Carrier ID: $var(id)\n&quot;);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">}<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">route[get_route]<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">{<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp; if (!do_routing(&quot;$avp(dr_group)&quot;, &quot;&quot;, , &quot;$var(rule_attr)&quot;, &quot;$var(gw_attr)&quot;, &quot;$var(carr_attr)&quot;))<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp; {<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp;&nbsp;&nbsp; xlog(&quot;L_ERR&quot;, &quot;get_route: failure from do_routing! $retcode\n&quot;);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp;&nbsp;&nbsp; route(reply_error, &quot;500&quot;, &quot;Server Internal Error&quot;);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp; }<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp; xlog(&quot;L_INFO&quot;, &quot;get_route: rule_attr - $var(rule_attr)\n&quot;);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp; xlog(&quot;L_INFO&quot;, &quot;get_route: gw_attr&nbsp;&nbsp; - $var(gw_attr)\n&quot;);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp; xlog(&quot;L_INFO&quot;, &quot;get_route: carr_attr - $var(carr_attr)\n&quot;);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp; xlog(&quot;L_INFO&quot;, &quot;get_route: ruri&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - $avp(dr_ruri)\n&quot;);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp; xlog(&quot;L_INFO&quot;, &quot;get_route: gw_id&nbsp;&nbsp;&nbsp;&nbsp; - $avp(dr_gw_id)\n&quot;);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp; xlog(&quot;L_INFO&quot;, &quot;get_route: gw_prfx&nbsp;&nbsp; - $avp(dr_gw_prfx)\n&quot;);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp; xlog(&quot;L_INFO&quot;, &quot;get_route: rule_id&nbsp;&nbsp; - $avp(dr_rule_id)\n&quot;);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp; xlog(&quot;L_INFO&quot;, &quot;get_route: rule_prfx - $avp(dr_rule_prfx)\n&quot;);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">&nbsp; xlog(&quot;L_INFO&quot;, &quot;get_route: carr_id&nbsp;&nbsp; - $avp(dr_carr_id)\n\n&quot;);<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">}<o:p></o:p></span></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">The output from the above execution is:<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">opensips[9801]: Carrier ID: IndyEdges<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">opensips[9801]: Carrier ID: Level3-VT<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">opensips: INFO:core:daemonize: pre-daemon process exiting with 0<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">opensips[9801]: get_route: rule_attr -
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">opensips[9801]: get_route: gw_attr&nbsp;&nbsp; -
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">opensips[9801]: get_route: carr_attr - id=pai;history=hi<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">opensips[9801]: get_route: ruri&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - &lt;null&gt;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">opensips[9801]: get_route: gw_id&nbsp;&nbsp;&nbsp;&nbsp; - Level3-VT1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">opensips[9801]: get_route: gw_prfx&nbsp;&nbsp; - &#43;<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">opensips[9801]: get_route: rule_id &nbsp;&nbsp;- 4<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">opensips[9801]: get_route: rule_prfx - 1<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;">opensips[9801]: get_route: carr_id&nbsp;&nbsp; - Level3-VT#012</span><o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">You can see that the string &#8216;#012&#8217; has been appended to the Carrier ID. So far it has always been that string appended to the ID.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">It started occurring after I moved from a RHEL 7 server using MariaDB to a RHEL 6 server using MySQL, but in both cases I am using the provided OpenSIPS scripts to create all database tables.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Any help would be appreciated.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Ben Newlin<o:p></o:p></p>
</div>
</body>
</html>