PIONEERS Yealink app for picking up calls on hold

nicknomo

Happy-IT-Guy
Joined
Mar 5, 2009
Messages
63
Reaction score
12
I have integrated my scripts that pick up calls on hold into an XML browser app for yealink. I'm still testing this app, but so far it seems to be in a workable state with no known bugs (although, see limitations)... Thanks to Ward Mundy and amsoltech for providing good reference points to work with.

Unfortunately, this is a little bit more difficult to install than some other scripts, simply because it also relies on the dial plan. Unfortunately, I was a bit limited by the features of the yealink XML browser, and there was no "clean" way to connect your inactive extension with a held call. I pretty much had to push out variables to the channels, and access them through an AGI script and some clever dial plan parameters.

Limitations:
1) You must use SIP extensions. You can have others, but you won't be able to pick up their held calls.
2) You MUST have hold music, or something playing in the background.
3) This will NOT work with GSM hold music. Preferably the audio source format should be WAV, but MP3 does work as well. Other formats are probably not supported.
4) I could not get Yealink's browser menus to cleanly exit. You basically have to hit exit through each screen you went through. This appears to be by their design (WHY?).
 

nicknomo

Happy-IT-Guy
Joined
Mar 5, 2009
Messages
63
Reaction score
12
Note: You must install both the AGI and PHP files, and also edit the config file extensions_custom.conf. No steps are optional

Here are the AGI files I'm using. I've placed them in /var/lib/asterisk/agi-bin . They will require execute privileges (chmod 755).

There are two variants I made (files are attached to this post):
1) holdstealapp.agi - This is the AGI script that works with the php file.

Here are the PHP files I'm using. I've placed them in /var/www/html/yealink . You can actually choose an alternate directory if you wish.
2) holdext.php - this launches the yealink menus. You are asked what extension you want to examine, then you are left with a list of calls. Hit OK or SUBMIT from your phone's browser. See the link below for Ward's explanation of how this works:
http://nerdvittles.com/?p=6269


As far as the dialplan work, I added this under [from-interal-custom] in extensions_custom.conf
Code:
[from-internal-custom]
include => pickuphold

and at the bottom of the file, I have this:
Code:
[pickuphold]
exten => _#9*X.,1,NoOP(PICKING UP ACTIVE CALL: ${EXTEN:3})
exten => _#9*X.,n,Set(ARG1=${EXTEN:3})
exten => _#9*X.,n,AGI(holdstealapp.agi,${ARG1})
exten => _#9*X.,n,NoOP(This was returned as the active call channel: ${HELD_CHANNEL})
exten => _#9*X.,n,GotoIf($[ "${HELD_CHANNEL}" != "" ] ?bridgeit1:passit1)
exten => _#9*X.,n(bridgeit1),Bridge(${HELD_CHANNEL})
exten => _#9*X.,n(bridgeit1),hangup()
exten => _#9*X.,n(passit1),NoOP(Passing it!!!!)
exten => _#9*X.,n(passit1),hangup()
;end of [pickuphold]

The feature code being used is #9*, which shouldn't conflict with any other feature codes on the system.

EDIT: Initially I zipped my debugging code, which was hardcoded to work on my extension only. The files have been replaced with production code.
 

Attachments

  • YealinkHoldAppv1.zip
    5.9 KB · Views: 12

nicknomo

Happy-IT-Guy
Joined
Mar 5, 2009
Messages
63
Reaction score
12
Additionally, here is a version that combines the above app with the manual hold pickups I've instituted in this thread:
http://pbxinaflash.com/community/in...up-a-call-on-hold-on-another-extension.14708/

Note: You must install all of the AGI and PHP files, and also edit the config file extensions_custom.conf. No steps are optional.

Here are the AGI files I'm using. I've placed them in /var/lib/asterisk/agi-bin . They will require execute privileges (chmod 755).

There are two variants I made (files are attached to this post):
1) holdstealapp.agi - This is the AGI script that works with the Yealink XML/php file.

2) holdsteal2.agi - This is for manually picking up a call on hold. If no one is on hold, no pickup is performed and the feature code is reinjected back into the dialplan (so you can reuse the feature code).

