Can called party's name be displayed?

grantroot
Posts: 23
Member Since:
2008-07-17

Got this feature request from one of our users, and I agree that it would be a good thing. We are using Aastra 57i CT phones and the XML Scripts package.

If I call one of our internal extensions, it would be really nice if the name associated with that extension would display while the phone is ringing and after it is picked up. Right now, only the number is displayed. Showing the name would reassure the caller that he dialed the correct number.

Is that possible now? Could it be done with a change to freePBX, or somewhere else? Any thoughts would be appreciated.

--

Grant Root
MIS Supervisor, Dayton-Phoenix Group, Inc.



SkykingOH
Posts: 9538
Member Since:
2007-12-17
Many people have asked for

Many people have asked for that feature. If you want we can ask Ethan if he wants to write it and post a bounty. I would certainly participate.

--

Scott

aka "Skyking"



grantroot
Posts: 23
Member Since:
2008-07-17
I'm in.

I don't know the procedure for that, but I'd contribute something. Two questions:

1) Who's Ethan?

2) Where would this change need to be made? freePBX?

--

Grant Root
MIS Supervisor, Dayton-Phoenix Group, Inc.



SkykingOH
Posts: 9538
Member Since:
2007-12-17
I thought you where working

I thought you where working with Ethan on another Aastra issue you had.

Anyway, Ethan is the uber XML programmer over at Schmooze Communications. If a feature has a broad appeal he will code it and contribute it back to the community. We just need to collect up a reasonable bounty. I don't want to put words in his mouth but I thing $400 would be sufficient for this feature.

We just need to run the idea past Ethan (I can take care of that) and then post a message in the bounty forum.

--

Scott

aka "Skyking"



bravonoj
Posts: 213
Member Since:
2007-11-20
This might be a dumb

This might be a dumb question, but since the Cisco phones support XML apps, would the same one for Aastra work with Cisco? I have a CM at work and this feature is awesome! It would be nice to get it to work with Cisco 79x1s, SIP, and Asterisk...anyone come across this?

-Jon



SkykingOH
Posts: 9538
Member Since:
2007-12-17
The Aastra phones allow you

The Aastra phones allow you to execute a script on action dial, you can't do that on a Cisco, sorry.

--

Scott

aka "Skyking"



rogermt
Posts: 112
Member Since:
2007-12-19
If I'm understanding the

If I'm understanding the quesion correctly, you can make this work already, at least on a small scale with the 9143i's. If the number you are calling is in the phone's directory, it will show the associated directory name (that is in the phone, not in FreePBX). This works as soon as you dial the number on the 9143i. On the 9133i, the name only displays after the called party answers.



aastra1
Posts: 287
Member Since:
2006-11-06
Pretty simple with a quick XML application

As somebody said in the thread, there is an action uri when the phone sends a SIP invite (action uri outgoing) where we can pass the dialed number, it would be very easy to create a script which lookups the number in the PBX directory, get the caller ID and displays 'Calling XYZ...' when the number is identified or do nothing when the number is not recognized.
This feature could be extended to perform a lookup in Exchange GAL or even your contacts but it could take some time.
Also the message should be displayed for a limited time because before 2.4.0 (next firmware) you cannot display the 'Drop', 'Xfer' and 'Conf' keys.
I believe that the script should be short enough to be published in the forum.

Let me know if this is what you are looking for.

aastra1

--

---
aastra1
Aastra XML scripts 2.3.0 now available



SkykingOH
Posts: 9538
Member Since:
2007-12-17
The Aastra XML scripts are

The Aastra XML scripts are already parsing sip_additional.conf for the directory application. This code could be reused. If I was a programmer this would be done already.

--

Scott

aka "Skyking"



aastra2
Posts: 324
Member Since:
2006-10-05
Or the really simple

Or the really simple solution, create a phone directory entry for each local extension with the person's name. The phone will then display the name when dialing out.

--

----
Gareth

Firmware 2.5.1 available.
Download it from www.aastratelecom.com



aastra1
Posts: 287
Member Since:
2006-11-06
Proposed XML script

All

