Quantcast
Channel: FreePBX Community Forums - Latest posts
Viewing all 226036 articles
Browse latest View live

Email configuration for Office 365

$
0
0

Hi!

What @waldrondigital posted essentially comes from

https://wiki.freepbx.org/display/PPS/Setup+Postfix+Manually

It's just people don't realize this is something they, at least currently, have to do that for office 365...

Microsoft servers are in their rights to to refuse to process emails with incorrect/unknown domains (or emall addresses which have not been given proper permissions, ie the "Send as")...

(As mail admins say, their servers, their rules...)

Anyway, for unknown domains if office 365 didn't block those they would most likely end up being blocked by the receiving servers.

(My MX for my domains and the ones I setup in the past certainly would...)

Honestly, as far as I am concerned, System Admin Pro should probably set up all these remappings by itself when you tell it you are relaying through office 365 servers (and maybe for other servers as well since it's not actually acceptable anywhere to send mails from unknown domains) and give it the permission to do it...

On a dedicated system it's not much of a problem for System Admin Pro to alter Postfix's configuration in such a way but if that system does more than FreePBX/Asterisk duty then I would be hesitant to have this done automatically, it might corrupt an otherwise working setup...

Have a nice day!

Nick


Steps to getting FreePBX to work with Office 365 email

$
0
0

Steps to getting FreePBX to work with Office 365 email

Using the Commercial System Admin module makes this a bit easier. It would still be possible to do this without the Commercial System Admin module, but you will need to configure many more options manually through editing the files of course. See "Setup Postfix Manually" (below) in the references section.

Many of the Asterisk, FreePBX, Linux gurus out there don't yet fully understand, is that Office 365 is more paranoid than most SMTP systems. It requires a few things before an email can be relayed, one of them being from a known account, and the other one being that it has to be from a known good IP. These type of setups will become standard fare for new email systems, and will be accepted best practice going forward.

Requirements for this method:
1. You are using a fixed IP address
2. You don't need IPv6 on your PBX (as Office 365 does not support it, yet)
3. A known good Office 365 account and password
4. Optional, but highly recommended: Commercial System Admin module

NOTE: There is another method that you can use to setup emails for FreePBX and Office 365. I had this working nicely as well, and that is to use another SMTP relay on your local network. I did that with my IIS server SMTP relay, and it worked great. I would prefer using that method actually, however, not all my clients have an on-prem setup like that, and I wanted to ensure that I could get this to work with their Office 365 setup as is. If you want more information on how to setup IIS with SMTP relay, see reference #4 at the end of this post.

Steps

[1] Tell Office 365 you are "coming to dinner". In that sense you will need to setup an SPF text record for your domain that informs Office 365 that you are a "good boy", and that your public facing IP address can be trusted. Since your SPF record already exists for your domain for Office 365, you will not so much need to add it, but modify it so that it include the external IP of your PBX to the following:

v=spf1 ip4:Static IP Address include:spf.protection.outlook.com ~all <-- Where it says ip4: you put in your pbx address

Note, that if you already have an ip4: in there with an IP, you can add another.

[2] Modify your /etc/postfix/generic by adding these lines, replacing RealAccountInOffice365@YourRealDomain.com with a real email account in your Office 365 system.

root RealAccountInOffice365@YourRealDomain.com
root@localhost RealAccountInOffice365@YourRealDomain.com
root@localhost.localdomain RealAccountInOffice365@YourRealDomain.com
root@freepbx RealAccountInOffice365@YourRealDomain.com
root@freepbx.localdomain RealAccountInOffice365@YourRealDomain.com
asterisk RealAccountInOffice365@YourRealDomain.com
asterisk@localhost RealAccountInOffice365@YourRealDomain.com
asterisk@localhost.localdomain RealAccountInOffice365@YourRealDomain.com
asterisk@freepbx RealAccountInOffice365@YourRealDomain.com
asterisk@freepbx.localdomain RealAccountInOffice365@YourRealDomain.com
vm@asterisk RealAccountInOffice365@YourRealDomain.com
@freepbx.localdomain @YourRealDomain.com

[3] Add the following to the end of /etc/postfix/main.cf
smtp_generic_maps = hash:/etc/postfix/generic
and
inet_protocols = ipv4

Reload postfix by running these commands:
postmap /etc/postfix/generic
service postfix restart

NOTE/OPTIONAL: I also took the liberty to disable IPv6 at the Centos OS level as well. I do not need IPv6, nor is it supported end to end everywhere, so I don't want it to ever be an issue until I know IPv6 is supported everywhere. If you want to disable IPv6 at the OS level you can do so by going to /etc/sysctl.conf and adding the following line: net.ipv6.conf.all.disable_ipv6 = 1 save the file, then reload the system ip configuration by issuing this command: sysctl -p

[4] Using the Commercial System Admin module, go to Email Setup. Use these settings:
Provider: Other <-- Don't use Office 365, as you want explicit control of the settings here
SMTP Server: Use External SMTP Server
My Hostname: whatever.YourRealDomain.com
My Origin: whatever.YourRealDomain.com
My Domain: whatever.YourRealDomain.com
SMTP Server: smtp.office365.com:587
Use Auth: Use Authentication
Username: RealEmailAddressOfOffice365Account@YourRealDomain.com
Password: TheRealPassword

[5] Click on the Submit button
[6] Click on Debug, and then use a real email address to sent it to. The output of the debug should show you want is right/wrong and should help if you still have issues with the setup.

References:
1. Setup Postfix Manually - https://wiki.freepbx.org/display/PPS/Setup+Postfix+Manually
2. How to set up a multifunction device or application to send email using Office 365 - See section 3, click on "Settings for Office 365 SMTP relay" https://support.office.com/en-us/article/How-to-set-up-a-multifunction-device-or-application-to-send-email-using-Office-365-69f58e99-c550-4274-ad18-c805d654b4c4
3. Turning off IPv6 on CentOS - http://www.networkinghowtos.com/howto/disable-ipv6-on-centos/
4. How to configure IIS for relay with Office 365 - https://support.office.com/en-us/article/How-to-configure-IIS-for-relay-with-Office-365-eb57abd2-3859-4e79-b721-2ed1f0f579c9

Email configuration for Office 365

Email configuration for Office 365

$
0
0

Nice. I could seriously use a beginning to end how to guide. A definitive guide would have saved me, and I'm sure many others countless hours of frustration. I'll be on the lookout for it.

Email configuration for Office 365

$
0
0

Yep! Read the post just above yours in this thread, I have just posted my write up.

PBXact Login Page Not working

Include RPID in first Ringing (180) sent to trunk

$
0
0

Well first the CallerID is from the person calling and therefore part of the INVITE. A 180/183 is a REPLY from the PBX, the PBX would not be sending back CallerID in a reply because that's really not how it works. Yes, it is possible but that's not how Asterisk works.

So Caller Phone is going to send it's CallerID to the CME which should pass that through to FreePBX, when FreePBX sends the 18X message back, there's no CallerID in those messages. It will pass the CallerID to the final destination.

You have to look at what the CME is doing, because it is in the way and well Cisco is known for doing things their own way and not standard.

But there is no callerid in replies only in requests.

Send mp3 in voicemails with FreePBX 14

$
0
0

This post is an update to "Send mp3 voicemails with FreePBX 13"

An updated sendmailmp3 script that will work in FreePBX 14 (and 13, but you have to install lame). With 14, lame and sox are included in the distro, so you just need to do these steps:

  1. Create sendmailmp3 in /usr/sbin
  2. Paste in the text from the newer version of the script available here: http://bernaerts.dyndns.org/linux/179-asterisk-voicemail-mp3
  3. Make it executable: chmod +x /usr/sbin/sendmailmp3
  4. In FreePBX 14, Go to Settings > Voicemail Admin
  5. Click on Settings, then Email Config
  6. Scroll down and find the Mail Command setting. Change this to “/usr/sbin/sendmailmp3″ (without the quotes)
  7. Submit your settings and be sure to click the Apply Config button.

Don't send me mail on how the script works, I didn't write it, so you make ask the creators and maintainers here:
http://bernaerts.dyndns.org/linux/179-asterisk-voicemail-mp3

I will also paste-dump the script below in case the page referenced disapears:

#!/bin/sh
# Asterisk voicemail attachment conversion script
# Revision history :
# 22/11/2010 - V1.0 - Creation by N. Bernaerts
# 07/02/2012 - V1.1 - Add handling of mails without attachment (thanks to Paul Thompson)
# 01/05/2012 - V1.2 - Use mktemp, pushd & popd
# 08/05/2012 - V1.3 - Change mp3 compression to CBR to solve some smartphone compatibility (thanks to Luca Mancino)
# 01/08/2012 - V1.4 - Add PATH definition to avoid any problem (thanks to Christopher Wolff)
# 16/07/2015 - V1.5 - Handle natively GSM WAV (thanks to Michael Munger)

# set PATH
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# save the current directory
pushd .

# create a temporary directory and cd to it
TMPDIR=$(mktemp -d)
cd $TMPDIR

# dump the stream to a temporary file
cat >> stream.org

# get the boundary
BOUNDARY=$(grep "boundary=" stream.org | cut -d'"' -f 2)

# cut the file into parts
# stream.part - header before the boundary
# stream.part1 - header after the bounday
# stream.part2 - body of the message
# stream.part3 - attachment in base64 (WAV file)
# stream.part4 - footer of the message
awk '/'$BOUNDARY'/{i++}{print > "stream.part"i}' stream.org

# if mail is having no audio attachment (plain text)
PLAINTEXT=$(cat stream.part1 | grep 'plain')
if [ "$PLAINTEXT" != "" ]
then

  # prepare to send the original stream
  cat stream.org > stream.new

# else, if mail is having audio attachment
else

  # cut the attachment into parts
  # stream.part3.head - header of attachment
  # stream.part3.wav.base64 - wav file of attachment (encoded base64)
  sed '7,$d' stream.part3 > stream.part3.wav.head
  sed '1,6d' stream.part3 > stream.part3.wav.base64

  # convert the base64 file to a wav file
  dos2unix -o stream.part3.wav.base64
  base64 -di stream.part3.wav.base64 > stream.part3.wav

  # convert wave file (GSM encoded or not) to PCM wav file
  sox stream.part3.wav stream.part3-pcm.wav

  # convert PCM wav file to mp3 file
  # -b 24 is using CBR, giving better compatibility on smartphones (you can use -b 32 to increase quality)
  # -V 2 is using VBR, a good compromise between quality and size for voice audio files
  lame -m m -b 24 stream.part3-pcm.wav stream.part3.mp3

  # convert back mp3 to base64 file
  base64 stream.part3.mp3 > stream.part3.mp3.base64

  # generate the new mp3 attachment header
  # change Type: audio/x-wav or audio/x-WAV to Type: audio/mpeg
  # change name="msg----.wav" or name="msg----.WAV" to name="msg----.mp3"
  sed 's/x-[wW][aA][vV]/mpeg/g' stream.part3.wav.head | sed 's/.[wW][aA][vV]/.mp3/g' > stream.part3.mp3.head

  # generate first part of mail body, converting it to LF only
  mv stream.part stream.new
  cat stream.part1 >> stream.new
  cat stream.part2 >> stream.new
  cat stream.part3.mp3.head >> stream.new
  dos2unix -o stream.new

  # append base64 mp3 to mail body, keeping CRLF
  unix2dos -o stream.part3.mp3.base64
  cat stream.part3.mp3.base64 >> stream.new

  # append end of mail body, converting it to LF only
  echo "" >> stream.tmp
  echo "" >> stream.tmp
  cat stream.part4 >> stream.tmp
  dos2unix -o stream.tmp
  cat stream.tmp >> stream.new

fi

# send the mail thru sendmail
cat stream.new | sendmail -t

# go back to original directory
popd

# remove all temporary files and temporary directory
rm -Rf $TMPDIR

Email configuration for Office 365

$
0
0

Thank you for putting the writeup together. I completed all the step on your write up.

I am now getting:

Sep 24 00:10:09 freepbx postfix/smtp[6482]: AB2F462ABF38: SASL authentication failed; cannot authenticate to server smtp.office365.com[40.100.162.178]: no mechanism available
Sep 24 00:10:09 freepbx postfix/smtp[6477]: warning: SASL authentication failure: No worthy mechs found
Sep 24 00:10:09 freepbx postfix/smtp[6477]: C0E8F62ABF3B: to=asterisk@freepbx.local, relay=smtp.office365.com[40.97.115.50]:587, delay=503, delays=501/0.04/2.1/0, dsn=4.7.0, status=deferred (SASL authentication failed; cannot authenticate to server smtp.office365.com[40.97.115.50]: no mechanism available)

Any ideas?

Email configuration for Office 365

$
0
0

Check your /etc/postfix/main.cf

Do you have

smtp_generic_maps = hash:/etc/postfix/generic
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options =
smtp_use_tls = yes
smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt
relayhost = smtp.office365.com:587
myhostname = yourhostname.WhatEverItIs.com
mydomain = yourhostname.WhatEverItIs.com
myorigin = yourhostname.WhatEverItIs.com

The Commercial System Admin module should set this for you if you used the recommendations in my other post:

SIP Trunk Providers

$
0
0

Have be using freevoipdeal and frynga for some time now. They have a lot of names, with a lot a different prices. Very cheap prices :grin:

SIP Trunk Providers

$
0
0

Good writeups here.

My 2cents on Flowroute, I have to say their T38 support is awesome and rock solid. Sounds like @Marbled is on to them as well for faxing. Worth considering if fax is essential. I do use them for voice as well with no issues.

Billing for PBXact

$
0
0

For PBXact? No. You are talking about a business PBX appliance not a hosted voice/VoIP service platform. Yes, you can use A2Billing or any other Asterisk based billing solution I'm sure on the system but FreePBX isn't designed for what you are doing.

FreePBX/PBXact is designed to be a company/business PBX system. If your plan is just to slap some billing solution on your PBXact system and start selling voip services, you are going to be in for plenty of surprises and mostly likely, upset customers.

Bonding and using System Admin

$
0
0

Well, how often do you need to make changes? Doesn't seem like something you'd be making changes to on a regular basis. However, the answer is no you cannot do this via the System Admin GUI without modifying how FreePBX generates the config for interfaces.

This is not a setup that FreePBX was designed for out of the box.

Request 'INVITE' from XXX failed - No matching endpoint found

$
0
0

Hi,

I made a fresh installation from FreePBX Distro ISO. The installation is in an internal (private) LAN and have a trunk configurated with outbound and inbound routes.
For now I use a softphone (Ekiga) for test.
I have created an extension 101, of type PJ-SIP, and associate it to inbound route. This works well, softphone is registered and rings when an external call coming.
When I try to make an outbound external call from the softphone, I obtain the following error:

[2017-09-24 08:47:00] NOTICE[4101] res_pjsip/pjsip_distributor.c: Request 'INVITE' from '"Ekiga" <sip:msarti@192.168.200.183>' failed for '192.168.200.183:5060' (callid: 8cfb1599-729f-e711-823d-ec8eb5a89425@laptop.sarti.lan) - No matching endpoint found
[2017-09-24 08:47:00] NOTICE[4101] res_pjsip/pjsip_distributor.c: Request 'INVITE' from '"Ekiga" <sip:msarti@192.168.200.183>' failed for '192.168.200.183:5060' (callid: 8cfb1599-729f-e711-823d-ec8eb5a89425@laptop.sarti.lan) - Failed to authenticate

192.168.200.183 is the actual IP address of softphone, where no firewall is running. Naturally is a LAN IP.

Any ideas?


Send mp3 in voicemails with FreePBX 14

$
0
0

I have used this script as a basis for something else, and I found that VM notifications without attachments would fail to send. Anyone else who has the same issue may be able to resolve by modifying it as I've done here:

Extensions thru PfSense VPN

$
0
0

I have two locations connected via PfSense (firewall) IpSec VPN tunnel. Location "A" has my FreePBX box behind it and location "B" has two IP telephone extensions behind it.

Everything was working fine until I discovered that my FreePBX box (and firewall) were being attacked by rogue (known blacklisted VOIP) ip addresses. When I determined how to set PfS to accept ONLY connection from my SIP provider then the location "B" extensions had no RTP in or out. I could dial in and out but calls had no voice connection and would time out after 31 seconds.

This is the part that baffles me. PfS is connected via IPSec VPN so no settings on WAN should effect the VPN traffic but, location "B" RTP is being blocked. When I added the location "B" to allow FreePBX to have connection RTP traffic returned.

The PfSense forum is concerned that I might be exposing my FreePBX box or my location "B" extensions to the internet due to the current settings being used.

I am in a difficult position in that this could be a firewall issue, which is not a FreePBX forum issue but without the ability to understand testing and logfile entries of FreePBX I will not be able to figure this out what is wrong, if anything.

My question is what log files do I need to look at to determine the changes in RTP connection? Is there something to "turn on" to help me debug this issue?

Request 'INVITE' from XXX failed - No matching endpoint found

$
0
0

Very strange, the softphone registration password works since it can receive calls, but the Invite password fails. Try a different phone and see if the same thing happens.

Include RPID in first Ringing (180) sent to trunk

$
0
0

A 180/183 is a REPLY from the PBX, the PBX would not be sending back CallerID in a reply because that's really not how it works

As far as I see in SIP debugs it works during local calls - first Ringing reply includes proper RPID:
Remote-Party-ID: "called name" sip:xxxx@192.168.x.x ...

But if incoming channel is sip-trunk then first Ringing 180 reply (generated by FreePBX before answer from called phone) doesn't include proper RPID. Second Ringing reply (generated called phone) includes proper RPID, but CME handling only first answer.
In this case it is first Ringing reply prevents proper displaying called name on caller's phone.

It turns out this is known problem in asterisk. In this commit (https://reviewboard.asterisk.org/r/4473/) developers talk about this problem. They talked about creating the rpid_immediate option for chan_pjsip driver. And for chan_sip driver rpid_immediate option existing for a long time.

excerpt from comment in source:

rpid_immediate default=no
Send connected line updates on unanswered incoming calls immediately
Send 180 Ringing or 183 Progress response messages to the caller if the connected line information is updated before the call is answered. This can send a 180 Ringing response before the call has even reached the far end. The caller can start hearing ringback before the far end even gets the call
Many phones tend to grab the first connected line information and refuse to update the display if it changes. The first information is not likely to be correct if the call goes to an endpoint not under the control of the first Asterisk box

I will try to play with rpid_immediate option after weekend.

Include RPID in first Ringing (180) sent to trunk

Viewing all 226036 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>