Categories
Blog Handsets Products Sangoma Phones Software

Sangoma Connect Mobile

We know that right now, communication is key. We also know that you need to be able to work where it makes the most sense for you, so mobility is a must. Connect Mobile is here to help you communicate more effectively, It is the next-generation mobile softphone app for FreePBX and PBXact.

Sangoma Connect Mobile combines the best of our existing solutions with new core mobile technologies to provide a greater communication experience for calling and collaborating with coworkers.


It allows staff to work remotely using the Sangoma Connect Mobile
app for iOS and Android devices. Employees can enjoy voice, SMS, and multi-party video collaboration*, using their business extension,
while keeping their personal device information private.
The intuitive onboarding process sends an auto-generated email to
each user upon activation from the PBX with simple instructions for
them to download the app with instant log-in. It’s as simple as that!
Secured Communications
Sangoma Connect users are protected by TLS/SRTP encryption
which means their phone calls are kept private while on cellular
or WiFi connections, and your business is secured from any
unauthorized connections.

Sangoma Connect Mobile provides rich voice and video calling for PBXact and FreePBX, on iOS and Android devices. We’ve made the onboarding experience very simple for system administrators to provision, and for users to install:

  • Audio & Video Calls using your Business Extension, Make and receive calls using your mobile device, while protecting your,personal phone number, using mobile data or WiFi connection.
  • Do-Not-Disturb (DND), Silence all inbound business calls when you don’t want to be disturbed using the scheduling feature for automatic behavior.
  • Voicemail, Receive business voicemail directly to the app, allowing users to quickly listen to calls they have missed.
  • QuickDial with BLF, Create a list of favorite contacts for easy access with BLFs (Busy Lamp Field) that also show the current status of your colleagues.
  • Powerful Call Control, Users can blind & Warm transfer calls, record and have 3-way conversations

And that’s it! It just works. Issues like certificate management, which can be a manual process with other apps, are handled automatically.

Another great feature is the integrated Sangoma Meet, the award-winning video conferencing platform within Sangoma Connect Mobile, making it super simple to create or join a multi-party video conference.

How to Get It

Sangoma Connect Mobile is included, free-of-charge, for all new and existing PBXact systems.  It is also free-of-charge to FreePBX customers with an active connect license, for the same amount of users already purchased. Simply perform an update on your system, and Sangoma Connect will be available within the User Management Module.

Purchasing Options

FreePBX customers can dowload a free 2 user 1 year licence, and those wishing to purchase a Sangoma Connect Mobile license can do so from us.  Sangoma have integrated Sangoma Connect Mobile with Connect Desktop , users can take advantage of even further collaboration tools for your MacOS or Windows computer. Simply purchase the Connect license from the portal store and choose to use Sangoma Connect Mobile, or both! If needed, here are some helpful instructions on how to purchase a license and how to install on your FreePBX system.

Download the Mobile Client

End users can download the iOS or Android app, for free, by searching for ‘Sangoma Connect’ in the respective app stores. A direct download link is also available within the invitation email end-users receive. Here is information on how to use the app.

Email or Call for current licence pricing

Categories
Asterisk Support Knowledge Base Products and services Technical

Gradwell IP Address ranges

At Gradwell, they send internet traffic from different addresses (known as IP addresses) to allow their telephony systems to work smoothly. Below is the list of IP addresses where their VoIP (Voice over IP) traffic will come from. It’s important that your firewall allows traffic from these addresses however they recommend you don’t set it to allow only from these, just that they are included.

The reason they say don’t allow only these addresses is that there network is dynamic and may shift or new items added and we don’t want this to affect your service.

There are a couple of things you should do to ensure you get the most from the Gradwell Voice services:

  • Check your firewall filtering – is there anything being excluded?
    • If yes – Allow the IP range traffic – this will most likely be in your firewall settings or tools (they all differ so they can’t exactly point you there)
    • If no – you’re good to go
  • If you use UDP traffic then you’ll need to allow Media ports (known as RTP) with the numbers 1024 to 65535

Current ranges as of summer 2021

