Lets say 868555666 is calling to 868777888. The first number is the source (CallerID), and the other number is the destination. Localization source rules are used to modify the CallerID which comes to MOR, and provider source rules are used to modify the CallerID that will be sent to the provider. They aren't used all the time, only when owner of system wants them to be.

Take, for example, a provider that only accepts calls that are nine numbers in length and that begin with 8. MOR works only with E.164 standard callerID's if you want to run billing on them.

First of all, we need to make a Localizationsource rule for our situation:

Cut 8, add 370, Min/Max 9/9.

So now the caller's number is 37068555666, not 868555666. MOR identifies the caller as being from Lithuania (by country code 370), which means he can bill him.

Now we need to send a call to 868777888, but our number must be in the old format (868555666), so we need to apply a suitable provider source rule:

Local number is dialed in format 9x[x]xx[x]xxxx (within Spain) (includes area code + number).

International: country code (34) + area code + number.

! NOTE: MIN/MAX should be 8/10, since you want to change only the Spain local numbers. If MAX > 10, you will have wrong routing, for example: the Israel E.164 numbers (with prefixes 972), which are minimum 11 digits long, will be changed to Spain numbers.