RFC 3398 Support with OpenSER

From Etel

Jump to: navigation, search

Contents

Title

RFC 3398 Support with OpenSER

Problem

When OpenSER is used as a Class 5 switch and needs to control a Class 4 gateway connected to the PSTN via SS7, it sometimes needs to specify a Carrier Identification Code (CIC). According to RFC 3398, the cic= parameter can be appended to the SIP URI. If used with a compliant Class 4 gateway, one can pass this Carrier Identification Code to the PSTN/SS7 via SIP from OpenSER!

Solution

Place the following block of code before the call is routed to your SS7 gateway:

avp_printf("$avp(s:cic)", "+15062"); # Set the cic value in an AVP

if (subst_uri('/^sip:([0-9]+)@(.*)$/sip:\1;cic=$avp(s:cic)@\2/i')) {
  xlog("Added CIC $avp(s:cic) to RURI"); # tell us about it
};

Discussion

This code gives the basics for RFC 3398 support in OpenSER and URI manipulation in general. The user can supplement this code with anything they wish - conditionals based on destination, DB lookups for different CICs, etc.

See Also:

http://www.openser.org/docs/modules/1.2.x/textops.html

http://www.ietf.org/rfc/rfc3398.txt

Metadata

  • By: Kristian Kielhofner
Personal tools