109.224.232.0/22 109.224.232.0 to 109.224.235.255
109.224.240.0/22 109.224.240.0 to 109.224.243.255
109.239.96.132/31 109.239.96.132 to 109.239.96.133
141.170.24.21/31 141.170.24.21 to 141.170.24.22
141.170.24.5/31 141.170.24.5 to 141.170.24.6
141.170.50.16/28 141.170.50.16 to 141.170.50.31
185.47.148.0/24 185.47.148.0 to 185.47.148.255
194.145.188.224/27 194.145.188.224 to 194.145.188.255
194.145.189.52/31 194.145.189.52 to 194.145.189.53
194.145.190.128/26 194.145.190.128 to 194.145.190.191
194.145.191.128/27 194.145.191.128 to 194.145.191.159
195.74.60.0/23 195.74.60.0 to 195.74.61.255
213.166.3.128/26 213.166.3.129 - 213.166.3.190
213.166.4.128/26 213.166.4.129 - 213.166.4.190
213.166.5.0/24 213.166.5.0 to 213.166.5.255
78.40.243.192/27 78.40.243.192 to 78.40.243.223
87.238.72.128/26 87.238.72.128 to 87.238.72.191
87.238.73.128/26 87.238.73.128 to 87.238.73.191
87.238.74.128/26 87.238.74.128 to 87.238.74.191
87.238.77.128/26 87.238.77.128 to 87.238.77.191

To simplify things a bit listed below are the ranges in common formats.

Rules for Freepbx Custom file “firewall-4.rules”

-A fpbxreject -s 109.224.232.0/22 -p udp -m udp --dport 4569:5270 -j ACCEPT
-A fpbxreject -s 109.224.240.0/22 -p udp -m udp --dport 4569:5270 -j ACCEPT
-A fpbxreject -s	109.224.222.16/28	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A fpbxreject -s	109.224.232.0/22	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A fpbxreject -s	109.224.240.0/22	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A fpbxreject -s	109.239.96.132/31	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A fpbxreject -s	141.170.24.20/30	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A fpbxreject -s	141.170.24.5/31	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A fpbxreject -s	141.170.50.16/28	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A fpbxreject -s	185.47.148.0/24	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A fpbxreject -s	194.145.188.224/27	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A fpbxreject -s	194.145.189.52/31	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A fpbxreject -s	194.145.190.128/26	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A fpbxreject -s	194.145.191.128/27	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A fpbxreject -s	195.74.60.0/23	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A fpbxreject -s	212.11.68.144/28	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A fpbxreject -s	213.166.2.128/26	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A fpbxreject -s	213.166.3.128/26	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A fpbxreject -s	213.166.4.128/26	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A fpbxreject -s	213.166.5.0/24	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A fpbxreject -s	78.40.243.192/27	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A fpbxreject -s	87.238.72.128/26	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A fpbxreject -s	87.238.73.128/26	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A fpbxreject -s	87.238.74.128/26	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A fpbxreject -s	87.238.77.128/26	-p udp -m udp --dport 4569:5270 -j ACCEPT

Rules for IPtables file

-A INPUT -s 109.224.232.0/22 -p udp -m udp --dport 4569:5270 -j ACCEPT
-A INPUT -s 109.224.240.0/22 -p udp -m udp --dport 4569:5270 -j ACCEPT
-A INPUT -s	109.224.222.16/28	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A INPUT -s	109.224.232.0/22	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A INPUT -s	109.224.240.0/22	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A INPUT -s	109.239.96.132/31	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A INPUT -s	141.170.24.20/30	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A INPUT -s	141.170.24.5/31	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A INPUT -s	141.170.50.16/28	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A INPUT -s	185.47.148.0/24	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A INPUT -s	194.145.188.224/27	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A INPUT -s	194.145.189.52/31	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A INPUT -s	194.145.190.128/26	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A INPUT -s	194.145.191.128/27	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A INPUT -s	195.74.60.0/23	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A INPUT -s	212.11.68.144/28	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A INPUT -s	213.166.2.128/26	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A INPUT -s	213.166.3.128/26	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A INPUT -s	213.166.4.128/26	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A INPUT -s	213.166.5.0/24	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A INPUT -s	78.40.243.192/27	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A INPUT -s	87.238.72.128/26	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A INPUT -s	87.238.73.128/26	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A INPUT -s	87.238.74.128/26	-p udp -m udp --dport 4569:5270 -j ACCEPT
-A INPUT -s	87.238.77.128/26	-p udp -m udp --dport 4569:5270 -j ACCEPT
Categories
Handsets Products and services Sangoma Phones

Sangoma P310 and P315

