Hello, I am trying to setup FreePBX as a PBX for Skype For Business. I´ve followed this tutorial (www-moh10ly-com/blog/VoIP/asterisk/freepbx-asterisk-now-with-skype-for-business-integration --please change - for . as this system doesn´t allow me to paste URL links). I can call from FreePBX to S4B client but not back. It doesn´t matter which extension (built-in, existing, non-existing) I am dialing from the S4B client, it keeps telling me, that dialed number is not existent. Further, in the log, I can see Rejecting unknown SIP connection from IP-ADDRESS -OF-S4B-BOX.
My extension on FreePBX are using pjsip, Trunk is sip. S4B is configured to contact FreePBX box on port TCP/5160
Inbound and outbound routes are set accordingly to Mohammed´s article. Nevertheless, any call from S4B to FreePBX is marked with from-sip-external context. It´s driving me crazy because I cannot see why the incoming route is not being used, and therefore these calls are handled as an unknown peer will dial them. I must admit, that I am a FreePBX/Asterisk newbie, but still, it doesn´t make any sense to me. Thanks for any help.
Also keep in mind that the Inbound Routes are only hit AFTER the PBX accepts a call OVER a trunk. So if the PBX is getting a call that it can’t match an IP for on a trunk, you’re going to get what you’re getting.
So let’s see how this call is actually hitting the PBX because the one thing that you have happening that this tutorial doesn’t (it seems) is that the author had “Allow SIP Guests” which would ignore the “sip-external” filter/check and allow any calls to be accepted on the PBX. That’s not the only issue with that article, it’s poorly done and the idea of it “working” is probably based on the author’s PBX being totally setup insecurely and allowing anyone in the world to make calls to it.
<------------>
[2018-10-15 18:47:10] VERBOSE[99396][C-0000002e] chan_sip.c: Scheduling destruction of SIP dialog ‘4df05419-0a05-49f9-879c-a64ffa3797ba’ in 32000 ms (Method: INVITE)
I think that the important record here is: No matching peer for ‘010’ from ‘10.10.64.50:49385’. But why? The trunk is configured to use this IP - IP-ADDRESS-OF-S4B-BOX in my previous post is 10.10.64.50. No other IP is used by the S4B host. The extensions are configured that everything matching pattern 0XX are extensions on S4B and are routed there (outgoing calls are working well), all other (ie. 6599) are FreePBX local.
So then that is actually host=10.10.64.50? Because that was hidden when you showed the config. Because if yes, then I think the issue is with this being type=friend since that wants to look at the user/ip and in this case it wants 010 to be the user but the trunk would be user Skype4B. So what this is saying when it is rejecting is “I can’t find a peer that matches both 010 and 10.10.64.50”
How are you defining the peers? Normally, this message means that the extension you are trying to reach through the SIP handler you are using (for the port in question) isn’t defined (you’ve got it in the Chan-SIP extensions, but not the PJ-SIP extensions and are handling it from PJ-SIP).
You mean peers as a trunk or peers as extensions. The first one I´ve already posted here in my first post. For the second one, the idea is to have pjsip extensions on FreePBX and also every three digits extensions, that begin with 0 (so the pattern 0XX), are handled by the Skype4B. So the current testing configuration:
PJSIP extensions on FreePBX: 100, 150
Custom IVR menu on FreePBX: 6599
Extensions handled by Skype4B (and no config, other than the routes, about them in FreePBX): 010, 011
Calls between pjsip extensions are working normally, calls from pjsip extensions to IVR menu are working normally. Calls between Skype4B extensions are handled by Skype4B (so no touch from FreePBX) and are working normally. Calls from pjsip extensions to Skype4B extensions are working normally. The trouble here are “only” calls from Skype4B extensions to anything defined on FreePBX (PJSIP, IVR or built-in).
To make you full picture here, when I get this done, I want to connect another trunk from the VoIP provider to be able to make regular calls in and out either from pjsip extension and from Skype4B. So that means, that if Skype4B extensions will dial any regular telephone number, the call will be handled by Skype4B trunk in FreePBX and then routed to the VoIP provider trunk and there to the outside world. The nice to have thing here is to have phone number range from VoIP provider, so if anyone will dial XXX XXX 100, then this call will automatically ring on the 100 pjsip extension, and if anyone will dial XXX XXX 010, then this call will automatically ring on the 010 Skype4B extensions (that means it will be received by FreePBX on VoIP trunk, then strip only to 010 and then handled by the Skype4B trunk and hand over to the Skype4B). But all of this is step two and now I am stuck at the step one.