Asterisk 13. Audiocodes MP118

Hello everybody.

I have what I think could be a very basic configuration problem.
I am trying to setup an 8 port analog gateway. 4 ports are FXS and the other are FXO.
My idea is to register each port individually so for example the 4 FXS can belong to an internal context, and the 4 FXO can belong to an external one (may be “FROM-PSTN”).
If I do that, almost everything works fine… I can call my bria softphone from any of the FXS and vice versa. I can also call from the softphone to the PSTN via the FXOs.
The problem I have is related to the incoming calls from the PSTN. Asterisk sees the incoming calls as coming from unknown endpoints, and this makes sense to me because every caller has a different caller ID…
This is what I am talking about:
res_pjsip/pjsip_distributor.c:256 log_unidentified_request: Request from ‘“11XXXXX539” sip:11XXXXX539@192.168.101.161’ failed for ‘192.168.101.161:64387’ (callid: 184590733321201023112@192.168.101.161) - No matching endpoint found

When in the past I had and analog gateway with only one FXO, I solved this using the IDENTIFY parameter with a match to the IP of my old gateway.
Now I can’t do that because each port is registering from the same IP address, so the identify wouldn’t make any sense here.

Can anyone tell me how should I setup my gateway or what is the recommended way to setup this kind of gateways with Asterisk?

The other option that I am analyzing consists into registering the gateway as a whole. This will work for incoming and outgoing calls, but this way the 8 ports will be in the same context and I don’t like that.

Any help will be appreciated.

Thanks

Gaston.

The purpose of endpoint identification is to determine who a SIP message is coming from. Right now there’s 4 ways:

  1. The user portion of the ‘From’ header
  2. By source IP address
  3. By a ‘line’ parameter which can be enabled in an outbound registration
  4. Anonymously

If you can’t differentiate on a per-port basis using the above then the only fallback would be matching based on IP address, sending it to a context, and then using PJSIP_HEADER to extract specific information that identifies the port. Based on that you could Goto() elsewhere.

That requires there to be some sort of unique identifying information in the SIP message. Is there?

If not then I’m afraid you are out of luck.

[quote=“jcolp”]The purpose of endpoint identification is to determine who a SIP message is coming from. Right now there’s 4 ways:

  1. The user portion of the ‘From’ header
  2. By source IP address
  3. By a ‘line’ parameter which can be enabled in an outbound registration
  4. Anonymously

If you can’t differentiate on a per-port basis using the above then the only fallback would be matching based on IP address, sending it to a context, and then using PJSIP_HEADER to extract specific information that identifies the port. Based on that you could Goto() elsewhere.

That requires there to be some sort of unique identifying information in the SIP message. Is there?

If not then I’m afraid you are out of luck.[/quote]

Hello Jcolp, thank again, you always answer my posts…

Today I am testing a workarround that seems to work fine.
I found a setting in the audiocodes gateway that copies the calling id num into the calling id name. Then, there is another setting in the gateway that permits to manipulate the calling id number. I replaced then the calling id number with the user id of the FXO so when a call comes from an FXO Asterisk sees it as coming from the user “fxo@asteriskipaddress” and the call goes through. As the calling name actually has the copied calling id number, the user on the called phone sees the right caller id.
It seems to work fine.

Thanks again for your help.

Gaston.