Setting up FAX or Analog handset from SIP Trunk on AudioCodes Mediant M800

Yes people still use Fax machines and analog handsets in enterprise environments.... and also more importantly, have requirements to use analog handsets plugged into your new shiny SIP trunk. While setting this up recently for a customer, I found it quite unwieldly. Configuring a FAX or Analog handset on an AudioCodes Mediant M800 is harder than it needs to be, or at least the config is not clear in their documentation. 



Hopefully the details below help to clear it up:

To set up a FAX or Analog handset on one of the ports on the M800, first plug into a free port and note the port, we use the first available port:


Then we need to configure the following:

 

SIP Interface with GW Applications

 

Under Setup > Signaling & Media > Core Entities > SIP Interfaces

·       Create a new SIP Interface and set the following details:

o   Network Interface: <This is your SIP Interface for incoming provider>

o   Application Type: GW -- (If you cant pick GW then you don’t have the Gateway set up right)

o   UDP Port: 5065 -- (Pick unused ports from other SIP Interfaces – its not that relevant the port number) same for TCP/TLS if you are going to use – you shouldn’t though!

 



That’s all the settings, you will see below now the new Interface on the SBC.

 



IP Group

 

Under Setup > Signaling & Media > Core Entities > IP Groups, we now create a new IP Group with the following simple details:

Name: FAX IPG

Type: Gateway


Moving along…

 

SBC > IP-to-IP Routing

Now the way call legs work for this is as follows.

Ø  Inbound call from SIP trunk to the Gateway (Device Itself) is IP-to-IP

Ø  Then IP-to-Tel is used to move the call from the Gateway to the Trunk Group / FXS port itself

 

We set up the IP-to-IP Routing under Setup > Signaling & Media > SBC > IP-to-IP Routing

Create a new Route and make sure it is above your main route for all other inbound numbers as we need to specify the FAX number we are routing to the specific port on the device.

·       Match >> Source IP Group: #0[ATT IPG] – pick your inbound SIP trunk group here

·       Match >> Destination Username Pattern: <your FAX phone number>

·       Action >> Destination Type: Gateway

·       Action >> Destination SIP Interface: #1 [FAX Interface] – we created this earlier

·       Action >> Destination Port: 5065 – we defined this in the SIP Interface earlier

·       Action >> Destination Transport Type: UDP -- we defined this in the SIP Interface earlier

 

Gateway > Trunk Group

Now we define the Trunk Group itself. This is where the port is plugged in basically!

 

Under Setup > Signaling & Media > Gateway > Trunks & Groups > Trunk Groups

·       We will select the Module from the dropdown that we are using for our FXS on this device. There may only be one here.

·       Then under Channels we type 1 as we are using the first port.

·       Under Phone Number we enter the number of the FAX/Analog device

·       Finally under Trunk Group ID we give it an ID. I use 21 here which logically stands for Module 2 Port 1 but you can use anything you like as long as you remember it later



Don’t forget to Register and Apply!!

 

Gateway > Trunk Group Settings

Now Under Setup > Signaling & Media > Gateway > Trunks & Groups > Trunk Group Settings we define the exact settings for this TrunkGroupID/Port

 

·       General >> Trunk Group ID: 21 – this is the ID we gave it under Trunk Group a minute ago

·       General >> Channel Select Mode: By Dest Phone Number – means it will only route the specified phone number to the port

 

Gateway > IP-to-Tel Routing (Inbound FAX)

Now the final step for INBOUND call route

 

Under Setup > Signaling & Media > Gateway > Routing > IP-to-Tel Routing, we create a new route specifically for this number:

·       Match >> Source SIP Interface: Any – you can narrow this down but I will allow for faxing from internal later

·       Match >> Destination Phone Pattern: <Your FAX number>

·       Action >> Destination Type: Trunk Group

·       Action >> Trunk Group ID: 21 – We defined this earlier

·       Action >> Source IP Group: #2 [FAX IPG] – taking it from the earlier part of the route


This is enough to get your INBOUND FAX working!!

In the Syslog we see the hop from Public SIP trunk, to the Device then to the CH:0 which is our FXS port!


 

Gateway > Tel-to-IP Routing (Outbound FAX/Calls)

Without this, the Mediant doesn’t know how to route the outbound fax, and it turns out we can’t just choose a destination IP group. We must instead specify the WAN interface and the IP address of the Carrier router.

 

Under Setup > Signaling & Media > Gateway > Routing > Tel-to-IP Routing, we create a new rule:

·       Match >> Source Trunk Group ID: 21 – we could put * here to allow out from any FXS port but let’s be definitive here

·       Action >> SIP Interface: #2 [WAN SIP Port]

·       Action >> Destination Port: 5060 – the SIP port expected by our SIP Trunk Carrier.

·       Action >> Transport Type: UDP – the SIP protocol expected by our SIP Trunk Carrier.

 

 

Additional Requirements for Outbound FAX/Calls

We’re not done yet to get Outbound working unfortunately…

 

DTMF Digit Length

Once the above steps are complete, we can see calls trying to go out, but we notice it was only using the first 4 dialed digits in the INVITE. This turns out to be a DTMF setting.

 

Gateway > DTMF & Supplementary > DTMF & Dialing > Max Digits in Phone Num

Change the default of 4 to 16 and click Apply, so that the all the necessary digits are sent to our SIP Trunk Carrier .

 

 

 

Codecs and Media Security

Once the digit length was corrected, we could get the call out to our carrier, but it was rejecting it with a 488 Not Acceptable Here message. Usually, this means a codec mismatch, so we force a single codec to send to the carrier:

 

·       Create and save a new Coder Group that contains only the G.711ulaw codec. (US Carrier)

·       Create and save a new Tel Profile that uses that Coder Group

·       Apply that Tel Profile to the Trunk Group of the active FXS ports

 

Ok, that’s good that the INVITE to our carrier now matches the audio of normal outbound SIP call, but still getting 488 Not Acceptable Here returned from them, so digging further, we noticed that the INVITE included RTP/SAVP in the media section of the body. This means we’re trying to use Media Security, which Carrier isn’t accepting this. So, tried setting the SBC Media Security Mode to Not Secured in the Carrier SIP Profile, but this made no difference. 



Still sending SAVP. The only fix was instead to disable media security globally in Media > Media Security > Media Security

 



After all this (whew!), we can now send and receive FAXes!!!

  

APPENDIX

You can also manipulate the incoming or outgoing details in the Gateway > Manipulation tab if you require to add or remove digits/prefix etc…

 

We can also monitor the FAX as it is used, under the Monitor tab, left click on the port and go to Port Status, you can click on Port Description to give it a name or show the phone number assigned here also for ease of management.



Under SIP, we can see the details of the call at its current state:



Port will also show Green when in use:



Comments

Popular posts from this blog

Unassigned Numbers in Microsoft Teams using Audiocodes SBC

Communicator ports used for communication

Teams Device Health Monitoring and Reporting