Monday, December 4, 2017

DIY Camera JIB build

Project highlights
  • $300 in materials
  • Modular length adjustable from 8' - 21' reach
  • Stable, self leveling PTZ head/camera platform
  • Handle 5 lb camera
  • Professional in construction and safety - 100% metal.  No wood 
  • Suitable for live TV broadcast.
  • Off the shelf parts from a hardware store
Finished product showing length 15 feet
This application used a Sony PTZ self contained camera system.


JIB TEST VIDEO


This boom's operation has been really smooth.
The boom of the jib is made from galvanized 1 7/8" fence post pipe with 1 5/8" galvanized fence post pipe acting as pins to to hold it all together.  The result is a solid double pipe boom arm.

THE MAIN BOOM

The entire boom can be pretty much built with items purchased from a typical hardware store like Lowes or Home Depot equivalents. Some clamps and pipes used in this article were on hand already, but substitutes can be easily found.

Some of you will stop reading at this point, loosing interest that its not durable or just flimsy.  This thing is solid, relatively easy to assemble and strong.  There is nothing chintzy about it.



The main exterior body of this jib boom is made of 1 7/8" galvanized pipe intended to build chain link fences. It was purchased in pre-cut, pre-painted black, 7'6" lengths for about $15 each.

Below you see the jib with the section lengths marked for visual references.

To allow easy transport, the boom's interchangeable sections come lengths of 4', 6' and 7'6".  Its been used to a reach from about  8' to 21' reach from the fulcrum point.

Each boom section uses a slightly narrower 1 5/8" pipe that are 4' long each and are inserted into the main boom to increase structure strength and used as "pins" to connected the various sections together.

The picture below is of a prototype pipe that was about 5' long (vs finished 4') hence the uneven length.  The red line indicates the actual 4' length.



Bolts are used with washers located top and bottom.  Washers reduce scratches that the bolts and nuts will do in the surface of the pipe.

The significance of the uniform method of measuring the holes at each end of the boom and pins means boom extensions can be assembled easily like building blocks.  Each section will fit together with another without fussing around with it.

Here you see the sections being connected together.  We've since reduced the bolt lengths



The main 7’6” boom section that attaches to the tripod has to bear a lot of weight.  Taking that into account, another 7'6" of 1 5/8” pipe is inserted into it.  This smaller diameter pipe is effectively sandwiched in to add structural support of the fulcrum boom without affecting the required additional counterweight at the back.  Holes in it are drilled to align with the fulcrum and other bolts to go through it.

This smaller inserted pipe is not completely inserted.  Approximately 18” of it is extended out the front.  This acts as the first primary attachment point for the first section of boom being connected.


A fulcrum hole drilled at the 4' (measure from back of jib) point the boom, matching the size of the now removed dolly wheel axle point is used as the fulcrum point. The 3'6 in front of the fulcrum signifies the beginning of the actual boom.

In this picture the 3/4 bolt going through the main boom pipe, white plastic spacers are keeping everything centered.



The bolt used is not threaded for its entire length.  The pipes fulcrum point is on the smooth section of the bolt to ensure smooth booming up and down of the jib without thread grooves affecting the motion.


The hole for the boom to mount to the pivot point (fulcrum) is critical to get drilled right.  If not drilled perfectly horizontal, the entire jib would be off rotation and boom up/down at an angle that might be undesirable. A jig was used (pictured below) in conjunction with a drill press to ensure the holes were drilled completely "square".  There is a picture of the jig towards the bottom of this post.  It was about $15 and worth every single penny.

GUY WIRES

As the boom is extended out the weight of it will cause it to sag in an arch. This can cause significant unwanted movement and control problems. This is a safety concern of it collapsing.  Its also very visually unsettling.

To counter act the pull of gravity on the boom, guy wires are utilized extending from a 2' vertical mast to various points on the boom front and back. Approximately 6" in front of the fulcrum a threaded 3/8" steel road is mounted through the boom pipe with a series of bolts to ensure its secure. In this jib, a black piece of pipe was used around the rod, in this construction it provided some more vertical stability, and a uniformed black look. The rod that goes through the main boom is held into place by both a clamp, some bolts, and the downwards force place on by the bolt and shackle at the top, and the eventual cable forces applied to it.





