Sansay Stir/Shaken NSS Integration Bash Script - Modified

There is a slight modification for the Sansay Bash script from the one that is posted on Freepbx. Sansay is $250 per month (if you provide your own VMWare server) vs Transnexus $500 per month…FYI

Here is the corrected script:

# Bash client to use Sansay NSS API with Asterisk
# version 1.0
# Script arguments are orig_tn and dest_tn as follows " 8587542200 8587542211"
# Generate unique Request ID
Request_ID=`echo $RANDOM | md5sum | head -c 20`
# Send Request to Sansay NSS
# sub actual url domain
curl --silent -k -X POST -H 'Content-Type: application/json' -H 'Accept: application/json' -H "X-RequestID: $Request_ID" -d "{\"signingRequest\":{\"orig\":{\"tn\":\"$1\"},\"dest\":{\"tn\":[\"$2\"]},\"iat\":$(date +%s)}}" | jq .signingResponse.identity | sed 's/\"//g; s/\\//g'

What is the change? What does it fix? Is this the page you reference in your post? Adding Stir/Shaken Attestation with Sansay NSS API - FreePBX Documentation - Documentation

"X-RequestID: $Request_ID"

was contained in single quotes in the original, and needed to be in double quotes to execute. This was a change by Sansay support. We have this running on Distro 16, with Asterisk 18.9. Hopefully if anyone else was scratching their head this will move them forward.

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.