Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titleLemmon Lab | Tech Tips | RS232

The LemmonsLab RS232 Kit

If you hate RS232 you will love this!

Over the years of working with RS232 I have bundled together a very small yet extremely versatile kit that makes working with the mysterious (or some would say painful) serial connections. Below are various pieces and parts that make up that kit. Most of this is inexpensive and every phone tech would benefit from having one in their bag of tricks.

CONSOLE ADAPTER

Let's start simple! Many network devices use the ubiquitous “Cisco Console Cable”™ Cable” for maintenance access. You have surely seen their famous light blue cable with a RJ45 connector on one end and a serial DB9 female on the other. That is a lot of cable to carry around and I have a smaller version you can make for just $3 or so.

Purchase a DB9 female to RJ45 adapter from any of the myriad of suppliers such as https://www.cablewholesale.com/products/serial-modem-cable/modular-adaptors/product-31d1-1740bl.php . I use a blue one to remind me this is a Cisco style console adapter.

These adapters have a standardized color code for each wire and you simply insert wires into the connector body to link the connectors in whatever fashion you wish.

COMPUTER CONSOLE
DB9F RJ45 CAT CABLE
DTR –> 4 BROWN DSR 7 White Brown
CTS <– 8 BLUE RTS 1 White Orange
N/C 1 GREEN GND 5 White Blue
RXD 3 YELLOW RXD 6 Green White
GND — 5 RED GND 4 Blue White
RTS –> 7 WHITE CTS 8 Brown White
DSR 4 BLUE DSR 1 White Orange
CTS <– 8 ORANGE RTS 2 Orange White
N/C 1 BLACK GND 3 White Green
RXD 3 GREEN RXD 5 White Blue
GND — 5 YELLOW GND 6 Green White
RTS –> 7 BROWN CTS 7 White Brown
DSR 4 BLUE DSR 1 White Orange
CTS <– 8 ORANGE RTS 2 Orange White
N/C 1 BLACK GND 3 White Green
RXD 3 GREEN RXD 5 White Blue
GND — 5 YELLOW GND 6 Green White
RTS –> 7 BROWN CTS 7 White Brown
DSR

...

Expand
titleEngineering | Voiceware | CLI | NIC Port | Adtran Setup

Adtran hand-off to second NIC on external server

Example:

Trunk/Adtran provider should supply something like the following:

=======================================================================================================
We have installed our Adtran 908e out on-site and changed this from a PRI to a SIP.

I have the SIP information for you below along with the cut sheet with the phone numbers on the SIP.


SIP TRUNK SETUP
****************
User: 9305402059
Password: LtBha]g-Gf5yW
PBX IP: 10.57.5.2
Gateway: 10.57.5.1
Subnet 255.255.255.0
Registration IP/SIP Domain: 10.35.65.4

Serial: CFG1888946
CONNECTION: ETH0/1 - WAN
CONNECTION: ETH0/2 - PBX

Given the above information, you’ll want to go ahead and static the secondary eth port on the server for an IP of 10.57.5.2, a subnet of 255.255.255.0, and leave the gateway IP blank in most cases you do not want to add the default gateway as this can traffic to route incorrectly.

Once that is done, go into SSH and run “nmcli” to look at the default routes for each interface, you should see something like this:

[root@vw-00301809dc6b ~]# nmcli
enp1s0: connected to Wired connection 1
"Intel I211"
ethernet (igb), 00:30:18:09:DC:6B, hw, mtu 1500
ip4 default
inet4 172.16.0.120/24
inet4 10.11.12.1/24
route4 10.11.12.0/24
route4 172.16.0.0/24
route4 0.0.0.0/0
inet6 fe80::69e8:ebe2:d672:3f8e/64
route6 fe80::/64
route6 ff00::/8

ens1: connected to Wired connection 2
“Intel I211”"Intel I211"
ethernet (igb), 00:30:18:09:DC:6C, hw, mtu 1500
inet4 10.57.5.2/24
inet4 10.11.12.1/24
route4 10.11.12.0/24
route4 10.57.5.0/24
inet6 fe80::dbea:5c1c:e9a7:d32/64
route6 fe80::/64
route6 ff00::/8

docker0: unmanaged
“docker0”"docker0"
bridge, 02:42:4F:7E:7F:71, sw, mtu 1500

lo: unmanaged
“lo”"lo"
loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536

DNS configuration:
servers: 8.8.8.8 8.8.4.4 4.2.2.2
interface: enp1s0

Run nmtui and edit the desired interface, in our example, that will be “Wired connection 2” please not the interface is subject to change so look carefully.

[root@vw-00301809dc6b ~]# nmtui

edit the “Wired connection 2” interface and under “Routing” add the following:

Destination/Prefix
10.35.65.4/32

Next Hop
10.57.5.1

Afterwards you’ll want to activate the connection by running nmtui again.