Guy wires are attached at each connection point of the boom through an eye bolt and back to the mast. The wires are 1/8 braided steel cable, carbines on one end to speed up connection and turnbuckles at the other end to adjust tension individually. An eye hook doubles as a bolt for each boom section at the 4” point, and the guy wire hooks onto it. The turnbuckle allows for tension adjustments of the boom to remove any sag or bounce.

These cables and turnbuckle adjustments can take some of the load from the main boom and keep it straight. An additional cable going from the mast in the opposite direction back to the main weight bar provided the counter pull action, the resulting in the mast remaining evenly at a 90 degree angle to the boom arm at all times with relatively equal pull in both directions being provided. Performance improvement of the crane with these cables is very noticeable. Locking clamps keep the loops in place.



When the boom is extended, especially 15' and longer, with proper adjustment of the tension on the guy lines, the boom is very very straight and very little up/down bounce (if any really).

COUNTER WEIGHTS

For counter weights at the operator end of the main boom, a 1/2" x 3' square box steel rod is used hold the weights at the very end of the jib arm. Although its sqaure, it would still fit through the hole of the weights. Its held in the boom using a 5/8 bolt and the rear guy wire eyebolt goes through it. The end of it has several additional holes to accommodate different combinations of weights and to hold them in place without slipping off.



Weights on the back of the boom will give a coarse adjustment of the counter balance, getting it pretty close to even balance, but in order to get the fine tuning of the weight distribution, a sliding weight makes this very easy. This boom achieves that with a separate 5lb weight on a clamp can be placed anywhere along the boom where required to accommodate the slight variation of weight front to back. Having this feature is very necessary allows very precise adjustment of the balance of the boom.



CAMERA MOUNT

A true PTZ unit wasn’t required at time of construction as the camera being used on it is already a all in one PTZ HD camera, only a stable constant horizontal platform for the camera is required.

The original plan for the camera mount arm was to bend a 2 1/2 foot section of 3/4" conduit pipe (used for fire alarm cables running through etc) and spray paint the entire length, including the hanger black.



This jib utilized a mount already on hand with the shape that was desired. This was a former CRT television stand that would go on the wall, so it is quite strong.



To attach the camera mount bar to the end of the boom and give it the horizontal movement needed, a 2x10 metal joist hanger was chosen to attach the fulcrum of the camera mount to.  A 3' section of 1 5/8" pipe was cut to slide into the very end of the jib's outside 1 7/8 pipe. The 1 5/8" pipe extends about 8" out with a joist hanger riveted to it, the hanger itself extending out to give about 3" of clearance between the pipe and the end of the joist hanger. This is the point where the "L" shaped camera mount pipe comes through.

About midway in the 3" gap of the joist hanger a hole was drilled to allow a 1/4 high grade bolt to be connected through the joist hanger and the camera arm.  This design allowed the camera bar to move up and down, unimpeded from ground level up to approximately 50 degrees of pitch of the boom upwards. I used a couple of washers to center the "L" pipe in the middle of the joist hanger.  The 1/4 bolt used was about 3" long, so to keep it centered, a nut was used on either side of the joist hanger to keep it tight.

Horizontal Stability of Camera Platform

To control the horizontal level of the camera mount, a metal bar is attached at the booms fulcrum point in a manner that regardless of the booms up or down pitch, it always remained perfectly vertical in line with the tripod center mast.

This jib design uses gravity to naturally pull the camera arm down, so to counter act this force evenly as the boom is moved up and down, a cable is run from the top of the camera arm all the way down the jib to this vertical rod.  As the camera is boomed up or down, the cable keeps a constant even pull on the camera mount causing it to stay in the same degree of horizontal plane.



With this cable attached to the vertical bar of the camera mount at the top, as you boom up or down, the camera platform always stays horizontal (or whatever angle you decide you need during setup) automatically.  Essentially the cable allows the horizontal mount to counter act the boom's pitch, causing it to stay horizontal.

In this application the metal bar purchased was for scaffolding and upon visual inspection at purchase appeared that it would fit with some minor modifications.

The cable has a turnbuckle on it that can be adjusted to make the camera mount line up on the same horizontal plane as the jib.



Although this job doesn't utilize it, the arm could probably be modified to allow for manual movement of the cable, which would give easy tilt adjustment of the camera if desired.

JIB BOOM STAND TRIPOD

