1# calling no 1111 becomes 6000:
configure the the below in global config
translation-rule 1
Rule 0 ^11111 6000
and configure "translate-outgoing calling 1" under the dial-peer which is used for 9997.
2#when calls are placed from ip phone to 6000, to be directed to 11111.
add this in global mode
translate-rule 2
rule 0 ^6000 11111
under incoming dial-peer for destination 6000 add the following line in global
translate-outgoing called 2
3#calls from PSTN to number for example +4311234 6000 shoud be transfered to extension 11111 which is extension on PBX
num-exp 43112346000 11111
use the above command in global
dial peer voice 1 pots
destination pattern 43112346000