lcr module brings Least Cost Routing capability to OpenSER. It implements two related capabilities:
- sequential forwarding of a request to one or more gateways (functions load_gws and next_gw)
- sequential forwarding to contacts if they don’t share the the same qvalue (functions load_contacts and next_contacts).
Gateway selection is based on caller’s RPID URI (if available in caller’s RPID AVP after authentication) or From URI and user part of Request-URI (telephone number). A gateway matches a request if user part of Request-URI and “From” URI match the prefix and From the pattern of the gateway. Matching gateways are then ordered for forwarding purpose (1) according to longest user part match, (2) according to gateway’s priority, and (3) randomly.
Each gateway belongs to a gateway group either alone or among other gateways. All gateways in a group share the same priority.