These phones are very competitively priced; and are perfect for anyone that needs reliable, basic calling functionality or needs a lot of phones either in one place or over a distributed set of large-facility locations. 

However, you can be rest assured that they are manufactured to very high standards and have all the qualities you would expect in more expensive models.

With these two new phones you can utilise essential Unified Communications features without sacrificing the function and performance that is usually only available with more expensive IP phones!

Want a closer look? Watch the first P315 being unboxed in Europe! Contact us for how you too can get your hands on the P310 or P315 and for bulk pricing.

Unboxing the P3xx handsets

Categories
Blog Case Studies

An out of the normal Customer request

and how we solved it:

We were approached by one of our customers who provides support services to travellers and global companies who had a client that provides maritime engineering services world wide and required an emergency helpline that “followed the sun” 

Detailed Specification

A single number that called dependant on time the on call support staff.

The calls cannot go to users Voicemail.

The staff members are to be notified by email that the call was taken and who took it.

If the on call staff do not answer the call it is forwarded to our clients call centre.

On completion of the call a copy of the recording in mp3 format is emailed to the on call staff.

Solution.

Our customer uses FreePBX so the core of the project is the use of the Queue application but with some custom dial plan and scripts to exploit and enhance features that are not exposed, 

The inbound numbers destination is a “custom destination” that first sends it to some custom dial plan explained later and then to the “Call Flow Control” application to allow the system to be overridden, It is then sent to the “Time Conditions” application that uses UTC as its time zone to over come issues with daylight saving in different hemispheres, this then send the call to the correct queue depending on time 

To allow an email to be sent to staff we used the qgosub variable that is explained HERE , this sub routine sends the email on answer. this variable is set by a small dial plan snippet that sets the qgosub variable and an additional one to set a channel variable as the callers callerID number, as its lost when the call is made to the staff members by the queue application. 

To make sure calls do not go to voicemail, the queue option “call confirm” this forces the called staff to press 1 to accept a call, This much overlooked option is useful for many queue scenarios.

If the call is unanswered the call has to be passed to the callcenter with the callerID name tagged with the customers Name, We achieve this with the “SetCallerID” application passing the call onto the client call centre.

Finally when the call is complete we need to email the recording to the customer. To do this with the “Post Call Recording Script” option in Advanced options. (You may need to enable “Display Readonly Settings” and “Override Readonly Settings”), This did require a little lateral thinking as we were already using this script to convert recordings to MP3 and save them to AWSS3 storage, But we didn’t want an email sent after all recordings do we included an additional ‘if’ statement to check if the qgosub variable was passed over to the script and if it was email the attachment otherwise do nothing.

I hope this shows the flexibility of FreePBX and asterisk and how fairly complex call routings and requests can be fulfilled in a manner that doesn’t require complex dial plans or require high support overheads.

If you want to achieve similar don’t hesitate to get in touch as by using modules already in FreePBX you’re not paying to reinvent the wheel.

Categories
Blog FreePBX Knowledge Base

Running Subroutines on answer for Queues

Some years ago we wrote a post on running macros on queue answer here. this was very useful for integration with backends, At the time we raised a feature request to get it added to Freepbx, But this never happened.

Now the variable QGOSUB is in the dialplan for freepbx queues, But still there is no way of setting this in a default freepbx installation and it requires a snip-it of custom dialplan that is called from freepbx by a ‘custom destination’ . For example at its simplest the dialplan to set it could be :-

[qmacro-set]
exten => .,1,Noop(ians test) 
exten => .,n,Set(_QGOSUB=ians_routine) 
exten => .,n,Goto(app-daynight,1,1)  

and this sets the variable for all channels in this call, and when the Queue command is run in the default freepbx dialplan

Queue(9471,${QOPTIONS},,${QAANNOUNCE},${QMAXWAIT},${QAGI},,${QGOSUB},${QRULE},${QPOSITION})  

This allows simple or more complicated routines to be run. For example sending an email on answer which was a request we had that caused us to revisit this.

