Basic Integration Testing

Test 1: Route Advance, Phone Number Format

ClearIP returns a default response code (SIP 503 or SIP 404) for the switch or SBC to route advance the call if ClearIP has not been configured to block the call, return a routing destination, perform STIR/SHAKEN, or return specified data fields in the SIP response.

You can test receiving a SIP 503 or SIP 404 from ClearIP by doing the following:

  1. Send a test call to ClearIP. If testing outbound calls to ClearIP, you can generally make a test call to any long distance number.
  2. Open the Analytics menu and go to the SIP Messages page. SIP Messages
  3. The test call should appear in the page very quickly within a second of the call reaching ClearIP. Refresh the page if needed. Check the following:
    • The Code field displays a 503 or 404 for the test call.
    • The switch or SBC is able to successfully route advance the call to the configured alternate or backup route.
    • The Translated Calling Number and Translated Called Number fields display the phone numbers in E164 format without the leading +. In the screenshot below, a test call was made to +1-404-526-6060 which is correctly displayed as 14045266060.
    • A single call record appears in the SIP Messages page for each test call placed. SIP Messages 503
  4. Click on the Show button to view the raw SIP Invite Request received from the SBC and SIP Response returned by ClearIP. SIP Messages 503 Show

Troubleshooting:

  1. If you do not see any records appear in the SIP Messages page after placing a test call, then verify whether the correct SBC public IP address was whitelisted and check the call trace from the switch or SBC to see whether the test call was sent to ClearIP.

  2. If you see multiple SIP Message records appear per call attempt reaching ClearIP, then you can try to change the ClearIP response code to SIP 404 or SIP 302 to enable route advance. See the SBCs page for additional information.

  3. If you see the Translated Calling Number or Translated Called Number does not have E164 format, then you can configure number translation rules to normalize the number format or configure your switch or SBC to send the correct number format. See the Number Translation page for additional information.

  4. If you see either the Translated Calling Number or Translated Called Number field is blank, then ClearIP does not recognize the number format as valid. You should check the format of the SIP Invite headers by clicking the Show button.

The headers must have a general format of a SIP URI with a user@host with optional ports, tags, and parameters all enclosed in angle brackets. ClearIP does not support Tel URI.

  • Called telephone number is defined by the Request URI user.

  • Calling telephone number is defined by one of the following (ordered from highest priority)

    • “Diversion” header user
    • “P-Asserted-Identity” header user
    • “Remote-Party-ID” header user
    • “P-Charge-Info” header user
    • “From” header user

Here is an example SIP Invite for a forwarded call. The called number is defined by the request URI user. The calling number is defined by the Diversion header. If the Diversion header is not present, then the calling number is defined by the P-Asserted-Identity header. SIP Request Phone Number

Examples of invalid headers:

  1. Header is missing user
P-Asserted-Identity: <sip:199.242.63.40>
  1. Header contains Tel URI
P-Asserted-Identity: <tel:4056934230>
  1. Header is missing host
P-Asserted-Identity: <sip:8144982241>

Test 2: Block on SIP 603 Decline

If ClearIP is configured to block a call due to a blacklist rule, toll fraud prevention, robocall prevention, etc., then ClearIP can return a SIP 603 Decline to block the call. The switch or SBC must be configured to block a call when receiving a SIP 603 Decline and not route advance.

You can test receiving a SIP 603 Decline from ClearIP by doing the following:

  1. Open the Whitelist/Blacklist menu and go to the Called Numbers page. Whitelist Blacklist Menu
  2. Click the green Add button to open the following text box. Enter the called number that will be blacklisted using E164 format without the leading +. Set the Action to Blacklist and submit the changes. The rule takes effect immediately. Any calls to the blacklisted number will be blocked. Blacklist Modal
  3. Make a test call to the blacklisted number.
  4. Check whether the call is blocked by the switch or SBC.
  5. Go to the SIP Messages page.
  6. Check that the Code is 603 and the Reason is listed as Blacklisted. SIP Messages 603
  7. Delete the blacklist rule once this test is finished.

Test 3: Route Advance on SIP 403 Forbidden

In case ClearIP returns a SIP 403 Forbidden response, we recommend that your switch or SBC be configured to route advance the call upon receiving a SIP 403 Forbidden.

Possible reasons for seeing a SIP 403 Forbidden response:

  • SBC IP address is misconfigured
  • SBC IP address changes from initial value
  • Account Rate Limit is exceeded
  • SBC Status is set to Inactive
  • No matching User is found