3) callsteal.agi - This will steal an active call. There is currently a password on this, and it is "1085". The Authentication can be removed through the dial plan, in the configuration below.

Here are the PHP files I'm using. I've placed them in /var/www/html/yealink . You can actually choose an alternate directory if you wish.
2) holdext.php - this launches the yealink menus. You are asked what extension you want to examine, then you are left with a list of calls. Hit OK or SUBMIT from your phone's browser. See the link below for Ward's explanation of how this works:
http://nerdvittles.com/?p=6269


As far as the dialplan work, I added this under [from-interal-custom] in extensions_custom.conf
Code:
[from-internal-custom]
include => pickuphold

and at the bottom of the file, I have this:
Code:
[pickuphold]
 
exten => _#9*X.,1,NoOP(PICKING UP ACTIVE CALL: ${EXTEN:3})
exten => _#9*X.,n,Set(ARG1=${EXTEN:3})
exten => _#9*X.,n,AGI(holdstealapp.agi,${ARG1})
exten => _#9*X.,n,NoOP(This was returned as the active call channel: ${HELD_CHANNEL})
exten => _#9*X.,n,GotoIf($[ "${HELD_CHANNEL}" != "" ] ?bridgeit1:passit1)
exten => _#9*X.,n(bridgeit1),Bridge(${HELD_CHANNEL})
exten => _#9*X.,n(bridgeit1),hangup()
exten => _#9*X.,n(passit1),NoOP(Passing it!!!!)
exten => _#9*X.,n(passit1),hangup()
 
exten => _#99X.,1,NoOP(PICKING UP ACTIVE CALL: ${EXTEN:3})
exten => _#99X.,n,Authenticate(1085,)
exten => _#99X.,n,Set(ARG1=${EXTEN:3})
exten => _#99X.,n,AGI(callsteal.agi,${ARG1})
exten => _#99X.,n,NoOP(This was returned as the active call channel: ${HELD_CHANNEL})
exten => _#99X.,n,GotoIf($[ "${HELD_CHANNEL}" != "" ] ?bridgeit1:passit1)
exten => _#99X.,n(bridgeit1),Bridge(${HELD_CHANNEL})
exten => _#99X.,n(bridgeit1),hangup()
exten => _#99X.,n(passit1),NoOP(Passing it!!!!)
exten => _#99X.,n(passit1),hangup()
 
exten => _#9X.,1,NoOP(PICK UP HELD CALL: ${EXTEN:2})
exten => _#9X.,n,Set(ARG1=${EXTEN:2})
exten => _#9X.,n,AGI(holdsteal2.agi,${ARG1})
exten => _#9X.,n,NoOP(This was returned as the held call channel: ${HELD_CHANNEL})
exten => _#9X.,n,GotoIf($[ "${HELD_CHANNEL}" != "" ] ?bridgeit2:passit2)
exten => _#9X.,n(bridgeit2),Bridge(${HELD_CHANNEL})
exten => _#9X.,n(bridgeit2),hangup()
exten => _#9X.,n(passit2),NoOP(Passing it!!!!)
exten => _#9X.,n(passit2),GOTO(from-internal-additional,${EXTEN},1)
exten => _#9X.,n(passit2),hangup()
 
;end of [pickuphold]

For the web app, the feature code being used is #9*, which shouldn't conflict with any other feature codes on the system.

For manually stealing active calls, #99 is being used. This could potentially conflict with the feature code to steal calls on hold if the local SIP extension begins with 9 (e.g. 900). It could easily be changed to something like #88, and have no conflicts, but this is what I've chosen for my local users. Feel free to edit the above configuration to suit your needs.

For manually stealing held calls, #9 is the feature code. You can also have #9 for other uses (e.g. call pickup), as the dial plan will let it continue on if there are no held calls.

EDIT: Initially I zipped my debugging code, which was hardcoded to work on my extension only. The files have been replaced with production code.
 

Attachments

  • App&Manual hold stealv1.zip
    10.3 KB · Views: 13

phoneguy