Here is the source code of the XML script that performs a callerID lookup for each outgoing call, the lookup is limited the Asterisk database but it could be extended in the future. Also the script displays the callerID and number for 6 seconds as until 2.4.0 we have no way to display the Xfer, Conf and Drop keys. It id just a way to check that you are dialing the right number. To cancel the dialing the user must press 'Goodbye' twice, the first one to exit the XML screen and the second one to hangup, we will do better with 2.4.0.

It is not perfect but it fits the initial requirement.

The script works for the following phones/firmware

    - 9112i, 9133i, 480i/480iCT in 1.4.2 or better
    - 5xi serie in 2.2.1 or better
    - 9143i, 9480i/9480iCT in 2.3.1 or better

As 1.4.2 does not support the timeout header, the user has to manually press the 'Done/Exit key.

The outgoing.php script has to be installed at /var/www/html/aastra/asterisk

Configuration

action uri outgoing: http://myserver/aastra/asterisk/outhoing?number=$$REMOTENUMBER$$

In the .prf files, common section
action uri outgoig: http://$$AA_XML_SERVER_AA$$/$$AA_XMLDIRECTORY_AA$$/asterisk/outgoing.php?number=$$REMOTENUMBER$$

Source code

<?php
#############################################################################
# Asterisk Incoming
#
# Aastra SIP Phones 1.4.2 or better
#
# Copyright 2008 Aastra Telecom Ltd
#
# script.php?number=XXX
# XXX is the remote phone number
#
#############################################################################

#############################################################################
# PHP customization for includes and warnings
#############################################################################
$os = strtolower(PHP_OS);
if(strpos($os, "win") === false) ini_set('include_path',ini_get('include_path').':include:../include');
else ini_set('include_path',ini_get('include_path').';include;..\include');
error_reporting(E_ERROR | E_PARSE);

#############################################################################
# Includes
#############################################################################
require_once('AastraAsterisk.php');
require_once('AastraCommon.php');
require_once('AastraIPPhoneTextScreen.class.php');
require_once('AastraIPPhoneFormattedTextScreen.class.php');
require_once('AastraIPPhoneExecute.class.php');

#############################################################################
# Retrieve parameters
$number=$_GET["number"];

# Not identified yet
$found=0;

# Trace
Aastra_trace_call('outgoing_asterisk','number='.$number);

# Lookup caller ID
$callerid=Aastra_get_callerid_Asterisk($number);

# Caller ID identified
if($callerid!='Unknown')
	{
	if(Aastra_is_formattedtextscreen_supported())
		{
		$object = new AastraIPPhoneFormattedTextScreen();
		if(Aastra_size_formattedtextscreen()>3)
			{
			$object->addLine('');
			$object->addLine('');
			}
		$object->addLine($callerid);
		$object->addLine('Ext. '.$number);
		}
	else
		{
		$object = new AastraIPPhoneTextScreen();
		$object->setTitle($callerid);
		$object->setText('Ext.'.$number);
		}
	$object->addSoftkey('6','','SoftKey:Exit');
	$object->setDestroyOnExit();
	$object->setTimeout('6');
	$found=1;
	}

# No match whatsoever
if($found==0)
	{
	$object = new AastraIPPhoneExecute();
	$object->addEntry('');
	}

##########################################
# Display output
$object->output();
?> 

As usual, any feedback welcome.

aastra1

--

---
aastra1
Aastra XML scripts 2.3.0 now available



necits
Posts: 419
Member Since:
2008-02-23
Xfer, Conf and Drop keys

Do you have to do anything special to get the Xfer, Conf and Drop keys to work?
I added the following lines to the code directly above $object->addSoftkey('6','','SoftKey:Exit');
but it does not display the keys. I am using the 2.4 firmware.

$object->addSoftKey('1','Drop','SoftKey:Drop');
$object->addSoftKey('2','Xfer','SoftKey:Xfer');
$object->addSoftKey('3','Conf','SoftKey:Conf');

I also copied the 2.4 php classes into the includes directory and made sure the permissions were correct.

--

Michael Mathewson CCNA,MCSE
Owner/Consultant
Northeast CT IT Solutions



necits
Posts: 419
Member Since:
2008-02-23
Anyone??