[ians_routine]
exten = s,1,Set(origtime=${EPOCH})
exten = s,n,Noop(${CHANNEL})
exten = s,n,Set(Agent11=${CUT(CHANNEL,@,1)})
exten = s,n,Set(Agent12=${CUT(Agent11,/,2)})
exten = s,n,Noop(${Agent11} , ${Agent12} )
exten = s,n,Set(fulltime=${STRFTIME(${EPOCH},,%d%m%Y-%H:%M:%S)})
exten = s,n,system(echo "There has been a call , Callers Details: ${CALLERID(number)} ,  ${CRM_SOURCE} , Date and Time: ${fulltime} ,  Agent: ${Agent12} ,Timestamp: ${origtime} , Queue Number: ${QUEUENUM} " | mail -s "failed recall at ${fulltime}" email@address.com)
same = n,Return()

If you think that you would like to be able to set this variable in the freepbx gui give it a vote https://issues.freepbx.org/browse/FREEPBX-22274

Categories
Knowledge Base Products and services

Aastra 6753i Transfer

Step By step instructions for call transfer when using the Aastra 6753i with firmware 3.x.x and above.

Phone Idle screen.

Once a call is answered their number will show and an icon of a ‘off hook phone’ will also show

To transfer the call press your ‘Transfer key’. Another ‘line’ will show numbered 2 with a ‘ > ’ next to it.

Enter the number you want to dial and press ‘>‘ dial if the call isn’t immediately dialed.

To ‘Blind’ transfer the call press the Transfer Button again or put the Handset down. NOTE if you do this you will not be able to get the call back.

After pressing dial the Phone Icon will show ‘ringing’

To get the call back while it is ringing press the ‘ < ‘ button shown on the display next to ‘Cancel’. Then L1 in this example will flash and ‘call held’ will show on the display as below, you need to get the call back by pressing the Flashing Line Key.

If the call goes to Voicemail or the caller answers the display will show the ‘off hook’ icon against 2

If the Caller wants the call then Press the ‘Transfer key’ the Red ‘Hangup key’ or put the handset down and the call will be transferred to them. Do not press the ‘>‘ Drop button.

If they don’t want the call or it goes to voicemail and you want to get the caller back, Press the ‘ > ‘ Drop Button and that call will be dropped and as before ‘call held’ will show on the screen and you press the L1 button to get the caller Back

Categories
Knowledge Base

Setting up Postfix to use Office 365 mail

FreePBX uses centos 7 and postfix fom its mail delivery, normally this is fine unless the customer is using Office 365 mail then there can be delivery issues.

Firstly you will need to set up a user in Office 365 for the system.

Postfix’s main configuration file is main.cf and that is where we make the required change as follow:

[root@localhost ~]# vi /etc/postfix/main.cf

Append the following lines

masquerade_domains = domainname
myhostname = USERNAME.domainname
mydomain = USERNAME.domainname
myorigin = USERNAME@domainname
relayhost = [smtp.office365.com]:587

mynetworks = 127.0.0.0/8
inet_interfaces = loopback-only
smtp_use_tls = yes
smtp_always_send_ehlo = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous
smtp_tls_security_level = encrypt
smtp_generic_maps = hash:/etc/postfix/generic 
# smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt

Save and exit from the file.
Next we need to edit the configuration for the postfix SASL credentials:

[root@localhost ~]# vi /etc/postfix/sasl_passwd

Add a line below

[smtp.office365.com]:587 user@domainname:password

Replacing user@domainname:password with your sender account details

Save and exit from file

A Postfix lookup table must now be generated from the sasl_passwd text file by running the following command.

[root@localhost ~]# postmap /etc/postfix/sasl_passwd

Now change permission for this file

[root@localhost ~]# chown root:postfix /etc/postfix/sasl_passwd

[root@localhost ~]# chmod 640 /etc/postfix/sasl_passwd

Next, we need to configure generic file in order to be able to send emails as a valid user (this is required for Office365).

[root@localhost ~]# vi /etc/postfix/generic

Go the end of file and append following lines.

root@localhost.localdomain UserName@Domain.com

Again replacing localhost.localdomain and UserName@Domain.com with your service hostname and the email user are using

Save and exit from file.

Next let’s correct the file permission.

[root@localhost ~]# chown root:root /etc/postfix/generic

[root@localhost ~]# chmod 0600 /etc/postfix/generic

[root@localhost ~]# postmap /etc/postfix/generic

Now restart Postfix service.

[root@localhost ~]# systemctl restart postfix

Now try to send a test email using the command below:
FOR Centos:

echo "This is the body of the email"| mail -r"Sender-Display-Name<sender@domain.com>" -s "This is the subject(E-Mail from SMTP Relay) line" recipeat@gmail.com