Guru
Joined
Jan 13, 2008
Messages
285
Reaction score
54
We have reported 15 or so bugs to yealink on their XML over the past 9 months and only one of them has been fixed so far. You are correct their "destroy on exit" does not work meaning if you are 2 menus deep and tell it to exit it takes you back a screen. Pressing exit again just keeps in in a big long loop and never exits. All our bugs seem to fall on deaf ears with them as it relates to XML.
 

nicknomo

Happy-IT-Guy
Joined
Mar 5, 2009
Messages
63
Reaction score
12
We have reported 15 or so bugs to yealink on their XML over the past 9 months and only one of them has been fixed so far. You are correct their "destroy on exit" does not work meaning if you are 2 menus deep and tell it to exit it takes you back a screen. Pressing exit again just keeps in in a big long loop and never exits. All our bugs seem to fall on deaf ears with them as it relates to XML.


Yeah, its pretty annoying. On v72 of the T46g, it even happens after you dial out using the selected menu. Once the call is over, you are back in the last screen your XML browser was in.

In some ways, its nice just to have a menu based feature (especially coming from a legacy PBX with phones that have limited display capability)... nevertheless, it doesn't really work as good as it should.

I would imagine that the XML browser is not a hugely popular feature, and 99% of the people who use their phones have no use for an XML browser... so they probably aren't going to divert a lot of resources to it.
 

nickpl

New Member
Joined
Jul 7, 2010
Messages
3
Reaction score
0
I found a dirty hack to get the Yealink phones to actually exit the XML. I know nicknomo has already my seen the post on Yealink's forums, but for reference: http://forum.yealink.com/forum/showthread.php?tid=1715#pid7528. Basicly I just setup an XML page with a timeout of 1, 1 second later I'm out.

It always seemed odd to me that you can see when someone has a call on hold by the slow blinking blf light but have no way to pick it up. Thanks for this nicknomo, I can't tell you how long I've been looking for this feature.
 

phoneguy

Guru
Joined
Jan 13, 2008
Messages
285
Reaction score
54
That does not solve the issue of destroy on exit. What destroy on exit means is when I go back 1 menu screen destroy from memory the screen I was just on.
 

nickpl

New Member
Joined
Jul 7, 2010
Messages
3
Reaction score
0
Ah ok, I understand what you are getting at now. For my purpose it was enough just to replace the exit softkey with a link to this special XML page; but you're right, it doesn't remove from the phone's memory the previous XML page, it just quits out of the XML browser altogether so if you are pushing the "X" key it still has the same broken behavior.
 

nicknomo

Happy-IT-Guy
Joined
Mar 5, 2009
Messages
63
Reaction score
12
It always seemed odd to me that you can see when someone has a call on hold by the slow blinking blf light but have no way to pick it up. Thanks for this nicknomo, I can't tell you how long I've been looking for this feature.


Thanks, its always nice to hear it when people find my stuff useful :)
 

l4cky

Member
Joined
Jan 27, 2015
Messages
175
Reaction score
4
hey nicknomo! I just came across and needs to make this work on an ip phone as well! I am a newbie who doesn't know linux, and have asterisk, but only use the web interface. do you mind to tell me the detailled steps for me? I don't have yealink, does it matter?
 

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
l4cky Since nicknomo was last seen here back in December, I'll jump in and attempt to assist.

Yes, it matters very much what kind of phone you have. Each manufacturer uses a different way of loading dynamic content (like a list of calls on hold such as this) onto their phones. What works for Yealink generally won't work for Snom, Aastra (now Mitel), etc. So tell us what kind of phone you *do* have.
 

l4cky

Member
Joined
Jan 27, 2015
Messages
175
Reaction score
4
wow very kind from you!!
Honestly, I am all new into all these kind of voip things but managed to set ip up with Asterisk. I mostly watch freepbx tutorial, I have no idea how linux works.
I am looking to get this done for a pharmacy business type, so I will need some phones. And so for example, receiving a call, put it on hold, find information, and use the other phone to un hold the call to answer back the customer. I have only been currently testing with SIP (no ip phones, or phones) yet, so do not mind to purchase whatever compatible phones to make this happen. Hopefully, a phone that can be powered by ppoe.
 

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
So it sounds like you would want something with BLF lamps. You can do this with most any phone and parking lots. You wouldn't be able to see who's in the lot without a script like this, but the general concept is there.