Anyone??

--

Michael Mathewson CCNA,MCSE
Owner/Consultant
Northeast CT IT Solutions



grantroot
Posts: 23
Member Since:
2008-07-17
Nice job!

This works really well! A few of us are going to test it here for a couple of days before rolling it out to the whole company.

I did change the timeout value to 3 seconds, as the original 6 seconds seemed way too long to me.

Eventually (with the new firmware?) it would be nice to have the called party's name displayed during the entire duration of the call. That would be especially helpful when switching between several active lines. But this script is a good compromise for now.

Thanks!

--

Grant Root
MIS Supervisor, Dayton-Phoenix Group, Inc.



necits
Posts: 419
Member Since:
2008-02-23
Hi Grant, That is exactly

Hi Grant,

That is exactly what I'm trying to accomplish. It shouldn't be too difficult. According to the firmware release notes you can now add the xfer, drop and conf softkeys. I just can't seem to get it to work. I'll pour over the docs some more and see what I can come up with.

--

Michael Mathewson CCNA,MCSE
Owner/Consultant
Northeast CT IT Solutions



ethans
Posts: 519
Member Since:
2007-01-16
I've added to this script to

I've added to this script to support displaying Away status (see: http://trixbox.org/forums/trixbox-forums/open-discussion/bounty-a...) and DND status.

<?php
#############################################################################
# Asterisk Outgoing
#
# Displays Away status, DND status of dialed number, if availble, otherwise
# extension's name, if available, otherwise nothing.
#
# Aastra SIP Phones 1.4.2 or better
#
# Copyright 2008 Ethan Schroeder (<a href="mailto:ethan.schroeder@gmail.com">ethan.schroeder@gmail.com</a>)
#
# Some code originally Copyright by Aastra Telecom Ltd
#
# script.php?number=XXX
# XXX is the remote phone number
#
#############################################################################

#############################################################################
# PHP customization for includes and warnings
#############################################################################
$os = strtolower(PHP_OS);
if(strpos($os, "win") === false) ini_set('include_path',ini_get('include_path').':include:../include');
else ini_set('include_path',ini_get('include_path').';include;..\include');
error_reporting(E_ERROR | E_PARSE);

#############################################################################
# Includes
#############################################################################
require_once('AastraAsterisk.php');
require_once('AastraCommon.php');
require_once('AastraIPPhoneTextScreen.class.php');
require_once('AastraIPPhoneFormattedTextScreen.class.php');
require_once('AastraIPPhoneExecute.class.php');
@include_once('Away.class.php');
#############################################################################
# Retrieve parameters
$number=$_GET["number"];

# Not identified yet
$found=0;

# Trace
Aastra_trace_call('outgoing_asterisk','number='.$number);


# Lookup caller ID
$callerid=Aastra_get_callerid_Asterisk($number);

# Get Away status
$status = "";
if(class_exists("Away"))  {
        $away = new Away;
        $user = Aastra_get_userdevice_Asterisk($number);
        $status = $away->get_status($user);

}

$dnd = Aastra_manage_dnd_Asterisk($number,"get");

if($callerid == "entry not")  { // the database get performed in Aastra_get_callerid_Asterisk returned no results from the AstDB
        $callerid = "Unknown";
}
# Caller ID identified
if($callerid!='Unknown')
        {
        if($status)  {
                $extension = "is $status";
        }
        else if($dnd)  {
                $extension = "is in DND mode.";
        }
        else  {
                $extension = "Ext. $number";
        }

        if(Aastra_is_formattedtextscreen_supported())
                {
                $object = new AastraIPPhoneFormattedTextScreen();
                if(Aastra_size_formattedtextscreen()>3)
                        {
                        $object->addLine('');
                        $object->addLine('');
                        }
                $object->addLine($callerid);
                $object->addLine($extension);
                }
        else
                {
                $object = new AastraIPPhoneTextScreen();
                $object->setTitle($callerid);
                $object->setText($extension);
                }
        $object->addSoftkey('6','','SoftKey:Exit');
        $object->setDestroyOnExit();
        $object->setTimeout('6');
        $found=1;
        }

