SIP header to get Polycom phones to display "To:xxx" when using click-to-call

I’ve got a click-to-dial (CTI) script written in PHP that sits on my FreePBX server, and uses AMI to initiate the outbound call and bridge it to the local extension. It works fine!

The problem I’m trying to solve is, since Asterisk is making 2 call legs, the phone on my desk displays From: Mary when I am actually calling To: Mary.

Another unwanted side effect is that the call doesn’t register as an outbound call, so “redial” doesn’t work as expected, etc.

Is there any SIP header I can add that will update the call display & direction to be an OUTBOUND call and show “To:XXXXX” instead?

Would not
Mary is not available
Use AMI to initiate the the call to the local extension and bridge it to the outbound number

Be more polite and reflect the reality? What if Mary is not available to take the call?

@dicko I don’t understand what you’re asking really.

He is saying that it’s conventional to do the originate to the local extension and then to the outbound number:

channel originate local/<ext_num>@from-internal extension <outbound_number>@from-internal

When done this way, and with rpid enabled for the extension, the phone should display CID correctly.

2 Likes

And as a courtesy to your clients, never connect them with anything but warmware.

Because this is not an “outbound” call to Mary. The system is making a call to you and once you answer then the system is calling Mary to bridge you. So it doesn’t show up as an outbound call on the phone because the phone, itself, did not make that call. It received a call and got bridged to another extension/destination at the PBX level.

The phone’s redial log tracks calls and digits that were sent from the phone.

Yes I fully get that. So for click-to-call functionality, the only way to get the phone to consider it an outbound call is to use the Polycom REST API instead of having the PBX originate & bridge the call, correct? I was hoping there was a simpler way, because using the API means knowing the endpoint’s IP address, auth settings, having direct inward TCP connectivity from the PBX to the phone etc, which is a lot more complicated.

Hi @luckman212,

You can send the first leg to a custom context instead to the from-internal context, and in there you will be able to change the caller id to whatever you want. After the caller id setting, send the call back to the from-internal context again.

Thank you,

Daniel Friedman
Trixton LTD.

I ended up going with the official Polycom REST API. It was a bit of a bear trying to figure it out because all of their examples are in PowerShell and I needed a Linux/bash solution. I eventually got it working well enough. Used this guide as a reference, and just a lot of trial and error with curl on the commandline.

Here’s a small bash script that should give anyone the basic idea…

#!/usr/bin/env bash
AUTH=Polycom:789
TO=12125551212
PHONE_IP=192.168.1.100
curl -s -k -u "$AUTH" -d '{"data":{"Dest":"'"${TO}"'","Line":"1","Type":"TEL"}}' -H 'Content-Type: application/json' "https://${PHONE_IP}/api/v1/callctrl/dial"

Hope this helps someone…

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.