This Question is Answered

2 "helpful" answers available (1 pts)
4 Replies Last post: Feb 16, 2009 5:54 AM by charlesboyo  
  3 posts since
Feb 14, 2009

Feb 14, 2009 9:23 PM

Recommended configuration for OSBC between softswitch and PSTN gateway


Hello all.


I have a CommuniGate softswitch that manages a bunch of SIP users. I am trying to integrate that to a PSTN (SS7/SIP) gateway which has some strict demands on the SIP headers.

Can OSBC assist with the rewriting and/or deletion of selected headers?


My setup is as follows:

softphone --> CGP --> OSBC --> PSTN Gateway

CGP has a public IP address while the PSTN Gateway has a private IP address. OSBC has one of each (two interfaces) and is able to select the appropriate interface (was configured with --enable-gpllibs)

OSBC is configured as B2B Only Mode and listening on both interfaces.

In the B2BUA-Routes page, I have:

Route-List := [sip:*@remote.pstn] sip:192.168.12.229

Insert-Route-Header := true

Rewrite-To-URI := true

Route-By-Request-URI := true

Route-By-To-URI := false

On the incoming leg, from CGP, the headers (without the SDP) are:

INVITE sip:08035737384@remote.pstn SIP/2.0
From: "016280008" <sip:016280008@mydomain.local>;tag=000000000197662-59F7BCFA-5123B7D6
To: <sip:08035737384@remote.pstn>
Via: SIP/2.0/UDP 61.13.33.54:5060;branch=z9hG4bK225842
CSeq: 1 INVITE
Call-ID: MzViOTkzNz-TXpWaU9Ua3pOem@MyCGP
Contact: <sip:signode-197662-5123B7D6@61.13.33.54>
Record-Route: <sip:61.13.33.54:5060;lr>
Record-Route: <sip:rev.194757.dialog.cgatepro;lr>
User-Agent: CommuniGatePro-callLeg/5.2.11
Expires: 60
Max-Forwards: 9
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, REFER
Supported: 100rel, timer, replaces, histinfo
Content-Type: application/sdp
Content-Length: 260


The OSBC perform gets the SDP perfectly, subsituting itself as the media node. The resultant headers are:

INVITE sip:08035737384@192.168.12.229 SIP/2.0
From: "016280008" <sip:016280008@mydomain.local>;tag=000000000197662-59F7BCFA-5123B7D6
To: <sip:08035737384@192.168.12.229>
Via: SIP/2.0/UDP 10.1.10.1:5060;iid=18622;branch=z9hG4bK560dea6a6ef9dd119fe4d6b001d5edf2;uas-addr=192.168.12.229;rport
CSeq: 1 INVITE
Call-ID: MzViOTkzNz-TXpWaU9Ua3pOem@MyCGP-0x000f
Contact: <sip:signode-197662-5123B7D6@10.1.10.1:5060>
User-Agent: OpenSBC v1.1.5-81
Expires: 60
Max-Forwards: 8
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, REFER
Supported: 100rel, timer, replaces, histinfo
Content-Type: application/sdp
Content-Length: 252


Note that the Request URI and To URI have indeed been re-written. However, the From URI remained just the same. The Contact header was also altered though the ":5060" is extraneous for the simple-minded SIP module on the PSTN gateway. That gateway expect something like this (manually generated):

INVITE sip:08035737384@192.168.12.229 SIP/2.0
Via: SIP/2.0/UDP 10.1.10.1:5060;branch=z9hG4bK560dea6a6ef9dd119fe4d6b001d5edf2;rport
From: "016280008" <sip:016280008@10.1.10.1>;tag=000000000197662-59F7BCFA-5123B7D6
To: <sip:08035737384@192.168.12.229>
Contact: <sip:016280008@10.1.10.1>
Call-ID: MzViOTkzNz-TXpWaU9Ua3pOem@10.1.10.1
CSeq: 1 INVITE
User-Agent: OpenSBC v1.1.5-81
Expires: 60
Max-Forwards: 8
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, INFO, MESSAGE, SUBSCRIBE, NOTIFY, PRACK, REFER
Content-Type: application/sdp
Content-Length: 252


So my questions are:

1. is it possible to rewrite the From URI?

2. Are the iid and uas-addr attributes on the Via absolutely neccesary, can they be suppressed?

3. Is it possible to rewrite the Contact header to exactly match the rewritten From URI? without the ":5060" appendage?

4. Can the domain part of the Call-ID be changed to match the source IP address of the OSBC, as found in the Via?

5. Can I completely suppress the "Supported" and any other non-required headers?


I'm sorry this request is quite long but I really want to know what is possible. In the event these changes are not in the roadmap, I would also appreciate guidance on how I can make them myself.


Regards,


Charles

Click to view joegen's profile   519 posts since
Apr 28, 2007
1. Feb 15, 2009 10:33 PM in response to: charlesboyo
Re: Recommended configuration for OSBC between softswitch and PSTN gateway
{quote:title=charlesboyo wrote:}{quote}

So my questions are:

1. is it possible to rewrite the From URI?

I have added Rewrite-From-Domain parameter in B2BUA-Routes. Try the latest from CVS.

2. Are the iid and uas-addr attributes on the Via absolutely neccesary, can they be suppressed?
iid is used for loop detection so you could probably just comment out the code where it is set.
BOOL SIPSession::SendRequest(
  const SIPMessage & request,
  SIPTransaction * transaction
)
{
.
.
.
/** Just comment out this line */
out.SetViaParameter( "iid", OString( m_InstanceId ) );

uas-addr parameter is used by the Media Proxy to determine where to send RTP packets when the UAS is behind NAT or OSBC is bridging accross a multihomed host. This state is vital to OSBC operation.

3. Is it possible to rewrite the Contact header to exactly match the rewritten From URI? without the ":5060" appendage?
Try the latest patch as well. I modified contact header format to not include the port if its 5060.

4. Can the domain part of the Call-ID be changed to match the source IP address of the OSBC, as found in the Via?
Sorry no. OpenSBC uses the call-id to match the B2BUA inbound and outbound legs

5. Can I completely suppress the "Supported" and any other non-required headers?
OpenSBC tries to be transparent as much as possible so that UA extended function like session timers maybe relayed to servers that do support them. If you want to strip particular headers you may do so in SBCOutboundCall.cxx. look for this function call.
void SBCOutboundCall::OnSetupOutbound(
  const SIPMessage & inboundInvite,
  B2BUAConnection & connection
)
{
  /** Just add this line before send request */
  invite.RemoveAllSupported();   ///  INSERT THIS
  invite.RemoveAllRecordRoutes();
 
  connection.OnOutgoingCall( *this, invite );
  m_CurrentUACInvite = invite;
  m_CurrentUASInvite.SetTransaction( NULL );
 
  SendRequest( invite );
}


I'm sorry this request is quite long but I really want to know what is possible. In the event these changes are not in the roadmap, I would also appreciate guidance on how I can make them myself.
Click to view joegen's profile   519 posts since
Apr 28, 2007
3. Feb 16, 2009 5:10 AM in response to: charlesboyo
Re: Recommended configuration for OSBC between softswitch and PSTN gateway
Try this.

Date now;
now.SetHeaderBody( ParserTools::GetRFC1123Date() );   
invite.SetDate(now);   /// Insert new Date: header to outgoing SIP message