Our gateway is connected to the PSTN with a PRI line. Eveything works fine from the inside. We can call outside but when the outside calls us from these line they hear a dial-tone. Why can this happen?
A key concept is that a single phone call through a voice gateway has two call legs, one inbound and one outbound, and each leg matches a dial-peer.
Outbound are the easiest to understand because they operate alot like route statements do to the IP data world; they tell the call/packet where to go. But inbound are important, too, because they instruct the VG on how to receive calls. Alot of VG get by using the (hidden) default dial-peer to match incoming calls, but in some cases, like yours, certain commands must be specified.
The "incoming called-number ." command is used to match the incoming calls to that dial-peer. The 'direct-inward-dial' command *should* eliminate that dialtone your caller hear. And these need to be applied to a pots dial-peer because the incoming call is coming in on a POTS pri.