This will NOT work with a camera tripod stand.  Don't even think about it.  The center point weight and momentum is tremendous.

An all steel PA stand was utilized from a parts bin.  What was used is discussed here, but you will need to do something that will handle the weight, momentum and movement of the boom.  You need something that is up to the task.

The tripod used for this project was a heavy duty steel stand.  Not aluminum, not white metal, nothing plastic.






Here's how the legs look spread out.  A 12" piece of pipe is slid onto the stand from the bottom of the fulcrum to the top of the leg supports coming out of the center. This maintains the legs spread out, and the center pipe support are "all one", meaning the entire stand legs are "locked" to not move.  You can pick up the light stand and the legs will maintain their stance pictured

BOOM UP/DOWN and PANNING (Fulcrum)

Now the boom needs to be mounted to a tripod in a way that would give reliable smooth panning and booming up and down motion.

What was decided on was a construction dolly wheel used on scaffolding. Designed to handle 750lbs+ of weight, a ball bearing rotation system that had a grease fitting and the supports for the axle for the wheel were ideal for handling the weight.



We removed the wheel and the 'brake' assembly. This left a great mount for the boom, and another connection point for the camera horizontal adjuster.



The mount for this dolly wheel is the same diameter of the center support bar on the tripod I'm using, so I need to ensure it stays upright. When its inserted, the base of the dolly wheel sits on the the center mast of the tripod, transferring the entire weight straight down.



A piece of 1 1/2" metal tube was fitted over the center mast of the tripod stand, extending up just enough to allow the fulcrum to be inserted and locked by a pin.


An additional pipe was slid over it again to double up the strength.  you see the two pipes slide over each other with the holes lining up for the bolts.



This is the final assembly of the support system. The bolts are in place holding it together. The entire unit is "one".  The bolts and pipe inserts keep it as one solid structure. I can pick it up from the dolly and the entire tripod lifts, but maintains its leg spread, since the extra pipes below hold the legs in their ideal length.



OPERATION

It worked. Exactly as hope, and better than anticipated!

Unfortunately at this point no production examples are available due to copyright, but here is a quick JIB video test done when it was first assembled.

JIB VIDEO

The jib really didn't take very long to make and wasn't complicated to manufacture.  Everything was off the shelf with some items modified using basic hand-tools.  There was no need for any custom fabrication using welding, CNC or 3D printing.

To ensure all holes were drilled precisely in the center from top to bottom, a drill press was used in conjunction with a "self centering" pipe jig.   This is placed on the drill press base plate and secured in place with bolts to prevent it from moving.  All pipes are laid in this jig and are center drilled every time.


When the balance is set on this jib, its amazing. The jib can be moved to almost any position and the operator can let go of it and it will stay there, not moving. You'll notice in the video, and this is the same with an actual camera on the end, it easily can be put into motion and let go, and it will continue in that motion autonomously.



The entire boom breaks down into some relatively easy to manage parts, abiet there are quite a few of them. A road case is used to contain all the necessary mounting hardware, as well as some basic had tools and spare bolts and washers that seem to get lost during every tear down.

NOTES ON CONSTRUCTION AND FUTURE CHANGES

1 5/8" pipe has a bit of a gap of 1 7/8" pipe when they are inserted together.  Initially electrical tape was wound around the 1 5/8 pipe on either side of the mount holes to accommodate this gap. Building this up evenly allowed the 5/8 pipe to slide and it works really well. The pipe is evenly centered, and allows for uniform snugging of the bolts when its connected.
This will be upgraded to fiberglass.

No pan/tilt lock on the boom yet. Will work on something as this is kind of a work in progress and I'll update the progress.

Doesn't have real monitor mount for it yet.  Possibly a self leveling monitor system that connects to the guy wire mast

Possible chop of boom to be 6' length (vs 7'6") to simplify transport.

Side guy wires are going to be installed.  At 15' its ok, but as it gets longer, they would really help i'm sure.  The plan is to use a 3' threaded road and use it at the fulcrum when required vs the 3/4 bolt going through it now.

Update of nut/bolt hardware to use darker material to make it as dark as possible.  Also at time bolts were purchased longer than required due to time constraints obtaining slight shorter ones.

Pipe material $100.  Bolts, turnbuckles and wire about $100. scaffolding wheel $50
Tripod $75 (had one already) and weights around $50(?) maybe?