# No match whatsoever
if($found==0)
        {
        $object = new AastraIPPhoneExecute();
        $object->addEntry('');
        }

##########################################
# Display output
$object->output();
?>


grantroot
Posts: 23
Member Since:
2008-07-17
Nice!

Ethan,

This looks great!

One question: what is "Away status" (as distinct from DND) and how is it set?

--

Grant Root
MIS Supervisor, Dayton-Phoenix Group, Inc.



grantroot
Posts: 23
Member Since:
2008-07-17
Never mind

Don't mind me; I'm an idiot. I followed the link and got the information on the Away status.

Great work on the above script!

--

Grant Root
MIS Supervisor, Dayton-Phoenix Group, Inc.



necits
Posts: 419
Member Since:
2008-02-23
Would it be possible to

Would it be possible to display a message if the extension you are calling is on another line? I know you can use BLF but this would also be nice.

--

Michael Mathewson CCNA,MCSE
Owner/Consultant
Northeast CT IT Solutions



ethans
Posts: 519
Member Since:
2007-01-16
Yes, but this is where it

Yes, but this is where it gets complicated. First, you would check all the open channels through AMI for anything matching the person you are calling. It's tricky but possible. Here's the kicker, though: as it stands right now you can't interrupt the actual dialing. So while the message could be displayed, the phone is going to continue dialing the number. It might be possible to do some voodoo with channel manipulation in the AMI to drop the channel if the other end is on a call, but then what if the user wants to continue to connect to that caller's voicemail regardless of whether or not they are on the phone? I suppose you could add a softkey to the notification screen that let's the user connect to the person's voicemail. In that case, you would have to use the AMI once again to originate an auto-answer call to the device and drop them into the other user's voicemail. Tricky, but possible, I suppose.



necits
Posts: 419
Member Since:
2008-02-23
What about using hints or is

What about using hints or is that for BLF only?

--

Michael Mathewson CCNA,MCSE
Owner/Consultant
Northeast CT IT Solutions



ethans
Posts: 519
Member Since:
2007-01-16
Hints send SIP messages

Hints send SIP messages directly to the phones, and as far as I know, the BLF status of a phone can't be queried through XML.



necits
Posts: 419
Member Since:
2008-02-23
Thanks for the info Ethan.

Thanks for the info Ethan. Just curious.

--

Michael Mathewson CCNA,MCSE
Owner/Consultant
Northeast CT IT Solutions



voxter
Posts: 50
Member Since:
2007-11-20
@necits: Did you figure out

@necits:

Did you figure out using the addsoftkey for Drop, Xfer, and Conf? I'm playing with it right now too, and can't get it to work.



necits
Posts: 419
Member Since:
2008-02-23
No I could never get it to

No I could never get it to work so I gave up on it.

--

Michael Mathewson CCNA,MCSE
Owner/Consultant
Northeast CT IT Solutions



philippebolduc
Posts: 22
Member Since:
2008-01-21
Hints

It would be great to display Name (Extension) is busy if the person is on is phone with another person. You could check that via core show hints.
If State:InUse then the person is on the phone.
If State:Idle then the person is available .

It would be great too to set a callback if the person is on the phone. When the person you've called finish is call Then it could beep on your phone and ask you if you want to call the person with a yes and no button.



grantroot
Posts: 23
Member Since:
2008-07-17
Callback

I'd love to see a "callback" feature to let a caller know when the other party is no longer busy. Our old phone system called this "camping on" to the called extension. It worked like this:

1) I call Joe Blow's extension.
2) I get "Joe Blow is on the phone".
3) I hit a key code to "camp on" , and then hangup.
4) When Joe Blow gets off the phone, my phone rings.
5) I pick up the phone, and a call is initiated to Joe's extension.

I would be interested in contributing toward a feature like that.

--

Grant Root
MIS Supervisor, Dayton-Phoenix Group, Inc.



ethans
Posts: 519
Member Since:
2007-01-16
There is a bounty going to

philippebolduc
Posts: 22
Member Since:
2008-01-21
Camp on

I think you could implement camp on for aastra phone directly on your outgoing script,onhook script and sync script



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.