Pass Network ID

Question:

How can OpenSIPS be configured to pass information in SIP INVITE message as source network ID device attribute to OSPrey server?

Answer:

OpenSIPS can be configured to pass arbitrary information in SIP INVITE message as source network ID device attribute to OSPrey server. The most common use case is to pass trunk group ID as source network ID device attribute to OSPrey server.

Configuration:

  • Passing a specific SIP INVITE message header as source network ID device attribute to OSPrey server.

    • Example SIP INVITE message from Sonus SBC

    • Example OpenSIPS configuration

      if (is_present_hf("P-Source-OTG")) {
        $avp(snid) = $hdr(P-Source-OTG);
      }
      
  • Passing SIP INVITE message request URI tgid parameter as source network ID device attribute to OSPrey server.

    • Example SIP INVITE message from Cisco and Acme/Oracle SBC

    • Example OpenSIPS configuration

      if ($(ou{uri.params}{param.exist,tgid})) {
        $avp(snid) = $(ou{uri.param,tgid});
      }
      
  • Passing SIP INVITE message From header URI otg parameter as source network ID device attribute to OSPrey server.

    • Example SIP INVITE message from Metaswitch CFS and Sonus SBC

    • Example OpenSIPS configuration

      if ($(fu{uri.params}{param.exist,otg})) {
        $avp(snid) = $(fu{uri.param,otg});
      }
      
  • Passing SIP INVITE message Contact header URI user tgrp parameter as source network ID device attribute to OSPrey server.

    • Example SIP INVITE message from Sansay SBC

    • Example OpenSIPS configuration

      if (is_present_hf("Contact")) {
        if ($(ct.fields(uri){uri.user}{param.exist,tgrp})) {
          $avp(snid) = $(ct.fields(uri){uri.user}{param.value,tgrp});
        }
      }
      

Post configuration:

  • Any time that you make any changes to the opensips.cfg file, the OpenSIPS application must be restarted for the changes to take effect.

    $ pkill -9 opensips
    

    The application will restart within one minute. The restart script runs every minute from user ospadmin’s crontab schedule.