The 1/2" steel square rod used for the weights will be replaced by (probably) full length barbell.  Unclear yet as to the exact design, but focus is being spent on more flexible mounting system for weights than currently used.

Friday, November 17, 2017

FORTINET PORT FORWARD

Want to port forward someone into your network.  This is how. 
In this example we are port forwarding someone on port 5000 into the network.

1. Creating virtual IP

Go to Policy & Objects -> Objects -> Virtual IPs - Create New -> Virtual IP

This example, we want to open up port 5000 from the external IP of 142.154.2.2 and point it to 192.168.10.5 internally.

Note: doing this doesn't expose the external to internal, were just getting ready, policy will need to be done in step 3.

The "NAME" will be the name that the VIP Group will refer to (step 2).  The VIP group name will be the one that the POLICY and OBJECTS will refer to when you actually open this IP up to the internet.(step 3)




2. Adding virtual IPs to a VIP group

Go to Policy & Objects -> Objects -> Virtual IPs - Create New -> Virtual IP GROUP

Create a VIP group. Under Members, include all three virtual IPs previously created.



3. Creating a security policy

Now you create your IPv4 Policy.

Create a new policy

Enter in the name of this inbound plicy and set the external IP of the network that you want to allow in.

Then select the appropriate OUTGOING interface,
Destination address is the Virtual IP name.



Select OK



Wednesday, November 15, 2017

Reset the root password on Centos7

1 – Boot up and when the GRUB menu is displayed, select option to edit.

2 – Select Option to edit (e)

3 – Go to the line of Linux 16 and change ro with rw init=/sysroot/bin/sh.

4 – Now press Control+x to start on single user mode.

5 – Now access the system with this command.
chroot /sysroot

6 – Reset the password.
passwd root

7 – Update selinux information
touch /.autorelabel

8 – Exit chroot
exit

9 – Reboot your system
reboot

Tuesday, October 17, 2017

Avaya 9608 Phones on asterisk

Here's what I did to get them to work.
This is a document in progress.  I"m just typing down my settings and findings as I go through it, and will clean it up.

First 9608 phone.
Testing FreePBX Distro 13

Took a phone reset the configs to factory

I put 46xxxsettings.txt, 96xxupgrade.txt and SIP97xx_2_6_9_1.bin into var/www/html in my freepbx server

Powered on the phone

Factory login/password
* = enter config file (sometimes it a button marked "PROGRAM" on the screen)
craft = password

I hard coded an IP/mask/gateway (router)
HTTP/S server i put in as my asterisk server (sharing the html folder for its configs)

Everything else was auto
SIGNALLING = SIP
SIP GLOBAL settings:
SIP DOMAIN=IP of pbx
Avaya Environment = NO
Reg Policy =simultaneous
Failback =auto
CFG SERVER= IP Of PBX
USER ID FIELD =no

SIP PROXY = IP of PBX
Transport=tcp
sip port 5060

In asterisk i created an extension 1000 with a password of 1000 (unsecured for testing, server not net accessible anyway)

On the FreePBX configuration is configured the SIP settings to ensure that my network was one that would be recognized (my phone for testing are on a different vlan) and in SIP settings in the FreePBX gui i set TCP = YES

Save the changes and boot up the phone.

The phone should register and show login

Type in my login and password, phone registered.

-----
TODO:
working on how to self configure the phone.  If i type in the user/logon manually, then reboot the phone, it will autologin after, but i want the user/secrete to be deployable from a HTTP server or something.

Some Firmware

Friday, October 13, 2017

RESET Fortinet 60D password

HERE IS HOW YOU CRACK INTO A 60D if you forget the password

Connect your computer to the firewall with a console cable to the console port. ( a blue cisco one will work too)

  1. Find the serial number of your firewall.  
  2. type it into notepad (or something that you can copy/paste from) and prefix it with
    bcpb so it looks like "bcpbSERIAL" (bcpbFWF60D4Q23112312)
  3. COPY that password, you'll only have 15 seconds to type in.  Faster to paste.
  4. Launch whatever terminal program you like.  We'll assume putty and ensure you can console to the firewall.  (9600 baud 8,n,1)
  5. Power cycle the Firewall
  6. It will boot up, wait for the Firewall name and login prompt to appear.
  7. Enter the Username as maintainer
  8. Enter the Password = bcpbSERIAL number of firewall in UPPERCASE
  9. You should now be logged into the firewall
