<div dir="ltr"><div><div><div><div><div><div>Hi All,<br><br></div>I'm looking for a 
solution to a problem that is not OpenSIPS specific, but for sure some
 of you have dealt with this, and maybe someone can suggest optimal 
solution, so I could not re-invent the wheel<br><br></div>It's all about proper filling of available termination trunk capacity, but not the trivial one with simple LCR<br><br></div>Let's say we have two trunks:<br></div>- Trunk 1 - capacity 100 channels, termination cost 1 cent<br></div>- Trunk 2 - capacity 200 channels, termination cost 3 cent<br><br></div>And we have clients sending wholesale traffic with random number of channels:<br><div>- Client 1 - sell rate 2 cent</div><div>- Client 2 - sell rate 4 cent<br></div><div><br></div><div>As
 you see we can only sell to client 1 with profit using trunk 1. If we 
use LCR and client 2 has more traffic, than it will fill trunk 1 
capacity and client 2 will hit trunk 2 and we will start to loose money<br></div><div><br></div><div>Sticking
 client 1 to trunk 1 and client 2 to trunk 2 is also not optimal. Number
 of channels is more or less random. If we stick client 2 to trunk 2 
when client 1 is not using all 100 channels, than we loose additional 1 
cent of margin</div><div><br></div><div>I think about some form of 
capacity-aware dynamic routing - send client 2 traffic to trunk 1 only 
if client 1 cannot fill trunk 1, maybe using some capacity averages from
 last X minutes.</div><div><br></div><div>Any suggestions how to approach this problem?</div><div><br></div>Kind Regards</div>