Normally you used such providers only for incoming calls, for outgoing you have a least cost routing system selecting the best route from many termination providers.
Kamailio 3.1.0 introduces a handy way to configure your SIP proxy to register to other SIP servers for incoming calls. You have to load uac module and add records to uacreg table. The table stores following attributes:
- l_uuid - local unique user id, e.g.,: 12345678
- l_username - local user name, e.g.,: daniel
- l_domain - local domain, e.g.,: mysipserver.com
- r_username - remote username, e.g.,: daniel123
- r_domain - remote domain, e.g.,: sipprovider.com
- realm - remote relam, e.g.,: sipprovider.com
- auth_username - authentication username, e.g.,: daniel123
- auth_password - authentication password, e.g.,: xxxxxx
- auth_proxy - SIP address of authentication proxy, e.g.,: sip:sipprovider.com
When calls come in, you have to run uac_reg_lookup() that will detect if the call is coming from a remote SIP provider and can change the R-URI to local username@domain. Afterwards you can run location lookup.
if(uac_reg_lookup("$rU", "$ru")) {The documentation for uac module is available at:
xlog("request from a remote SIP provider [$ou => $ru]\n");
}
lookup("location");
No comments:
Post a Comment