[root@vw-00301809dc6b ~]# nmcli
enp1s0: connected to Wired connection 1
“Intel I211”
ethernet (igb), 00:30:18:09:DC:6B, hw, mtu 1500
ip4 default
inet4 172.16.0.120/24
inet4 10.11.12.1/24
route4 10.11.12.0/24
route4 172.16.0.0/24
route4 0.0.0.0/0
inet6 fe80::69e8:ebe2:d672:3f8e/64
route6 fe80::/64
route6 ff00::/8

ens1: connected to Wired connection 2
“Intel I211”
ethernet (igb), 00:30:18:09:DC:6C, hw, mtu 1500
inet4 10.57.5.2/24
route4 10.57.5.0/24
route4 10.35.65.4/32 <——————- NEW ROUTE IS PRESENT HERE.
inet6 fe80::dbea:5c1c:e9a7:d32/64
route6 fe80::/64
route6 ff00::/8

docker0: unmanaged
“docker0”
bridge, 02:42:4F:7E:7F:71, sw, mtu 1500

lo: unmanaged
“lo”
loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536

DNS configuration:
servers: 8.8.8.8 8.8.4.4 4.2.2.2
interface: enp1s0

you can also look at the routing by running the following command:

[root@vw-00301809dc6b ~]# ip r l
default via 172.16.0.1 dev enp1s0 proto static metric 100
10.11.12.0/24 dev enp1s0 proto kernel scope link src 10.11.12.1
10.35.65.4 via 10.57.5.1 dev ens1 proto static metric 101 <——————- NEW ROUTE IS PRESENT HERE
10.57.5.0/24 dev ens1 proto kernel scope link src 10.57.5.2 metric 101
172.16.0.0/24 dev enp1s0 proto kernel scope link src 172.16.0.120 metric 100
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown

And if we do a tracepath to the SIP registration gateway we can see it’s routing correctly:

[root@vw-00301809dc6b ~]# tracepath 10.35.65.4
1?: [LOCALHOST] pmtu 1500
1: 10.57.5.1 1.670ms
1: 10.57.5.1 1.322ms
2: no reply

If we go into asterisk and run “sip show registry” we can also see the trunk is now registered:

[root@vw-00301809dc6b ~]# asterisk -r
siAsterisk 16.6.2, Copyright (C) 1999 - 2018, Digium, Inc. and others.
Created by Mark Spencer
Asterisk comes with ABSOLUTELY NO WARRANTY; type ’core show warranty’ for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type ’core show license’ for details.

Connected to Asterisk 16.6.2 currently running on vw-00301809dc6b (pid = 1)

vw-00301809dc6bCLI> sip show registry
Host dnsmgr Username Refresh State Reg.Time
10.35.65.4:5060 N 9305402059 24 Registered Tue, 18 Jan 2022 11:52:55
1 SIP registrations.
vw-00301809dc6bCLI>
Disconnected from Asterisk server
Asterisk cleanly ending (0).
Executing last minute cleanups

...

Expand
titleEngineering | Voiceware | Gateway(s) | No Ringback Over T1/PRI

Symtpom(s):
It has been noted that when using a TA2400 GW for room phones there is sometimes a lack of ring-back present on outbound calls that are traveling over T1. This is because the carrier /should/ be providing the ring back but since they are not we have to let Voiceware know that we should be providing the ring-back.

Version(s):
4.X

Summary:
[root@vw-00032d3ca462 ~]# cd /tmp/

[root@vw-00032d3ca462 tmp]# docker cp asterisk:/etc/asterisk/asg_callrouter.conf .

Then edit the file, line 255.

root@vw-00032d3ca462 tmp]# vi asg_callrouter.conf +255