NOTE: This test should not be performed if the SBC is sending production traffic to ClearIP. Any changes made on the SBCs page may require up to 60 seconds to take effect.

You can test receiving a SIP 403 Forbidden from ClearIP by doing the following:

  1. Open the Organization menu and go to the SBCs page.
  2. Select the SBC used for testing and click Update. SBC Select
  3. Set Status to Inactive and submit changes. ClearIP now returns a SIP 403 Forbidden for all calls from this SBC. SBC Inactive
  4. Send a test call.
  5. Go to the SIP Messages page.
  6. Check that the Code is 403. SIP Messages 403
  7. Check whether the switch or SBC was able to route advance the call.
  8. Set the SBC Status back to Active once this test is finished. SBC Active

Test 4: Routing on SIP 302 Moved Temporarily

ClearIP can return a list of routes in the Contact header of the SIP 302 response which the SBC can follow to redirect the call.

  1. Go to the SBCs page.
  2. Update the SBC. Set Routing to Yes and submit. SBC Routing
  3. Open the Routing menu and go to the Inbound Routes page. The rules configured in the Inbound Routes page can apply to both inbound and outbound calls. Inbound Routes
  4. Click on Add to create a new Inbound Route.
  5. Set the Primary Route Destinations field to the IP address or FQDN of the desired destination or termination carrier. This destination should not be set to the first backup termination carrier. For example, if the switch routing is configured to send outbound calls first to ClearIP, then failover to Carrier 1, and then failover to Carrier 2, then we want to use the IP address of Carrier 2 here to test that ClearIP routing is followed instead of the switch routing.
  6. You can set the Prefix field to the number you plan to call.
    Inbound Route Modal
  7. For netsapiens users running v41 or higher, you must enter “lcr” in the Primary Route Prefix. This is required to route the call correctly. If a Secondary Route Destination is configured, then you must also enter “lcr” in the Secondary Route Prefix field as well and so on for each Route Destination level. LCR Prefix
  8. Send a test call to the phone number configured for the test routing rule.
  9. Verify in a call trace on the switch or SBC that the call was routed to the expected destination.
  10. Verify in the SIP Messages page, ClearIP returned a SIP 302 message. SIP Messages 302
  11. Click on the blue Show button for the test call. Scroll down to the SIP Response, and verify that the Contact header of the SIP 302 returns the configured IP address or FQDN as the host.
SIP/2.0 302 Moved Temporarily
Via: SIP/2.0/TLS sip.clearip.com:5061;branch=z9hG4bK894a.c94c9db7b4b742aa718276b049d0ddab.0;i=fd7f0aa6;received=::ffff:10.0.14.50
Via: SIP/2.0/TCP 192.168.1.89:3000;received=18.208.235.205;branch=z9hG4bK-4533-1-0
To:  <sip:14045266060@1.2.3.4:5060>;tag=b053b61b-0040-4a32-ba43-ca830ca6d097
From:  <sip:14047884802@192.168.1.89:3000>;tag=1
Call-ID: 1-4533@192.168.1.89
CSeq: 1 INVITE
Contact: <sip:14045266060@1.1.1.1>;q=0.99
Reason: SIP;cause=302;text="no-fraud-detected"
Content-Length: 0

Netsapiens users should confirm that “lcr” is prepended to each phone number in the Contact header:

SIP/2.0 302 Moved Temporarily
Via: SIP/2.0/TLS sip.clearip.com:5061;branch=z9hG4bK60bb.a61260dc51a270278712822e2ef117eb.0;i=15205ea2;received=::ffff:10.0.13.112
Via: SIP/2.0/TCP 192.168.1.89:3000;received=18.208.235.205;branch=z9hG4bK-4547-1-0
To:  <sip:14045266060@1.2.3.4:5060>;tag=c3782ec4-dc99-4075-8c6c-cdfa66a3b753
From:  <sip:14047884802@192.168.1.89:3000>;tag=1
Call-ID: 1-4547@192.168.1.89
CSeq: 1 INVITE
Contact: <sip:lcr14045266060@1.1.1.1>;q=0.99
Reason: SIP;cause=302;text="no-fraud-detected"
Content-Length: 0
  1. Delete the Inbound Route when you are finished with the test.

Test 5: STIR/SHAKEN Authentication

ClearIP can be used to test STIR/SHAKEN Authentication on outbound call to generate an Identity header and return it in the SIP 302 response.

