[SR-Users] Integration with Broadsoft and Config Question

Daryn Johnson djohnson at telnetww.com
Fri Sep 16 15:32:23 CEST 2016


I’m looking to briefly check the sanity of my configuration. I have been
working w/Kamailio the last few months, and have read the SIP router ebook.
Thank you for your efforts and the documentation. It has been a GREAT HELP!

We are attempting to replace an Acme Packet SBC, and our setup is as
follows:

|ACCESSUSERS| ⇔ |KAMAILIO/SEMS| ⇔ |BROADSOFT| ⇔ |GENBAND| ⇔ |PSTN|

Kamailio & SEMS are (currently) on the same box, and communicate using
localhost via different ports. They also listen on the same private (core)
IPs, using different ports.

Since Broadsoft doesn’t support the PATH header, I manipulate the contact
header w/the SEMS privateIP & port in the contact header. This causes it to
be stored in the Broadsoft Registration string, and calls from PSTN route
directly to SEMs to start calls etc… Registraton code looks like this:

route[REGISTRATION] {
           remove_hf("Route");
           add_path_received();
           $avp(contact) = $ct;
           xlog("L_INFO", "found contact header $avp(contact)");
           setflag(FLAG_REGISTRATION);
           if (nat_uac_test("20")){
               xlog("L_INFO", "[REGISTRATION_ATTEMPT] [FROM_NAT] R=$ru
ID=$ci UA='$ua'\n");
               force_rport();
               remove_hf("Contact");
               append_hf("Contact: <sip:$fU" + "@" +
"!SEMSPRIVATEIP!:5060;" + "alias=$si~$sp~1>\n");
               setflag(FLT_NATS);
                   }
           else {
               xlog("L_INFO", "[REGISTRATION_ATTEMPT] [PUBLIC_IP]
\r\n[REGISTRATION_INFO] R=$ru UA='$ua'\r\n");
               remove_hf("Contact");
               append_hf("Contact: <sip:$fU@" +
"!SEMSPRIVATEIP!:5060;" + "alias=$si~$sp~1>\n");
           }
           $du = "sip:R_IP:REGISTRAR_PORT";
           t_on_reply("REG");
           route(RELAY);
           exit;
}

Then in the relay route, I force the registration out of the private
interface & port of Kamailio

     if (isflagset(FLAG_REGISTRATION)){
           $fs = "LISTEN_UDP_PRIVATE";
           }

Finally, if a registration is successful from BROADSOFT, I store it in the
location table, to allow me to screen calls from access to ensure they are
‘registered’

onreply_route[REG]{
           if(status=="200") {
               xlog("L_INFO", "REGISTRATION BE GOOD FOR $fu");
               save("location", "0x04");
                   }
}

Calls from ACCESS, I check USRLOC for screening, then pass the call to SEMS
via the localhost:port. From there, sems enacts the B2BUA/SBC module and
routes the call to BROADSOFT, and along to our GENBAND Gateway… I could
never get calls to work properly without SEMS, just using RTP PROXY/ENGINE,
possibly because the RTP for the GENBAND & KAMAILIO/SEMS are on different
private subnets. Our setup is fairly legacy ‘heavy’ and many things can’t
be changed.

Calls from PSTN route to GENBAND, then BROADSOFT, then SEMS, then KAMAILIO.
Since I have manipulated the contact header, BROADSOFT maintains that in
the INVITE and I can use the ‘handle_ruri_alias’ to route the call
properly. SEMS sets the PUBLIC IP of the KAMAILIO/SEMS box in the SDP, and
facilitates rtp relaying.
​​

if (isflagset(FLAG_TOUSER)){
               xlogl("L_INFO", "TOUSERFLAGSET");
               if(is_method("INVITE|BYE")){
                   handle_ruri_alias();
               }
           /*if(has_body("application/sdp") && nat_uac_test("8"))
           {
           fix_nated_sdp("10");
           xlog("L_INFO", "SDP CONTAINS NAT");
           }*/
           $fs = "LISTEN_UDP_PUBLIC";
           }

I’ve gone headlong into this setup,
​and it works! ​

​But, I ​
wanted to get a ‘Sanity Check’ to determine if there is a better way to do
this. We are at the point where I’m doing load testing and attempting to
validate this for a ‘production’ ready state. If possible, I’d just like to
ask the community if they have encountered a similar setup, and how they
solved it?

Thanks in advance!!!

Daryn Johnson
Senior VoIP Engineer

248.485.1109

www.telnetww.com
1175 W. Long Lake Rd. | Suite 101 | Troy, MI 48098
​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20160916/203fef82/attachment.html>


More information about the sr-users mailing list