[OpenSIPS-Users] Opensip SIP Trunk authentication issue

Satish Patel satish.txt at gmail.com
Thu Aug 21 22:56:40 CEST 2014


We have opensip running with multidomain authentication, now we have
purchases SIP trunk from provide to send call to put side country (PSTN)

They gave me Username/Password and IP address of their SIP server

I have did following configuration to configure my opensip as UAC

#### Opensips UAC
loadmodule "uac_auth.so"
loadmodule "uac_registrant.so"
modparam("uac_registrant", "hash_size", 2)
modparam("uac_registrant", "timer_interval", 100)
modparam("uac_registrant", "db_url", "mysql://opensips:opensipsrw@localhost
/opensips")
modparam("uac_registrant", "table_name", "registrant")


My Opensip successfully register on their Trunk

# opensipsctl registrant dump
AOR:: sip:testtrunk at 65.xxx.xxx.xxx:5065 expires=300
        state:: REGISTERED_STATE
        last_register_sent:: Fri Aug 22 02:18:14 2014
        registration_t_out:: Fri Aug 22 02:21:35 2014
        registrar:: sip:65.xxx.xxx.xxx.xxx:5065
        binding:: sip:testtrunk at 65.xxx.xxx.xxx:5065
        dst_IP:: IPv4 ip=xxx.xxx.xxx.xxx


Now big question is how do i use this trunk in my routing script, After
google i came up with following configuration but it is not working, It is
not rewriting host part.

 # account only INVITEs
        if (is_method("INVITE")) {

                setflag(ACC_DO); # do accounting
                $avp(can_uri) = $ru;

                      };

        }
        # PSTN Testing
        if  ( uri=~"^sip:16465352727 at .*") {
        route(3);
        exit;
        };

...
...
route[3] {

if (method=="INVITE")
 {
  if (uri=~"^sip:16465352727 at .*") {

        rewritehostport("65.xxx.xxx.xxx:5065");
        xlog("Redirecting to SIP Provider.. $ru\n");
    exit;
  };
};
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20140821/41f71c45/attachment.htm>


More information about the Users mailing list