ClearIP allows you to test STIR/SHAKEN using a test certificate if your organization has not yet been approved by the STI-PA. With the test STI certificate, the attestation level is limited to C regardless of the attestation level selected in the Action field.

If your organization has been approved by the STI-PA, then you can configure ClearIP to generate STI certificates. See the Certificates section.

  1. Go to the SBCs page.

  2. Update the SBC to select the appropriate format for the Identity header if necessary. See the SBCs section for additional information about Identity header format options.

    If ClearIP is integrated directly with a netsapiens to implement STIR/SHAKEN authentication, then the SBC must be updated to set the Routing field to Yes.

  3. Open the STI menu and go to the Authentication Policies page. Authentication Policies

  4. Click on Add to create an STI Authentication policy. Set Action to Attest C, Method set to In-Band, and leave the Certificate field blank to use the test certificate. Restrict the policy to apply to outbound calls by selecting the appropriate Operator or Service Provider field. Submit the changes. Authentication Test

  5. Send an outbound test call.

  6. Go to the SIP Messages page.

  7. Click on the Columns button to select STI Authentication. This displays all columns related to STI Authentication.
    Authentication Columns

  8. Verify the STI Authentication Status field for the call shows Successful.

  9. Click on the Show button and verify the following:

    • ClearIP returned a SIP 302 Redirect with an Identity header.
    • The STI Authentication Token tab shows the correct orig tn, dest tn, and attest values.
    • The STI Authentication Certificate tab shows the STI Certificate used to authenticate the call. Show STI Authentication Token
  10. View the call trace to verify:

    • The SBC inserts the Identity header into the SIP Invite.
    • The SBC routes the SIP Invite with Identity header to the correct route destination.

The SBC must be configured to copy the Identity header from the SIP 302 response and insert it into the SIP Invite sent to the termination carrier. In the call trace, you should confirm whether your SBC is inserting the Identity header into the outgoing SIP Invite.

Here is an example SIP Invite containing the Identity header which is sent to a termination carrier.

INVITE sip:18038371753@2.2.2.2 SIP/2.0
Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bKEC001QwRn3bWxAmK00054B
Accept-Language: en
Call-ID: 20210525181701061349-fdfb330c3636fe678da0ef730a5daae7
Contact: <sip:8039373338@1.1.1.1:5060;transport=udp>
CSeq: 201 INVITE
From: <sip:18039373338@1.1.1.1>;tag=LgTdPYBHBRDUcv2S00054A
Max-Forwards: 20
To: <sip:18038371753@2.2.2.2>
Date: Tue, 25 May 2021 18:17:01 GMT
Server: NetSapiens SiPBx v41-2-4
Identity: eyJhbGciOiJFUzI1NiIsInBwdCI6InNoYWtlbiIsInR5cCI6InBhc3Nwb3J0IiwieDV1IjoiaHR0cHM6Ly9jZXJ0aWZpY2F0ZXMuY2xlYXJpcC5jb20vdHJhbnNuZXh1cy9jM2E5ODQ5MGFjNzIxNmYzOGI5ZWE4ZmRmMjNmN2VkMy5jcnQifQ.eyJhdHRlc3QiOiJDIiwiZGVzdCI6eyJ0biI6WyIxODAzODM3MTc1MyJdfSwiaWF0IjoxNjIxOTY2NjIxLCJvcmlnIjp7InRuIjoiMTgwMzkzNzMzMzgifSwib3JpZ2lkIjoiMDVjNjkwYWQtNTM3OC00MjdmLWFjNzgtMTkxOGUxZWU3YjU5In0.CgumLyyBzKZ7T2UQxSC5bAexHY1qlWDD6xXGPH3ztVv5uECbFPYEs3T9QilPwsROB0jaCHxQYH-GVBeXNgAw5Q;info=<https://certificates.clearip.com/transnexus/c3a98490ac7216f38b9ea8fdf23f7ed3.crt>;alg=ES256;ppt=shaken
Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, OPTIONS, UPDATE, PRACK, SUBSCRIBE, INFO, PUBLISH
Allow-Events: talk, hold, conference, LocalModeStatus
Content-Type: application/sdp
Content-Length: 262

v=0
o=NetSapiens_Nms 1621966621 1621966621033 IN IP4 72.1.48.202
s=SIP Call
c=IN IP4 72.1.48.202
t=0 0
m=audio 27808 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=silenceSupp:off - - - -
a=fmtp:101 0-15
a=ptime:20
a=sendrecv