Friday, May 22, 2015

Digit Transforms with Genesys SIP Server

Summary

In this article I'll demonstrate a simple digit translation using the dial plan feature in Genesys SIP Server (SIPS)

Implementation

For this scenario, I have a Sonus Session Border Controller (SBC) in front of Genesys SIPS.  The Sonus SBC by default prepends a '+1'  (e.164 format) on all calls going in/out of its trunk groups.  In this example, I'm going to use the SIPS dial plan feature to remove those two characters from the dialed number.

In Figure 1 below I've created a DN of type Voice over IP Service under the SIPS switch object.

Figure 1
In Figure 2, I created a TServer Section for this object and then added two options to that section:  dial-plan-rule-1 and service-type.

Figure 2
The dial-plan-rule-<n> option establishes a digit manipulation rule.  The service-type option signifies this is a dial-plan configuration (vs a Class of Service configuration).

SIPS translation rules roughly follow the Asterisk standard:

+1.=>${DIGITS:2}
  • On the left-hand side of the =>, I state our matching criteria.  In this case, a '+1' and then one or more following character will yield a match.
  • On the right side, I state our translation.  In this case, retain all the digits from position 2 in the string - dropping the first two characters.  Similar to C arrays, position numbering starts from 0.
After creating the dial-plan object, it needs to be assigned to an Agent Login, DN, or App level.  Figure 3 depicts the trunk object for the Sonus SBC.

Figure 3
Figure 4 shows the TServer section I created in the Annex for this trunk object.  I have the IP address of the SBC's media interface and an option specifying the dial-plan (sonusDialPlan) created back in Figure 2.

Figure 4

Below are some snippets of the Genesys SIPS log to see this dial-plan feature in action.  The SIPS extension/called party is 999-123-4567.  The caller is 5555.

Incoming Invite from the Sonus SBC:

11:02:35.281: SIPTR: Received [0,UDP] 1003 bytes from 192.168.1.21:5060
INVITE sip:+19991234567@192.168.1.69:5060;user=phone SIP/2.0
Via: SIP/2.0/UDP 192.168.1.21:5060;branch=z9hG4bK00B00006d2998922276
From: <sip:+15555@192.168.1.21;user=phone>;tag=gK00000184
To: <sip:+19991234567@192.168.1.69;user=phone>
Call-ID: 1_41283677@192.168.1.21
CSeq: 55481280 INVITE
Max-Forwards: 70
Allow: INVITE,ACK,CANCEL,BYE,REGISTER,REFER,INFO,SUBSCRIBE,NOTIFY,PRACK,UPDATE,OPTIONS,MESSAGE,PUBLISH
Accept: application/sdp, application/isup, application/dtmf, application/dtmf-relay,  multipart/mixed
Contact: <sip:+15555@192.168.1.21:5060>
P-Preferred-Identity: <sip:+15555@192.168.1.21:5060;user=phone>
Supported: timer,100rel,precondition,replaces
Session-Expires: 1800
Min-SE: 90
Content-Length:   189
Content-Disposition: session; handling=required
Content-Type: application/sdp

v=0
o=Sonus_UAC 1794294632 2031408208 IN IP4 192.168.1.21
s=SIP Media Capabilities
c=IN IP4 192.168.1.21
t=0 0
m=audio 1026 RTP/AVP 0
a=rtpmap:0 PCMU/8000
a=sendrecv
a=maxptime:10



Dial-plan executing:

11:02:35.284: SIPTR(432): Step 0 - SipTransactionCreateCall(433) complete
11:02:35.284: SIPTR(432): Begin step 1 - SipTransactionResolveCallInfoByDialPlan(434)
11:02:35.284: DialPlan:executing for dest +19991234567 - dial-plan-rule-1: +1.=>${DIGITS:2};calltype=inbound
11:02:35.285: DialPlan:Sending to target '9991234567' - type=1
11:02:35.285: DialPlan: clear flag DIAL_PLAN_PROCESSING
11:02:35.286: ProcessDialPlanResult: Connecting to device 9991234567.
11:02:35.286: SIPTS: New call: CallType overridden with 2 by context



Resulting SIP Invite that is ultimately sent to the SIPS registered end-point:

11:02:35.289: Sending  [0,UDP] 1094 bytes to 192.168.1.71:26144 >>>>>
INVITE sip:9991234567@192.168.1.71:26144;rinstance=0aa264f9d95b3d6a SIP/2.0
From: sip:+15555@192.168.1.21;user=phone;tag=008A0624-66D4-155B-B7A7-0100007FAA77-144
To: sip:9991234567@9991234567
Call-ID: 008A05C0-66D4-155B-B7A7-0100007FAA77-91@192.168.1.69
CSeq: 1 INVITE
Content-Length: 180
Content-Type: application/sdp
Via: SIP/2.0/UDP 192.168.1.69:5060;branch=z9hG4bK008A0660-66D4-155B-B7A7-0100007FAA77-136
Contact: <sip:+15555@192.168.1.69:5060>
Allow: ACK, BYE, CANCEL, INFO, INVITE, MESSAGE, NOTIFY, OPTIONS, PRACK, REFER, UPDATE
Accept: application/sdp, application/isup, application/dtmf, application/dtmf-relay,  multipart/mixed
P-Preferred-Identity: <sip:+15555@192.168.1.21:5060;user=phone>
Content-Disposition: session; handling=required
Max-Forwards: 69
X-Genesys-CallUUID: 028BE9J6QGALNDT704000VTAES00001A
Session-Expires: 1800;refresher=uac
Min-SE: 90
Supported: uui,100rel,timer

v=0
o=Sonus_UAC 1432141492 1 IN IP4 192.168.1.21
s=SIP Media Capabilities
c=IN IP4 192.168.1.21
t=0 0
m=audio 1026 RTP/AVP 0
a=sendrecv
a=maxptime:10
a=rtpmap:0 PCMU/8000

Copyright ©1993-2024 Joey E Whelan, All rights reserved.