Once you are logged in you can change the password this way:

config system admin
edit admin
set password <psswrd>
end


Perhaps you want to reset the whole firewall back to DEFAULT?

exec factoryreset

This will put your device back to factory.

The logon is usually "ADMIN" with no password, just press enter.

Default IP is 192.168.1.99 (usually)  basically check your gateway if the system dishes out a DHCP address.



Thursday, October 12, 2017

Install ASTERNIC CallCenterPro on FreePBX distribution

Install ASTERNIC CallCenterPro on FreePBX distribution 

If you have the FreePBX distro (tested on 10.13.66-64bit and SNG7-FPBX-64bit-1707-1) at least and want to install ASTERNIC CCenter Pro on your installation you should just need to do the following:

The core of these instructions are from the Asterinic webpage

cd /usr/src
wget http://download.asternic.net/asternic-stats-pro-2.1.1.tgz 

tar zxvf asternic-stats-pro-2.1.1.tgz

cd asternic-stats-pro-2.1.1

(when it asks for SQL password just press "ENTER", the password is blank)

make install

If for some reason your machine doesn't have the "MAKE" app on your instance you can usually get it by issuing this command: yum -y install make

cat /etc/asterisk/manager.conf

Look for the following.  Copy the entry for the secret for your system.
secret=XXXXXXXXXXXXXXXXXXXXXX

Now edit the following file with your favorite linux editor. NANO and VI are very popular

/var/www/html/stats/config.php

enter the password into the following section:

$MANAGER_SECRET = "XXXXXXXXXXXXXXXXXX";

Save the changes.

service asterniclog start

Log into the GUI http://ipOfServer/stats