In FreePBX under Voicemail admin you must change the senders address to match your account as well as the sender for notifications such as backups etc. otherwise you can get errors and mail wont be delivered.

Categories
Knowledge Base Technical

Asternic Stats and recording outgoing calls.

Asternic stats has the ability to record your outgoing calls in the stats database so they can be accessed from stats package.

But a customer noted two problems with this, firstly they wanted to set a different Music on Hold for outgoing calls and secondly “no answer” calls where the agent hungup before the callee answered.

Firstly we will deal with the Music on hold, Changing the MoH class caused calls not to be recorded in the database correctly. Code below is the reason for this as it causes the dial string to have 2 macros called, This is not possible.

extension_additional.conf:-
exten => s,n,ExecIf($["${MOHCLASS}"!="default" & "${MOHCLASS}"!="" & "${FORCE_CONFIRM}"="" ]?Set(DIAL_TRUNK_OPTIONS=M(setmusic^${MOHCLASS})${DIAL_TRUNK_OPTIONS}))

extensions_custom_asternic_outbound_freepbx.conf:-
exten => _X.,n,Dial(${QDIALER_CHANNEL},300,gM(queuedial-answer^${UNIQUEID}^${GM}^${QDIALER_QUEUE}^${QDIALER_AGENT}^${ST}^${AMPUSER})${DIAL_TRUNK_OPTIONS})

The fix is very simple for this one and required just 2 changes. one line added to set MoH in the dialplan and another to use Trunk_options and not the the one created in extensions_additional.conf

exten => _X.,n,Set(CHANNEL(musicclass)=${MOHCLASS}) ; Added to set the Music on hold class for the outgoing call Fixes bug in normal code
exten => _X.,n,Dial(${QDIALER_CHANNEL},300,gM(queuedial-answer^${UNIQUEID}^${GM}^${QDIALER_QUEUE}^${QDIALER_AGENT}^${ST}^${AMPUSER})${TRUNK_OPTIONS}) ;Was ${DIAL_TRUNK_OPTIONS} changed to set the Music on hold class for the outgoing call Fixes bug in normal code

The second problem is also fairly straight forward but took a bit of creative thinking, The problem was when an agent hung up on an outbound call the dialstatus returned to the dialplan was “CANCEL” and this is not reported upon by the asternic stats package. SO as the call is for all intents abandoned we added a line that if the dialstatus was “CANCEL” we would change it to “ABANDON”.

exten => h,n,Set(DIALSTATUS=${IF($["${DIALSTATUS}"="CANCEL"]?ABANDON:${DIALSTATUS})}) ;Added By Ian Plain to fix cancelled calls not showing in Asternic stats

This is a simple fix and now means calls are recorded as ABANDONED and with the time the Agent waited before hanging up.

Below is our version of the file extensions_custom_asternic_outbound_freepbx.conf with all the changes.

