web statisticsweb stats

Business Phone Systems

Previous Thread
Next Thread
Print Thread
Rate Thread
#575924 08/15/14 09:23 AM
Joined: Aug 2012
Posts: 19
Member
Member
Offline
Joined: Aug 2012
Posts: 19
Is there any way I can monitor how many B channels are used on our PRI? I have a CIX 670. It appears we are running version: AR5.20 MT061.00

Thanks!

Atcom VoIP Phones
VoIP Demo

Best VoIP Phones Canada


Visit Atcom to get started with your new business VoIP phone system ASAP
Turn up is quick, painless, and can often be done same day.
Let us show you how to do VoIP right, resulting in crystal clear call quality and easy-to-use features that make everyone happy!
Proudly serving Canada from coast to coast.

Joined: Mar 2013
Posts: 27
Member
Member
Offline
Joined: Mar 2013
Posts: 27
Not in an easy to read way. You can connect via serial to the d channel port on the BPTU and view the d channel data through either hyperterminal or maybe Digitrace. It's not an easy to read format, since it is just all the d channel information. There used to be a program a guy designed that put all this information into a nice gui with realtime view. He no longer distributes it and I've since lost my copy due to hard drive failure. Oh cloud backup, where were you 10 years ago!

Joined: Jun 2005
Posts: 2,721
Likes: 7
Member
Member
Joined: Jun 2005
Posts: 2,721
Likes: 7
I think Digitrace wasn't that much better then Hyperteminal. The 3rd party PRI Tracer was great. Toshiba should have added something like that to emanager.

Last edited by newtecky; 09/13/14 12:05 AM.
Joined: Jun 2003
Posts: 3,273
Likes: 1
Moderator-Toshiba
*****
Moderator-Toshiba
*****
Joined: Jun 2003
Posts: 3,273
Likes: 1
You can use a call accounting software like Tapit or Ultimate Call Accounting. Tapit has a 30-day free trial and supports IP SMDR.

Joined: Aug 2012
Posts: 19
Member
Member
Offline
Joined: Aug 2012
Posts: 19
I wanted to say thank you for helping me with this. I was able to get a serial line hooked up to the phone system and write a script which tracks the number of calls in use.

I wrote the script in Powershell and it seems to work fine for me. It outputs the number of concurrent calls into a file (Line 132, you can change it if you want). It also outputs all the input it receives from the serial port into a file (Line 134). Comment it out if you don't want to see it. I use it for debugging purposes (If something goes wrong, I can look back and see what input it received).


Some background on the script: The serial port from the PRI card outputs Q. 931 (Signalling protocol for the D channel on a PRI). Anyway, it keeps track of the calls with a CR (Call Reference I believe). Each side choses its own CR numbers. Since it is possible both sides could reuse the same CR number, with Q.931, the first bit in the CR number is set to 1 if the call originated from the other end or 0 if it originated locally (So if you make an outbound call, it will always have a CR number of 0x7FFF or lower when you are referencing the call. If the call came into you it will always have a CR number of 0x8000 and higher when you are referencing the call).

The MT stand for Message Type. It tells us what we are doing with the call. The script looks for disconnects in the DISC, REL, and REL COMP message types. I've seen a couple of instances where I never see a DISC message, so I can't track on this one message type. The script looks for new calls in the SETUP message type.


When you first run this script you will receive errors about Multiple Disconnects received for a session. This is because we don't have a record for this session yet (Because you started the script after the call was initiated). These are safe to ignore. You may also see it occasionally when two sessions nearly the exactly same instance. It is because their DISC, REL, REL COMP messages for their sessions are intertwined and can be ignored.

You may also need to change line #9 to the proper COM port.

Please let me know if you have any questions ---- I may not respond in a timely manner as I don't check these forums regularly.

I will post the code in the very next post. Copy and paste it into a file and save it with the "PS1" extension and you should be able to run it directly with Powershell. I would attach the file but for some reason the forums have a 2 byte limit (So 2 text characters) on attachments.

Joined: Aug 2012
Posts: 19
Member
Member
Offline
Joined: Aug 2012
Posts: 19
Quote
sleep 120 #I'm sleeping here because I have to wait for my COM port to become available after the system boots.

Write-Host "Done Sleeping!"
$sessions = @{} #Where we store CR numbers for our concurrent calls
#Incoming calls are stored with a value of X8000 and greater
#Outgoing calls are stored with a value of lower than X8000
#Our numbers should match when we are transmitting. They may need to be changed when we are receiving
$port= new-Object System.IO.Ports.SerialPort COM3,9600,None,8,one

$port.Open()

