<div dir="ltr">Hello List,<div><br></div><div><br></div><div>i solved this with an "simple" if statement. </div><div>For me surprising i tried this without success:<br></div><div><br></div><div>#!define NEWDOMAIN "some.domain.example"<br></div><div>$avp(newdomain) = NEWDOMAIN;<br></div><div><br></div><div>if ($avp(newdomain) == $rd) ...<br></div><div><br></div><div>and this dont match. Also i tried "" around all vars.</div><div>And copied into $avp and {s.tolower} all of them.</div><div>Nothing works.<br></div><div>avp_print() shows both avps as the same.</div><div><br></div><div>Anyway ---</div><div><br></div><div>My now working example is that one with avp_check. </div><div>Was hard to find the meaning of g/G and i/I in the module.</div><div>In the wiki i found an example description of tha avp_check flags.</div><div> <br></div><div><div>if (allow_source_address(FLT_IVR)) {</div><div>        # OLD vs NEW - domain routing...</div><div>        $avp(newdomain) = NEWDOMAIN;</div><div>        $avp(pathinfo) = "outbound";</div><div>        # avp_check flags / avpops</div><div>        # g/G - use all values of the checked AVP (first parameter)</div><div>        # i/I - if strings are checked, do it case insensitive</div><div>        if ( avp_check("$rd", "eq/$avp(newdomain)/gi") ) {</div><div>            xlog("L_INFO", "go to new-gw\n");</div><div>            $avp(routing_target) = FLT_FSNODE;</div><div>        }</div><div>        else {</div><div>            xlog("L_INFO", "go to old-gw\n");</div><div>            $avp(routing_target) = FLT_OLDSBC;</div><div>        }</div><div>        xlog("L_INFO", "[$avp(pathinfo)] comes from IVR <$si> to <$ruri> \n");</div><div>        route(DISPATCH);</div><div>        exit;</div></div><div>  }</div><div><br></div><div><br></div><div>Kind Regards</div><div>...</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-11-08 13:28 GMT+01:00 Karsten Horsmann <span dir="ltr"><<a href="mailto:khorsmann@gmail.com" target="_blank">khorsmann@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello List,<div><br></div><div><br clear="all"><div>i use kamailio-5.0.4 and i am now at the point that one kamailio is not enough :).<br></div><div><br></div><div>So i decide to set another kamailio internal as sip-router based on drouting.</div><div>My config is straight forward the example config with additional drouting stuff.</div><div><br></div><div>Whats the best practice to route based on $rd with kamailio?</div><div><br></div><div>I dont want to end with an bunch of if then else. Should be come from database.</div><div><br></div><div>Pseudo Code:</div><div><br></div><div>if ($rd == old.sbc.domain) {</div><div>   route[oldstuff];</div><div>}</div><div>else {</div><div>   route[newstuff];</div><div>}</div><div><br></div><div>Is there an module that i can use?</div><span class="HOEnZb"><font color="#888888"><div><br></div><div><br></div>-- <br><div class="m_-8224639185566715659gmail_signature">Kind Regards<br>*Karsten Horsmann*<br></div>
</font></span></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Mit freundlichen Grüßen<br>*Karsten Horsmann*<br></div>
</div>