Prefix routing help needed

  • Hi, All!

    Help me, please.

    I have a 1.4.2 OPENSIPS.

    Two UAs are registered at this server: one SIP phone and one cisco gateway.

    SIP Phone is registered with phone number 1000.

    If I configure cisco to register phone number 2000 on SIP server I can make calls from SIP Phone to PSTN behind gateway and from PSTN to SIP Phone. But when cisco registers to SIP server with prefix like 2...* I cannot make call from SIP Phone to number 2000, 20001 and so on. SIP Server responds to SIP Phone INVITE message with Status 404: Not found.   

    How to resolve this problem?

    Thank in advance,

    • Hi Julio,

      There are two ways for routing to PSTN:
      1) register based - in this case you need to know what is the username the GW register with the proxy; If it is 1234 (for ex), for all calls you want to be sent PSTN, do rewriteuser("1234") before lookup("location")

      2) based on simple IP based forwarding - you know thw GW IP and you divert the calls using rewritehostport(IP:port);