while($line = $port.ReadLine() )
{
if ($line -match "^\\d\d\;\d\d'\d\d\d\s+(\S\S)\s*\:")
{
#We need to check if we are transmitting a message to them or if they are transmitting a message to us. This helps us determine if a call is incoming or outgoing or if we are hanging up on them or them on us.
if($matches[1] -eq "Rx")
{
$transmit = $false
} else
{
$transmit = $true
}
} elseif($line -match "^\s+CR\s=\s\d\d\s(\S+)")
{
$cur_session = $matches[1]
$cur_session = $cur_session.ToUpper()

#$cur_session = [convert]::toint32($matches[1],16)

#if($cur_session -gt 32767)
#{
# $cur_session = $cur_session - 32768
#Its hex value was greater than 0x8000, so we are subtracting 0x8000
# }
# $hex_session = [convert]::tostring($cur_session,16)

} elseif ($line -match "^\s+MT\s=\sSETUP")
{
if($transmit -eq $false) #EVERY SETUP with always have an original ID of less than X8000 -> However, if the call is incoming (I.E. We had an RX line before this), we need to add X8000 to the value
{ #This is an incoming call
$dec_session = [convert]::toint32($cur_session,16)
$dec_session = $dec_session + 32768
$hex_session = [convert]::tostring($dec_session,16)

if($sessions.ContainsKey($hex_session))
{
Write-Host "Detected a second session ID connect with same ID!" -foregroundcolor red
Write-Host "Session ID was $hex_session."
} else {
$sessions.Add($hex_session, $true)
Write-Host "Incoming Call Detected for $hex_session" -foregroundcolor yellow
}
} else {
#This is an outgoing call
$dec_session = [convert]::toint32($cur_session,16)
if($dec_session -gt 32767) #This should never happen
{ Write-Host "WARN! WARN! WARN! Tried to setup a session with original session ID greater than X8000!!!! Session was $cur_session" -foregroundcolor red }

if($sessions.ContainsKey($cur_session))
{
Write-Host "Detected a second session ID connect with same ID!" -foregroundcolor red
Write-Host "Session ID was $cur_session."
} else {
$sessions.Add($cur_session, $true);
Write-Host "Outgoing call Detected for $cur_session" -foregroundcolor yellow
}
}
$cur_calls = $sessions.Count
Write-Host "Phone Lines Used: $cur_calls" -foregroundcolor green
Write-Host ($sessions.GetEnumerator() | Out-String)
Date
echo $sessions.Count > E:\PhoneSystem\Calls
} elseif ($line -match "^\s+MT\s=\sDISC" -OR $line -match "^\s+MT\s=\sREL")
{
if($transmit -eq $true)
{#We are hanging up on them -- We don't need to translate our session IDs!
if($cur_session -ne $sess_term) #This prevents us from printing warning messages on every call that has DISC,REL, and REL COMP message types
{
if($sessions.ContainsKey($cur_session))
{
$sessions.Remove($cur_session)
Write-Host "Call Removed for $cur_session" -foregroundcolor blue
$cur_calls = $sessions.Count
Write-Host "Phone Lines used: $cur_calls" -foregroundcolor green
Write-Host ($sessions.GetEnumerator() | Out-String)
$sess_term = $cur_session;
Date
} else {
Write-Host "Detected a previously disconnected call for $cur_session !" -foregroundcolor red
$sess_term = $cur_session;
}
}
} else { #We are receiving the hangup --- We have to translate these to our table

$dec_session = [convert]::toint32($cur_session,16)
if($dec_session -gt 32767)
{ #We initiated this call, so we need to subtract X8000 hex
$dec_session = $dec_session - 32768
} else { #They initiated, Add X8000 hex
$dec_session = $dec_session + 32768
}
$hex_session = [convert]::tostring($dec_session,16)
if($dec_session -lt 16)#We need to add 0's to the beginning
{
$hex_session = "000" + $hex_session
} elseif($dec_session -lt 256) {
$hex_session = "00" + $hex_session
} elseif($dec_session -lt 4096) {
$hex_session = "0" + $hex_session
}
$hex_session = $hex_session.ToUpper()
if($hex_session -ne $sess_term) #This prevents us from printing warning messages on every call that has DISC,REL, and REL COMP message types
{
if($sessions.ContainsKey($hex_session))
{ #Disconnecting normally
$sessions.Remove($hex_session)
Write-Host "Call Removed for $hex_session" -foregroundcolor blue
$cur_calls = $sessions.Count
Write-Host "Phone Lines Used: $cur_calls" -foregroundcolor green
Write-Host ($sessions.GetEnumerator() | Out-String)
$sess_term = $hex_session;
Date
} else { #We didn't find the call in our database!
Write-Host "Multiple disconnects for $hex_session found!" -foregroundcolor red
$sess_term = $hex_session;
Date
}
}
}
echo $sessions.Count > E:\PhoneSystem\Calls
}
echo $line >> output_phonesystem
}

$port.Close()


Moderated by  Carlos#1, phonemeister 

Link Copied to Clipboard
Newest Topics
Change desi-less label from a phone
by Yoda - 02/26/25 06:26 PM
SBX IP320
by johnp - 02/18/25 03:02 PM
SMT-i5210 SOFTWARE
by NateBates - 02/14/25 02:47 PM
Bogen amp keeps tripping reset
by Yoda - 02/12/25 12:40 PM
Forum Statistics
Forums84
Topics94,490
Posts639,855
Members49,833
Most Online5,661
May 23rd, 2018
Newest Members
hayl, kosia, LJetronic, CLKAHCK, B. Vignesh
49,833 Registered Users
Top Posters(30 Days)
dexman 11
Toner 9
Yoda 5
pvj 5
johnp 4
Who's Online Now
4 members (justbill, Bushmills, Toner, juno), 675 guests, and 45 robots.
Key: Admin, Global Mod, Mod
Contact Us | Sponsored by Atcom: One of the best VoIP Phone Canada Suppliers for your business telephone system!| Terms of Service

Sundance Communications is not affiliated with any of the above manufacturers. Sundance Phone System Forums - VOIP & Cloud Phone Help
©Copyright Sundance Communications 1998 - 2025
Powered by UBB.threads™ PHP Forum Software 8.0.0