[macro-dialout-trunk-predial-hook]
exten => s,1,Noop(Test Track Outbound)
exten => s,n,Noop(Trunk is ${OUT_${DIAL_TRUNK}})
exten => s,n,Noop(Dialout number is ${OUTNUM})
exten => s,n,Noop(Dial options are ${DIAL_TRUNK_OPTIONS})
exten => s,n,Set(QDIALER_TRUNK_OPTIONS=${DIAL_TRUNK_OPTIONS})
exten => s,n,Set(QDIALER_AGENT=${DB(AMPUSER/${AMPUSER}/cidname)})
exten => s,n,GotoIf($["${QDIALER_AGENT}" != ""]?nextcheck)
exten => s,n,Noop(NO AMPUSER, exit normally with no tracking outbound)
exten => s,n,MacroExit()
exten => s,n(nextcheck),GotoIf($["${CDR(accountcode)}" != ""]?bypass)
exten => s,n,Noop(NO ACCOUNTCODE, exit normally with no tracking outbound)
exten => s,n,MacroExit()
exten => s,n(bypass),Set(PREDIAL_HOOK_RET=BYPASS)
exten => s,n,Goto(queuedial,${OUTNUM},1)
exten => s,n,MacroExit()
;; Dialplan for storing OUTBOUND campaing in queue_log
;; Goto(queuedial,YYYXXXXXXXX,1) where YYY is the queue-campaign code
;; and XXXXXXXX is the number to dial.
;; The queuedial context has the outobound trunk hardcoded
[queuedial]
; this piece of dialplan is just a calling hook into the [qlog-queuedial] context that actually does the
; outbound dialing - replace as needed - just fill in the same variables.
exten => X.,1,Set(QDIALER_QUEUE=${CDR(accountcode)}) ;exten => _X.,n,Set(QDIALER_AGENT=Agent/${AMPUSER}) exten => _X.,n,Set(QDIALER_AGENT=${DB(AMPUSER/${AMPUSER}/cidname)}) ; custom trunk check exten => _X.,n,Set(custom=${CUT(OUT${DIAL_TRUNK},:,1)})
exten => X.,n,GotoIf($["${custom}" = "AMP"]?customtrunk) ; it is normal trunk, not custom exten => _X.,n,Set(QDIALER_CHANNEL=${OUT${DIAL_TRUNK}}/${EXTEN})
exten => X.,n,GotoIf($["${OUT${DIAL_TRUNK}SUFFIX}" == ""]?continuequeuedial) exten => _X.,n,Set(QDIALER_CHANNEL=${OUT${DIAL_TRUNK}}/${EXTEN}${OUT_${DIAL_TRUNK}SUFFIX}) exten => _X.,n,Goto(continuequeuedial) ; it is a custom trunk exten => _X.,n(customtrunk),Set(pre_num=${CUT(OUT${DIAL_TRUNK},$,1)})
exten => X.,n,Set(the_num=${CUT(OUT${DIAL_TRUNK},$,2)})
exten => X.,n,Set(post_num=${CUT(OUT${DIAL_TRUNK},$,3)})
exten => _X.,n,GotoIf($["${the_num}" = "OUTNUM"]?outnum:skipoutnum)
exten => _X.,n(outnum),Set(the_num=${OUTNUM})
exten => _X.,n(skipoutnum),Set(QDIALER_CHANNEL=${pre_num:4}${the_num}${post_num})
exten => _X.,n(continuequeuedial),Noop(Qdialer channel = ${QDIALER_CHANNEL})
exten => _X.,n,Set(QueueName=${QDIALER_QUEUE})
exten => _X.,n,Goto(qlog-queuedial,${EXTEN},1)
[qlog-queuedial]
; We use a global variable to pass values back from the answer-detect macro.
; STATUS = U unanswered
; = A answered (plus CAUSECOMPLETE=C when callee hung up)
; The 'g' dial parameter must be used in order to track callee disconnecting.
; Note that we'll be using the 'h' hook in any case to do the logging when channels go down.
;
exten => X.,1,NoOp(Outbound call -> A:${QDIALER_AGENT} N:${EXTEN} Q:${QDIALER_QUEUE} Ch:${QDIALER_CHANNEL} Dialoptions:${TRUNK_OPTIONS}) exten => _X.,n,Set(ST=${EPOCH}) ;exten => _X.,n,Set(GM=${QDIALER_AGENT}) exten => _X.,n,Set(GM=${REPLACE(QDIALER_AGENT, ,)})
exten => _X.,n,Set(GLOBAL(${GM})=U)
exten => _X.,n,Set(GLOBAL(${GM}ans)=0)
exten => _X.,n,Macro(queuelog,${ST},${UNIQUEID},${QDIALER_QUEUE},${QDIALER_AGENT},ENTERQUEUE,-,${EXTEN})
exten => _X.,n,Set(CHANNEL(musicclass)=${MOHCLASS}) ; Added to set the Music on hold class for the outgoing call Fixes bug in normal code
exten => _X.,n,Dial(${QDIALER_CHANNEL},300,gM(queuedial-answer^${UNIQUEID}^${GM}^${QDIALER_QUEUE}^${QDIALER_AGENT}^${ST}^${AMPUSER})${TRUNK_OPTIONS}) ;Was ${DIAL_TRUNK_OPTIONS} changed to set the Music on hold class for the outgoing call Fixes bug in normal code
exten => _X.,n,Set(CAUSECOMPLETE=${IF($["${DIALSTATUS}" = "ANSWER"]?C)})
; Trapping call termination here
exten => h,1,NoOp( "Call exiting: status ${GLOBAL(${GM})} answered at: ${GLOBAL(${GM}ans)} DS: ${DIALSTATUS}" )
exten => h,n,Set(DB(LASTDIAL/${QDIALER_AGENT})=${EPOCH})
exten => h,n,Goto(case-${GLOBAL(${GM})})
exten => h,n,Hangup()
; Call unanswered
exten => h,n(case-U),Set(WT=$[${EPOCH} - ${ST}])
exten => h,n,Noop(unanswered ${DIALSTATUS})) ;Added By Ian Plain to fix cancelled calls not showing in Asternic stats
exten => h,n,Set(DIALSTATUS=${IF($["${DIALSTATUS}"="CANCEL"]?ABANDON:${DIALSTATUS})}) ;Added By Ian Plain to fix cancelled calls not showing in Asternic stats
exten => h,n,Macro(queuelog,${EPOCH},${UNIQUEID},${QDIALER_QUEUE},${QDIALER_AGENT},${DIALSTATUS},1,1,${WT})
exten => h,n,UserEvent(AgentComplete,Queue: ${QDIALER_QUEUE},TalkTime: 0,Channel: ${CHANNEL})
exten => h,n,Hangup()
; call answered: agent/callee hung
exten => h,n(case-A),Set(COMPLETE=${IF($["${CAUSECOMPLETE}" = "C"]?COMPLETECALLER:COMPLETEAGENT)})
exten => h,n,Noop(answered ${DIALSTATUS})) ;Added By Ian Plain to fix cancelled calls not showing in Asternic stats
exten => h,n,Set(WT=$[${GLOBAL(${GM}ans)} - ${ST}])
exten => h,n,Set(CT=$[${EPOCH} - ${GLOBAL(${GM}ans)}])
exten => h,n,Macro(queuelog,${EPOCH},${UNIQUEID},${QDIALER_QUEUE},${QDIALER_AGENT},${COMPLETE},${WT},${CT})
exten => h,n,UserEvent(AgentComplete,Queue: ${QDIALER_QUEUE},TalkTime: ${CT},Channel: ${CHANNEL})
exten => h,n,Hangup()
[macro-queuedial-answer]
; Expecting $ARG1: uniqueid of the caller channel
; $ARG2: global variable to store the answer results
; $ARG3: queue name
; $ARG4: agent name
; $ARG5: enterqueue
;
exten => s,1,NoOp("Macro: queuedial-answer UID:${ARG1} GR:${ARG2} Q:${ARG3} A:${ARG4} E:${ARG5}")
exten => s,n,Set(QDIALER_QUEUE=${ARG3})
exten => s,n,Set(QDIALER_QUEUE=${REPLACE(QDIALER_QUEUE, ,_)})
exten => s,n,GotoIf($["${CUT(DB(AMPUSER/${ARG6}/recording),=,3)}" = "Always"]?mixmonitor)
exten => s,n,GotoIf($["${DB(AMPUSER/${ARG6}/recording/out/external)}" = "always"]?mixmonitor)
exten => s,n,Goto(continue)
exten => s,n(mixmonitor),MixMonitor(${MIXMON_DIR}${YEAR}/${MONTH}/${DAY}/out-${QDIALER_QUEUE}-${ARG1}.wav,b,/usr/local/parselog/update_mix_mixmonitor.pl ${ARG1} ${MIXMON_DIR}${YEAR}/${MONTH}/${DAY}/out-${QDIALER_QUEUE}-${ARG1}.wav)
exten => s,n,Set(AUDIOHOOK_INHERIT(MixMonitor)=yes)
exten => s,n(continue),Set(NOW=${EPOCH})
exten => s,n,Set(WD=$[${NOW} - ${ARG5}])
exten => s,n,Macro(queuelog,${NOW},${ARG1},${ARG3},${ARG4},CONNECT,${WD})
exten => s,n,Set(GLOBAL(${ARG2})=A)
exten => s,n,Set(GLOBAL(${ARG2}ans)=${NOW})
exten => s,n,NoOp("Macro queuedial-answer terminating" )
[macro-queuelog]
; The advantage of using this macro is that you can choose whether to use the Shell version
; (where you have complete control of what gets written) or the Application version (where you
; do not need a shellout, so it's way faster).
;
; Expecting $ARG1: Timestamp
; $ARG2: Call-id
; $ARG3: Queue
; $ARG4: Agent
; $ARG5: Verb
; $ARG6: Param1
; $ARG7: Param2
; $ARG8: Param3
;
;exten => s,1,System( echo "${ARG1},${ARG2},${ARG3,${ARG4},${ARG5},${ARG6},${ARG7},${ARG8}" >> /var/log/asterisk/queue_log )
exten => s,1,QueueLog(${ARG3},${ARG2},${ARG4},${ARG5},${ARG6}|${ARG7}|${ARG8})

Categories
Asterisk Support Covid-19 FreePBX Knowledge Base Remote Working

Disabling Router SIP ALG

With many companies asking their employees to work from home, a common problem when trying to use a sip phone on a home network is the SIP ‘helper’ or ALG, Here is some advice on how to disable it on the more common routers that you may encounter.

SIP ALG (Application Layer Gateway) modifies VoIP traffic with the aim of solving NAT and firewall related problems. SIP ALG does this by inspecting SIP packets and modifying SIP Header and SDP data.

Unfortunately, SIP ALG was poorly implemented in a lot of cases, which has lead to it causing more issues than it corrects and due to this, we believe that, in general, it is best disabled.

Note – Many routers will re-enable SIP ALG after being powered off and on, or sometimes after a firmware update, therefore if it has been disabled in the past, and you know that the router was recently updated and powered off and on again, then it is always a good idea to log in to the router and double check the setting.

Virgin SuperHub: SIP ALG cannot be disabled in the settings of SuperHubs. Please click here for advice troubleshooting issues with SuperHubs. 

BT: SIP ALG cannot be disabled in the settings of BT HomeHubs, but can be disable with BT Business Hub versions 3 and higher:

Disabling a BT Business Hub 5’s SIP ALG

Fritz!Box: SIP ALG can’t be disabled.

DrayTek routers: Log in to your DrayTek via Telnet using an SSH client such as Putty: http://www.putty.org/

Check if SIP ALG is Enabled or Disabled:

To check if SIP ALG is Enabled or Disabled enter this command: sys sip_alg ?

If SIP ALG is disabled a ” 0 ” result will be returned.  If SIP ALG is enabled the result will be ” 1 “.

Disabling SIP ALG:

To Disable SIP ALG enter the following:

sys sip_alg 0
sys commit
sys reboot

The router will restart and save your changes.

Click here for additional general information about DrayTek Firewall setup. 

TP-Link routers: How to Disable SIP ALG on TP-Link ADSL modem router

Linksys: Check for a ‘SIP ALG’ option, in the ‘Administration’ tab under ‘Advanced’. 

May also need to disable SPI Firewall. 

Microtik: Disable ‘SIP Helper‘. 

Netgear: Look for a ‘SIP ALG’ checkbox in the ‘WAN’ settings.

Port Scan and DoS Protection should also be disabled.

Disable STUN in VoIP phone’s settings. 

D-Link: In your router’s ‘Advanced’ settings –> ‘Application Level Gateway (ALG) Configuration’ uncheck the ‘SIP’ option. 

Huawei: Many routers support SIP ALG (usually found in the ‘Security’ menu). 

SonicWALL Firewall: Under the VoIP tab, the option ‘Enable Consistent NAT’ should be enabled and ‘Enable SIP Transformations’ unchecked.  

Thomson: How to Disable SIP ALG on a Thomson Router HERE

Test with STUN disabled in your VoIP phone’s settings.

Adtran Netvanta: Disable SIP ALG under ‘Firewall/ACLs’ –> ‘ALG Settings’.

For Technicolor TG588V routers see this document for step by step details

Even if there isn’t a SIP ALG option in your router’s settings, it may still be implemented. TelNet commands must be used to disable SIP ALG with TechnicolorThomsonSpeedTouch, some Draytek and some ZyXEL routers. 

Categories
Knowledge Base

Using FreePBX FollowMe

Follow Me allows you to redirect a call that is placed to one of your extension to another extension or external number.

You can program the system to ring your extension alone for a certain period of time, then ring some other destination(s), such as a mobile phone or another extension, then go to the original extension’s voicemail if the call is not answered.  

It can also be used to divert calls to another extension without ringing the ‘original’ extension, or ring both together in a ‘twinned’ manner. This is useful if you are regularly away from your desk

Your can modify certain Follow Me settings using the User Control Panel as well as disable and enable Follow Me using a feature code that is normally *21,

To use the UCP to change settings if you have had permissions enabled is done by clicking the COG icon on teh Follow me Widget and below is a short Video on the key settings