exten => s,n(dodial),Dial(${TRUNK}/${FILTER(+0123456789*#w,${ARG1})},90,${ARG2})
Add the option to the ARG2 section.

exten => s,n(dodial),Dial(${TRUNK}/${FILTER(+0123456789*#w,${ARG1})},90,R${ARG2})
Please note this goes outside of the ${...} , but after the last comma.

After you’ve you've finished with the file, copy it back into place.

[root@vw-00032d3ca462 tmp]# docker cp asg_callrouter.conf asterisk:/etc/asterisk/

[root@vw-00032d3ca462 tmp]# asterisk -rx ’dialplan reload’'dialplan reload'

Dialplan reloaded.

Expand
titleFortiGate ISP Cutover Script

FORTIGATE | ISP Cutover Quick Script

====================================

SCRIPT | CUTOVER IP CHANGES

====================================

config system interface

edit “wan1”

set vdom “root”

set ip [NEW IP] [NEW SN]

end

end

config system virtual-wan-link

config members

edit 1

set interface “wan1”

set gateway [NEW GW]

next

end

end

config router static

edit 1

set gateway [NEW GW]

next

end

end

====================================

AWS IPS TO WHITELIST/CHANGE

====================================

Custom UDP 123

CUSTOM UDP 5060

HTTP TCP 80

Live Search
placeholderFind Solution
typepage

HTTPS 443

Custom TCP 8080

...

Expand
titleEngineering | Voiceware | CLI | Docker | T.38 support

Verify if turned off:
[root@ip-172-31-17-136 ~]# asterisk -rx ’sip show settings’ | grep T.38
T.38 support: No
T.38 EC mode: Unknown
T.38 MaxDtgrm: 4294967295
[root@ip-172-31-17-136 ~]#

Edit asterisk container file:
[root@ip-172-31-17-136 ~]# docker exec -it asterisk bash
[root@ip-172-31-17-136 /]# vi +754 /etc/asterisk/sip.conf
[root@ip-172-31-17-136 /]#

remove the “;”

Before:
;t38pt_udptl = yes ; Enables T.38 with FEC error correction.

After:
t38pt_udptl = yes ; Enables T.38 with FEC error correction.

esc:wq

[root@ip-172-31-17-136 /]# exit
[root@ip-172-31-17-136 ~]# asterisk -rx ’sip reload’'sip reload'
[root@ip-172-31-17-136 ~]#

Verify change:
[root@ip-172-31-17-136 ~]# asterisk -rx ’sip 'sip show settings’ settings' | grep T.38
T.38 support: Yes
T.38 EC mode: FEC
T.38 MaxDtgrm: 4294967295
[root@ip-172-31-17-136 ~]#

Expand
titleEngineering | Voiceware | CLI | Logs

Access logs:
grep -i login /var/log/apache2/access.log <— 3.X
grep -i login /var/log/messages

Expand
titleEngineering | Voiceware | CLI | Audio Issue | Outbound Routing | Hairpin Dialing

Example/Symptom:

A user is forwarding calls out of the server to their cell phone. When someone calls a user DID that is currently set to forward calls to their cell phone, the call builds and connects both parties but there is no audio.

Solution:

Add a 1-second delay or 1-second of silence before the call out-routes from the server to the carrier.

Steps:

  1. SSH into VW

  2. Run: sudo vi +215 /etc/asterisk/asg_callrouter.conf

  3. Add: exten => s, n, Playback(silence/1)

  4. type: :wq to save and exit vi editor

Prior to editing the asg_callrouter.conf file:

[macro-cr-outbound-call]
;number, options
exten => s,1,NoOp(Outbound Call)
exten => s,n,Set(OUTBOUND=TRUE)
exten => s,n,Set(CDR(outbound)=true)
exten => s,n,ExecIf($[“$"${call_log_id}" != ""]?ForkCDR())
exten => s,n,Set(CALLERID(num)=${CALLERID(num)}) ; Previously CALLERID(num):-10
exten => s,n,Set(REDIRECTING(from-number-valid)=0)
exten => s,n,Dial(${TRUNK}/${ARG1},90,${ARG2})
exten => h,1,Macro(handlehangup)

After editing the asg_callrouter.conf file:

[macro-cr-outbound-call]
;number, options
exten => s,1,NoOp(Outbound Call)
exten => s,n,Set(OUTBOUND=TRUE)
exten => s,n,Set(CDR(outbound)=true)
exten => s,n,ExecIf($[“$"${call_log_id}" != ""]?ForkCDR())
exten => s,n,Set(CALLERID(num)=${CALLERID(num)}) ; Previously CALLERID(num):-10
exten => s,n,Set(REDIRECTING(from-number-valid)=0)
exten => s,n,Playback(silence/1)
exten => s,n,Dial(${TRUNK}/${ARG1},90,${ARG2})
exten => h,1,Macro(handlehangup)

After making changes enter asterisk (asterisk -r) and run: dial plan reload

Detailed Explanation:

When the SIP protocol is doing a call setup (and answer) it requires that the servers send their IP address for audio in the session description. Sometimes, phones, misconfigured asterisk servers, and other dumb devices don’t realize they need to send an external IP address and blindly send whatever address they have on hand.

This means that you will send the audio to nowhere. 
 
When you check the NAT box, you tell Asterisk to ignore (most of) what it’s told, at least for signaling. With audio, asterisk will still gladly send audio to nowhere. This is because the audio server is not always the signaling server. It’s still possible to offload audio.

What causes asterisk to “lock on” is the far end device when it sends audio to asterisk, with the correct ID, to the correct port. After a probation period, asterisk will then send audio to the same address it received from.

Further Distillation:
Asterisk sometimes requires inbound audio to come in first before it will even attempt to send audio out. Since all of the AWS instances are behind NAT, you get weird hairpin audio issues. As the call comes in from the carrier, the ports for audio are closed; sending audio to the carrier (or audio relay) will open them.

If asterisk does not want to send audio first, those ports never open, so asterisk refuses to send audio. Asterisk then sets up an external call but refuses to send audio because there is nothing to say yet. The outbound call has the same problem. The ports are closed because asterisk hasn’t said anything yet.
 
When you send the silence/1 you force asterisk to say something first, which starts the flow of traffic, that opens the ports on the outbound call, now audio from the inbound call flows. Now asterisk has something to say on the outbound call, which opens ports on the outbound call and things begin to flow.


This is all true, but we open the AWS firewall (10k-20k/UDP), but “why still the problem” you may ask? Because asterisk doesn’t send “blank” packets; unless it has something to say, it won’t. Sending the silence/1 prompts the carrier to send something, then asterisk relays to the other side and now you have two-way audio again.

...