Read up on FreePBX Parking Lots and BLF. That should get you in a good starting direction. I'm partial to Snom phones myself, but if you're on a smaller budget, Yealink phones should do fine.
 

l4cky

Member
Joined
Jan 27, 2015
Messages
175
Reaction score
4
So it sounds like you would want something with BLF lamps. You can do this with most any phone and parking lots. You wouldn't be able to see who's in the lot without a script like this, but the general concept is there.

Read up on FreePBX Parking Lots and BLF. That should get you in a good starting direction. I'm partial to Snom phones myself, but if you're on a smaller budget, Yealink phones should do fine.

actually I did, i was able to read and test parking lots. but what are blf? do both have to be related? do you mind sharing a good tutotial for me to read?
 

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
Here's a good overview of BLF:
https://askozia.com/voip/what-is-blf/

Basically, you'd have a light on the phone for each parking lot. When you transfer a call to the parking lot, the corresponding light for that lot would light up on all of the phones. You could then push that button and pick up the call from any other phone.

Here's a video, kinda old, but the BLF overview is there.
This one shows parking lots, but no BLF. What he does with the transfer button and dialing 70# and 71 would be replaced with buttons.

Those should clear some things up. Not too many tutorials specifically related to FreePBX because most of the configuration is done on the phone end.

This is a nice generic guide for Snom phones.
http://kb.kerio.com/product/kerio-o...e-busy-lamp-field-blf-on-snom-phones-742.html
 

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
I am currently looking to see how to fax with freepbx with g711 codec that my provider currently support. i know it is not as good as t38, but i want to give a try. any hint for tutorial? I saw only a few talking about hylafax , avanfax... but then also this http://www.digium.com/en/products/software/fax-for-asterisk#documentation .

So I am a little bit loss on what to do..

Look at NerdVittles for instructions on Incredible Fax. http://nerdvittles.com/?p=9526 and http://nerdvittles.com/?p=9214
 

l4cky

Member
Joined
Jan 27, 2015
Messages
175
Reaction score
4
Here's a good overview of BLF:
https://askozia.com/voip/what-is-blf/

Basically, you'd have a light on the phone for each parking lot. When you transfer a call to the parking lot, the corresponding light for that lot would light up on all of the phones. You could then push that button and pick up the call from any other phone.

Here's a video, kinda old, but the BLF overview is there.
This one shows parking lots, but no BLF. What he does with the transfer button and dialing 70# and 71 would be replaced with buttons.

Those should clear some things up. Not too many tutorials specifically related to FreePBX because most of the configuration is done on the phone end.

This is a nice generic guide for Snom phones.
http://kb.kerio.com/product/kerio-o...e-busy-lamp-field-blf-on-snom-phones-742.html


Thanks buddy! I took me 48h trying to find tutorials, and you did it in 1 min! wow! will look into these links now. just a question about parking lot and blf, if I remember correctly, no all phones support this right?
 

l4cky

Member
Joined
Jan 27, 2015
Messages
175
Reaction score
4
I have a question. I have asterisknow configured for sip phone. If I install incredible pbx, will it delete everything I have done (setup info etc..). What is incredible pbx vs asterisk?
 

rossiv

Guru
Joined
Oct 26, 2008
Messages
2,624
Reaction score
139
I have a question. I have asterisknow configured for sip phone. If I install incredible pbx, will it delete everything I have done (setup info etc..). What is incredible pbx vs asterisk?

Can't use Incredible PBX with AsteriskNow. Have to be running PBX in a Flash or one of the other platforms we support (not AsteriskNow).

Incredible PBX started as an addon to the base PBX in a Flash installer. The PIAF installer installed the operating system, Asterisk, FreePBX, and a select few goodies. Incredible PBX, when run after the PIAF installer, provided lots of configuration examples and fancy apps.

Lately, it's become a standalone system for smaller devices like Raspberry Pi, BBB, PogoPlug, etc. The standalone system includes Asterisk and FreePBX in the installer. Asterisk is just the base that processes calls.
 

Members online

Forum statistics

Threads
25,778
Messages
167,504
Members
19,198
Latest member
serhii
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top