AOS SIP to FXS

There and back again, a short story about routing calls between SIP and an FXS in an adtran.

Start with a primitive config

voice codec-list Default
  default 
  codec g711ulaw
!
voice trunk T01 type sip
  sip-server primary fqdn.example.com
  sip-server rollover service-unavailable-or-timeout
  registrar threshold absolute 20
  registrar expire-time 140
  codec-list Default both
  authentication username 5555 password PASS
!
voice grouped-trunk SIP
  trunk T01
  accept $ cost 10
!
voice user 5555
  connect fxs 0/1
  no cos
  no call-waiting
  no message-waiting
  sip-identity 5555 T01 register auth-name 5555 password PASS
  codec-list Default
!

Now if we want to change the outgoing callerID of fxs 0/1 we can do something like:

voice trunk T01
  match ani 5555 substitute 1-912-555-1234
!

And if we want to accept an incoming DID:

voice user 5555
  did 19125551234

But if it's not working, we may have a domain mis-match (SIP peer's from domain may not match the FQDN in the sip-server primary which can be identified with the following debug:

debug sip cldu
debug voice sum

A failure to lookup would look like this:

SIP.CLDU Cldu::CallLegCreatedEv: Incoming CallLeg created from 6785551234@203.0.113.115:5060 to 19125551234@192.168.1.100:5060
SIP.CLDU Searching for a matching trunk account by Via (203.0.113.115:5060 - UDP)
SIP.CLDU Searching for a matching trunk account by From (203.0.113.115:5060 - UDP)
SIP.CLDU Searching for a matching trunk account by To (192.168.1.100:5060 - UDP)
SIP.CLDU Searching for a matching trunk account by Contact (203.0.113.115:5060 - UDP)
SIP.CLDU Searching for a matching trunk account by Source IP (203.0.113.115:5060 - UDP)
SIP.CLDU Request URI indicates a local address, but could not match INVITE to an available trunk
SIP.CLDU Default trunk is not enabled or does not exist.
SIP.CLDU Incoming message received from 203.0.113.115:5060 via UDP
SIP.CLDU Cldu::CallLegStateChangedEv: (0x0x4d1b0af8)->Offering
SIP.CLDU Cldu::CallLegStateChangedEv: (0x0x4d1b0af8)->Disconnected
SIP.CLDU Incoming message received from 203.0.113.115:5060 via UDP
SIP.CLDU Cldu::CallLegStateChangedEv: (0x0x4d1b0af8)->Terminated

Two things can help.

domain-lookup
name-server 1.1.1.1 8.8.8.8
Ensure DNS works
voice trunk T01
  domain 203.0.113.115
Add a domain to accept from

A successful log looks like:

SIP.CLDU Cldu::CallLegCreatedEv: Incoming CallLeg created from 6785551234@203.0.113.115:5060 to 19125551234@192.168.1.100:5060
SIP.CLDU Searching for a matching trunk account by Via (203.0.113.115:5060 - UDP)
SIP.CLDU findClduInterface: 203.0.113.115 match to domain address succeeded for T01
SIP.CLDU Routing call to trunk from 6785551234
SIP.CLDU Incoming message received from 203.0.113.115:5060 via UDP
SIP.CLDU Cldu::CallLegStateChangedEv: (0x0x4d1b0d00)->Offering
VOICE.SUMMARY T01 is calling 5555 (5555).
SIP.CLDU Incoming message received from 203.0.113.115:5060 via UDP
SIP.CLDU Cldu::CallLegStateChangedEv: (0x0x4d1b0d00)->Cancelled
SIP.CLDU Cldu::CallLegStateChangedEv: (0x0x4d1b0d00)->Disconnected
VOICE.SUMMARY Call from T01 to 5555 (5555) ended by T01: normal clearing
SIP.CLDU Incoming message received from 203.0.113.115:5060 via UDP
SIP.CLDU Cldu::CallLegStateChangedEv: (0x0x4d1b0d00)->Terminated
undebug all
fin