Direct SIP call to FreePBX - 484 address incomplete

Hello, first i would like to thank for this lovely community and mainly for the FreePBX project which is a perfect solution for a problem I’m trying to solve. I’m facing a simple task, I live in an Appartment building and the doorbells are an intercom from a company called 2N, in my flat i have a Grandstream phone and it works really simple, the intercom makes a direct sip call to the IP address of the Grandstram phone and if the phone enters some keypad combination while on the call, it unlocks the front door.

So as a first thing I tried to used a soft phone instead of the Grandstream phone, gave it the same IP addres and I succeeded with finishing the call. So the idea is, to have a server on the IP address the intercom is trying to call and then route the call eg. to my cellphone (with a sip client installed) or respond with a message.

I Enabled Anonymous Calls in SIP settings, then i created an extension “1”, set up Inbound route and routed all to the extension 1 - I logged on my cellphone’s sip client, as a sip server address i specified 192.168.1.XXX (where freepbx is running) and on my laptop i tried to call [email protected] and it succesfully called my mobile. Felt great. But when i try to calling without the prefix before the @, so just sip:192.168.1.XXX (as if the intercom was calling), it only gets rejected with 484 address incomplete and the call is not even estabilished (not even the asterisk log tells about the call).

Is there a way to enable redirecting to extension if the SIP call is only being made to the IP address?
Note: I cannot change any settings in the intercom since I don’t have the credentials for it. I’m also not trying to call from outside of the network, so not trunks i needed i suppose?

Thank you 1000 times for your patience.

I’d try this first: set up a trunk that has the IP address of the 2N. Set it up like any normal IP-direct trunk. From that trunk, get the incoming phone number from the box and set up and inbound route with that “Caller ID” information and override the CID option on that screen.

With the trunk, the call can come in from the IP address. From there, tune it so that the system responds correctly to the incoming call and you should be closer.

Thank you for the reply, this solution sounds the most promising…

So to prevent running up and down I tried this solution by

  • giving the grandstream phone an ip address of 192.168.1.199
  • creating a trunk
  • setting up all inbound routes to play a “zapateller sound”

I still get no luck with incoming calls from the phone, i still get “Address incomplete” error while dialing 192.168.1.109 from the phone.

The trunk is working for outgoing calls, however - if set an inbound route, which routes everything to the trunk and i dial [email protected] from my laptop, the phone starts to ring.

Another interesting fact is that when i try to change the “Authentication” to “inbound” in trunk settings, and try to dial 192.168.1.109 from the phone, the error code changes to 401 unauthorized and i can see the message in the FreePBX log. Apart from the “Address incomplete” error, which I can only see on the phone.

Also tried to mess arround with all the trunk advanced settings like “from domain” and such, but no luck with that :disappointed: It’s really weird

Clearly I don’t understand what you are trying to do. You said you were trying to get the N2 unit to interface to your PBX, which has nothing to do with the solution you came up with.

Call routing is based on the user part of the SIP URI. Even if you set up an “any/any” route it won’t match because (nothing in the user part) is different from “any”.

The Grandstream seems to accept any SIP INVITE sent to it.

Then you probably shouldn’t be doing this…?

But if you insist on hacking around anyway, put something in between the intercom and Asterisk such as a proxy like opensips that can manipulate the request and present it to Asterisk with a RURI of sip:[email protected]

Hi, sorry for explaining it with such a shitty way…
Current state: Intercom is a caller, Grandstream phone is a receiver.
Desired state: Intercom is a caller, FreePBX is a receiver and routes it to other devices.
What I’m testing with (since i don’t see the logs of the Intercom and it’s down the stairs): Phone is a caller, FreePBX is a receiver and responds with ANYTHING

Then you probably shouldn’t be doing this…?

I’m doing this on my end just to replace the phone device, which I’m allowed to do, I’m just trying to come up with some future proof way, eg. opening someone remotely… And it will be only the calls to my apt. that will be handled like this, I don’t want to interfere with any other calls…

But if you insist on hacking around anyway, put something in between the intercom and Asterisk such as a proxy like opensips that can manipulate the request and present it to Asterisk with a RURI of sip:[email protected]

so there’s no way of doing this on FreePBX settings? That it will automatically append some number or string or anything in front of the ip? :confused:

Please post the INVITE request sent by the 2N:

At the Asterisk command prompt, type
pjsip set logger on
and have the intercom call in. The SIP trace will appear in the Asterisk log; paste the relevant section at https://pastebin.freepbx.org and post the link here.

https://pastebin.freepbx.org/view/e89c805d

I set up a chan_sip trunk and was able to call it without a user part in the SIP URI.

The CDR showed a DID of “s” (without the quotes) so you could route that specially if desired.

Unfortunately, since I assume that you have no control over the port the 2N sends to, you would have to put chan_sip on 5060 (after moving pjsip to another port).

Are you also trying to get the intercom’s video working through Asterisk?

That is an interesting difference in behavior between the two SIP channel drivers. A bigger difference than I would expect because it’s not really related to SIP at all but rather call routing.

That would be a bug which I thought we fixed previously. If no user is specified then we should default to “s” as the extension (random: it means start). Please file an issue on the issue tracker[1].

[1] https://issues.asterisk.org/jira

2 Likes

Oh my god it actually worked, just switching the SIP drivers… I’m so happy that it’s actually working now… Thank you infinity times…

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.