(i've had situations where at this point, nothing seemed to happen.  In my case, i issued a " service httpd restart"
to kick the webserver off again and it sorted my issue.

(admin admin)

goto SETUP-> PREFERENCES

Click on "ADD"

keyword: asterisk_18
leave parameter field empty
and set value=1 

In FREEPBX goto 
SETTINGS -> Advanced Settings 

enable "Display Readonly Settings" and "Override Readonly Settings"
Press SUBMIT then the read RELOAD button that appears.

Find:
POST CALL RECORDING SCRIPT and enter the value:

/usr/local/parselog/update_mix_mixmonitor.pl ^{UNIQUEID} ^{MIXMONITOR_FILENAME}

Press SUBMIT then the read RELOAD button that appears.

Should be good to go

Friday, October 6, 2017

RESET ELASTIX 2.5 GUI PASSWORD

RESET ELASTIX 2.5 GUI PASSWORD
SSH to box as root
enter the following command to reset password "letmein"
sqlite3 /var/www/db/acl.db "UPDATE acl_user SET md5_password='`echo -n letmein|md5sum|cut -d' ' -f1`' WHERE name='admin'"
Replace letmein with the password you want to use for the admin login.

Friday, September 8, 2017

Have callers approve their call being recorded in Asterisk.




This a demo, so I just used a default recording that says "this call may be monitored". You can easily replace this with one that makes more sense. "Press 1 to permit us to record this call, any other key to decline"
Pressing 1 will FORCE recording of the calls. Any other key, or if they press nothing after a couple of asks it will automatically set the recording to "NO"
This works for all calls marked as external. Internal calls I've bypassed it asking the question and set it to 'dontcare'. If you want internal extension to extension calls record, change 'dontcare' to 'force'
ASSUMPTION
You've set all call recording options in FreePBX to "DONT CARE"
Thats how i tested it. In FreePBX Distro 10.13.66
INSTALLATION
Don't test this in production environment

Open up extension_additional.conf and look for the context
[sub-record-check]
Copy that entire section (its probably about 100 lines) and ends with
;--== end of [sub-record-check] ==--;
Paste that into extensions_override_freepbx.conf
Find these two lines about 12 or so lines down.
exten => recordcheck,1,Noop(Starting recording check against ${ARG1})
exten => recordcheck,n,Goto(${ARG1})
INSERT these 4 lines in between the above two lines.
exten => recordcheck,n,GotoIf($["${CALLTYPE}" = "internal"]?dontcare)
exten => recordcheck,n,ExecIf($["${CALLTYPE}" = "external"]?Read(FOOrecord,this-call-may-be-monitored-or-recorded,1,,2,3))
exten => recordcheck,n,ExecIf($["${CALLTYPE}" = "external" | "${FOOrecord}" = "" ]?Set(ARG1=no)
exten => recordcheck,n,ExecIf($["${CALLTYPE}" = "external" | "${FOOrecord}" = "1" ]?Set(ARG1=force)
Save your changes
Reload the config
Make a test call.
CODE EXPLAINED:
Check to see if its an internal extension to extension call, we bypass it asking for permission to record and ring the phone.
exten => recordcheck,n,GotoIf($["${CALLTYPE}" = "internal"]?dontcare)
If this is an external call, we prompt the caller if they permit us to record the call. the syntax is:
READ(DTMFvariable, soundfile, max number of digits, number of times it will ask, how long it will wait for an answer
exten => recordcheck,n,ExecIf($["${CALLTYPE}" = "external"]?Read(FOOrecord,this-call-may-be-monitored-or-recorded,1,,2,3))
If the caller doesn't respond with any input, then we assume "no" and continue the call. 
exten => recordcheck,n,ExecIf($["${CALLTYPE}" = "external" | "${FOOrecord}" = "" ]?Set(ARG1=no)
If the callers presses 1, then we set the call recording to on and ring the extension
exten => recordcheck,n,ExecIf($["${CALLTYPE}" = "external" | "${FOOrecord}" = "1" ]?Set(ARG1=force)

Record the digits selected in an asterisk IVR for surveys

This records answers from a customer survey, but this one does it by modifying an existing IVR code.  For demo purposes it shows how to modify an IVR dialplan.

DESCRIPTION

This records the IVR selections and save them into a file called survey.txt
The comma delimited file contain each IVR selection broken up in this manner:
DATE,CallerID,UniqueID,FreepbxIVRid,QuestionFilename,Selection

Example output:

07092017-22:35:03,Jane Doe <5551238811>,1504834501.1207,ivr-7,custom/question1,1

DATE
=DDMMYYY-HH:MM:SS
CallerID=The callers CLID if available "Jane Doe <5551238811>"
UniqueID=This is the unique value for each call. This will help you sort indvidual calls that are in this file.
FreepbxIVRid=Each IVR you create is assigned an IVR. FreePBX doesn't store the descriptive name, this is here to help you know which one is which.
QuestionFilename=This is the sound file that you play for each IVR. This is to help you know what question was asked
Selection=This is the DTMF value they pick for their answer.

INSTALLATION

Don't throw this into production, put it in a test system, or just change 1 IVR.

Test in FreePBX Distro 10.13.66-64bit

You can either modify existing IVRs, or create some net new ones.
I suggest that your recorded questions file names allow you to reflect the question being asked because the way FreePBX builds the dialplans and references each IVR a unique ID number, the voicefile name is the only thing that easily lets you see which IVR is which.

open up /etc/asterisk/extensions_additional.conf
Copy all your IVR CONTEXT entries in this file that are relative to your IVR questions, and paste them into

/etc/asterisk/extensions_override_freepbx.conf


If you have other production IVRs, I wouldn't copy them into this file. They will still work, but any changes in the GUI will not reflect in your production sytem, as the override file will do just that, override changes made by the GUI.

So below is a 'snipped' version of the 30 or 40 lines of code you would see. If you had 5 Ivrs, you would have to copy them all.
[ivr-7] ; ivr1
include => ivr-7-custom
include => from-ivr-directory-Disabled
........
exten => s,1,Set(TIMEOUT_LOOPCOUNT=0)
exten => hang,1,Playback(vm-goodbye)
exten => hang,n,Hangup
;--== end of [ivr-7] ==--;

copy everything from
[ivr-X] through to ;-== end of [ivr-X] ==--;

Paste it into
extensions_override_freepbx.conf

Now that you have all the IVRs that belong to your survey, you can now edit them. We move them here because manual changes in their home file location would be over written by future changes in the GUI.
Now go to each IVR in the _override.conf file and look for the entries that look similar to this:
[ivr-X]
.....
exten => 1,1(ivrsel-1),Goto(ivr-8,s,1)
exten => 2,1(ivrsel-2),Goto(ivr-8,s,1)
These are the valid selections in each IVR you've configured in FreePBX. So in the above example callers in IVRx can press 1 or 2, and will take them to the next ivr for further questions.
We are going to modify each one of these lines with the same piece of code:
system(echo "${STRFTIME(${EPOCH},,%d%m%Y-%H:%M:%S)},${CALLERID(all)},${UNIQUEID},${IVR_CONTEXT},${IVR_MSG},${EXTEN}" >> /tmp/survey.txt)
We'll insert this into the exsting code
This:
exten => 1,1(ivrsel-1),Goto(ivr-8,s,1)
turns into this:
exten => 1,1,system(echo "${STRFTIME(${EPOCH},,%d%m%Y-%H:%M:%S)},${CALLERID(all)},${UNIQUEID},${IVR_CONTEXT},${IVR_MSG},${EXTEN}" >> /tmp/survey.txt)
exten => 1,2(ivrsel-1),Goto(ivr-8,s,1)
This:
exten => 2,1(ivrsel-2),Goto(ivr-8,s,1)
turns into this:
exten => 2,1,system(echo "${STRFTIME(${EPOCH},,%d%m%Y-%H:%M:%S)},${CALLERID(all)},${UNIQUEID},${IVR_CONTEXT},${IVR_MSG},${EXTEN}" >> /tmp/survey.txt)
exten => 2,2(ivrsel-2),Goto(ivr-8,s,1)
You'll need to repeat this entry for each entry you have in the IVRS.
Save your changes
in the CLI type
core reload
This will load these entries into your PBX.
Make a call to the IVR and test the functionality.
Look in /tmp/surevey.txt, there should be entries like:
07092017-22:35:03,Jane Doe <8862>,1504834501.4403,ivr-7,custom/question1,1
07092017-22:35:03,Jane Doe <8862>,1504834501.4403,ivr-5,custom/question2,2
07092017-22:35:03,Jane Doe <8862>,1504834501.1207,ivr-7,custom/question1,1
07092017-22:35:03,Jane Doe <8862>,1504834501.1207,ivr-5,custom/question2,2

Thursday, September 7, 2017

AudioCodes MP-112 or MP-118 or MP-124 working with Asterisk

Some help to get an MP-112, MP-118, MP-124 working with Asterisk. 

In my experience, these devices are robust and reliable, but the GUI configuration process is very convoluted.  I'm not sure if that is on purpose or not, but I hope this helps you.  

This method DOES work and the attached devices (mostly all Polycom Analog conference room phones) have handled thousands of minutes of voice calls without issue.

I've made these work directly with CallCentric as well, the change required are noted in the configuration below.  If it will work with them, you can probably make it work with any ITSP

Tested on an AudioCodes MP-112 on Firmware 6.60A.342.003    
Tested on an AudioCodes MP-118 on Firmware 6.60A.332.002    
Tested on an AudioCodes MP-124 on Firmware 6.60A.326.005      


!! USE Internet Explorer for GUI Changes/Updates !!



In asterisk (FreePBX) create a SIP extension and save/submit changes.

Note the extension and secret, you'll need these later.  Also, I've encountered situations where the random complex password that FreePBX GUI will generate is too long for the AudioCodes devices, so you may need to reduce the character count.

At time of writing I've really only done this with SIP, I haven't done any PJsip testing yet.


---If you have already configured your Audiocodes and just want to enter a new number, down and perform only STEP 4 and STEP 5

STEP 1
Login into your AudioCodes (Admin/Admin is the default user.  Note CAP "A")
VoIP -> SIP Definitions -> Proxy & Registration
"Use Default Proxy" = Yes 
"Enable Registration" = Enable



Press SUBMIT
STEP 2
At the top of same window, select "PROXY SET TABLE", button (little arrow)
Under "PROXY ADDRESS" put in the IP address of your Asterisk server.
To the right of that entry, set Transport Type = UDP
Enable Proxy Keep Alive = Using Options

NOTE: I've found CALLCENTRIC worked better if you select "Using Register"


Press SUBMIT

STEP 3
VoIP -> GW and IP to IP -> Analog Gateway -> Caller ID Permission

** This is an important step in the configuration process.  The system just doesn't seem to work without doing this step! **
Set to ENABLE for each FXS port (assuming you want them to have CLID display)|

Press SUBMIT

STEP 4
For AudioCodes gateways that are already configured, start at this spot to ADD additional phones to the system.
VoIP -> GW and IP to IP -> Analog Gateway -> Authentication
Enter in your extension(s) and the password (aka secret) into these boxes.




Press SUBMIT
STEP 5
VoIP -> GW and IP to IP -> Hunt Group -> EndPoint Phone Number

Enter in the extension (or Callcentric Account) for PHONE NUMBER
Channels     Phone Number    Hunt Group ID    Tel Profile ID
  1. 1                   1000                     [blank]                   0
  2. 2                   1002                     [blank]                   0

Press SUBMIT(If you are watching asterisk live log, your extensions should show as registered)

STEP 6
VoIP ->GW and IP to IP -> DTMF and Supplementary -> DTMF and Dialing
Change MAX DIGITS In phone Num = 15 (assuming you want to be able to dial long distance.)
Press SUBMIT
You should now be able to make some test calls.  *43 will get you into an echo test on Asterisk


STEP 7

If all works, select BURN on to save these to memory.

Wednesday, September 6, 2017

Modify OUTBOUND callerID number in asterisk

Need to modify the Outbound callerID number that is presented to callers, here's a technique.

Test in FreePBX distro 10.13.66-64bit
FreePBX 13.0.192.9

SCENERIO
Call being sent out a trunk and you need to modify CLID of a certain value and prepend or postpend numbers to it.  In the scenerio below, we look for 7 digit numbers and add 555 in front of the numbers.

INSTALLTION
Copy the [macro-outbound-callerid] context from /etc/asterisk/extensions_additional.conf

and paste it into /etc/asterisk/extensions_override_freepbx.conf

Now scroll down to line 7 approximately and you'll see code similar to this:

exten => s,n(normcid),Set(USEROUTCID=${DB(AMPUSER/${AMPUSER}/outboundcid)})
exten => s,n(bypass),Set(EMERGENCY=${DB(DEVICE/${REALCALLERID}/emergency_cid)})

Insert this line between them:
exten => s,n,Gosub(CIDcheck,s,1)

Now scroll to the bottom of the code you've just pasted, and then copy paste the code below between the ============== symbols at the very bottom of the file.

;==========================================
[CIDcheck]

exten => s,1,NoOp(&&&&Checking CLID LENGTH (<7 digits?))

;take the current CLID and save it.  This will be used to tear apart and check syntax
exten => s,n,Set(FOOclid=${CALLERID(all)})
exten => s,n,Set(FOOprepend=506)
exten => s,n,Set(FOOpostpend=)

thi cut gives us the callerID name.  The format in DB looks like "First Last" <XXXxxxx>  The result will be "First Last"
exten => s,n,set(FOOname=${CUT(FOOclid,<,1)})

;this cut gets the callerid number.  It will look like: XXXxxxx>   -missing the first "<" as that was used as delimiter.  we'll put it back later
exten => s,n,set(FOOnumber1=${CUT(FOOclid,<,2)})

;this gets rid of the trailing ">" symbol, leaving us with only XXXxxxx
exten => s,n,set(FOOnumber=${CUT(FOOnumber1,>,1)})

;if the length of the CLIDnumber is equal to whatever value you set after the = sign, then it will look something like this <zzzXXXxxxxWWW>
exten => s,n,ExecIf($[${LEN(${FOOnumber})} = 7]?Set(USEROUTCID=${FOOname}<${FOOprepend}${FOOnumber}${FOOpostpend}>))
exten => s,n,ExecIf($[${LEN(${FOOnumber})} = 7]?NoOp( CLID CHANGED FROM ${FOOclid} to ${USEROUTCID} leng ${FOOnumber1}))
exten => s,n,return


;==========================================

Save your changes

In the asterisk CLI type
core reload

Make a test call.  Your CLID should now be modified.

Sunday, September 3, 2017

Reset Linux Root Password

1. Boot the system and press any key after you see the "Press any key to enter the menu" message. 
2. Press "e" to edit the boot command

3. Select vmlinuz using the arrow keys and press "e" to edit the line.
4. At the end of the line press space bar and type "single" then press ENTER.

6. If vmlinuz is not selected or highlighted, select it using the arrow key. Now press "b" to boot the system and wait for the bash shell.

7. Execute the password reset command by typing "passwd" and press Enter. Now type your new password at the command prompt.

8. Type "reboot" to reboot the system.