ESR series service routers.ESR-Series. User manual
Solution:
Configure the first ESR-21
Configure the parameters for negotiation with the modem:
esr-21-1(config)# line aux 2 
esr-21-1(config-line-aux)# flowcontrol hardware
esr-21-1(config-line-aux)# modem inout
esr-21-1(config-line-aux)# exit
esr-21-1(config)# 
Configure the required RS-232 interfaces:
esr-21-1(config)# interface serial 1/0/2 
esr-21-1(config-serial)# ip address 1.1.1.1/24 
esr-21-1(config-serial)# exit
esr-21-1(config)# 
Configure firewall for security zones:
esr-21-1(config)# security zone xx
esr-21-1(config-zone)# exit
esr-21-1(config)# security zone-pair xx self 
esr-21-1(config-zone-pair)#   rule 1 
esr-21-1(config-zone-pair-rule)# action permit 
esr-21-1(config-zone-pair-rule)# enable 
esr-21-1(config-zone-pair-rule)# exit 
esr-21-1(config-zone-pair)# exit
esr-21-1(config)# 
Specify that the interfaces belong to the security zone:
esr-21-1(config)# interface serial 1/0/2
esr-21-1(config-serial)# security-zone xx 
esr-21-1(config-serial)# exit
esr-21-1(config)#
Enable dialing by number:
esr-21-1(config)# interface serial 1/0/2 
esr-21-1(config-serial)# dialer string 002
esr-21-1(config-serial)# dialer
esr-21-1(config-serial)# exit
esr-21-1(config)# 
Configure the second ESR-21
Configure negotiation parameters:
esr-21-2(config)# line aux 2 
esr-21-2(config-line-aux)# flowcontrol hardware
esr-21-2(config-line-aux)# modem inout
esr-21-2(config-line-aux)# exit
esr-21-2(config)#