From b905cc983716d21aaac3eff2206905717cf43a2c Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Fri, 13 Apr 2012 14:16:20 +0200 Subject: [PATCH] Read CallerID from ENV (sent by LL::NG, from LDAP) --- root/etc/e-smith/templates/etc/callback/callback.conf/All | 2 +- root/usr/share/callback/cgi-bin/callback.cgi | 5 +++-- smeserver-callback.spec | 5 ++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/root/etc/e-smith/templates/etc/callback/callback.conf/All b/root/etc/e-smith/templates/etc/callback/callback.conf/All index a372827..90af0b5 100644 --- a/root/etc/e-smith/templates/etc/callback/callback.conf/All +++ b/root/etc/e-smith/templates/etc/callback/callback.conf/All @@ -2,7 +2,7 @@ $host = "{$callback{'Host'} || '127.0.0.1';}"; $port = "{$callback{'Port'} || '5038';}"; $user = "{$callback{'User'} || 'callback';}"; $secret = "{$callback{'Secret'} || 'secret';}"; -$cid = "{$callback{'CallerID'} || ''}"; +$defaultcid = "{$callback{'CallerID'} || ''}"; $webhost = "http://{$SystemName.'.'.$DomainName}"; 1 diff --git a/root/usr/share/callback/cgi-bin/callback.cgi b/root/usr/share/callback/cgi-bin/callback.cgi index d6684f7..e0cd462 100755 --- a/root/usr/share/callback/cgi-bin/callback.cgi +++ b/root/usr/share/callback/cgi-bin/callback.cgi @@ -10,7 +10,7 @@ $host ||= '127.0.0.1'; $port ||= '5038'; $user ||= 'callback'; $secret ||= 'secret'; -$cid ||= ''; +$defaultcid ||= ''; $webhost ||= ''; my $q = new CGI; @@ -73,7 +73,8 @@ print $q->header, if ($q->param()) { my $nback = $q->param('nback') || $ENV{'HTTP_USER_EXTENSION'}; my $ndest = $q->param('ndest'); - my $cid = $q->param('cid') || $cid; + my $cid = $q->param('cid') || $ENV{'HTTP_USER_TELEPHONE'}; + $cid = $defaultcid if ($cid eq ''); $nback =~ s/[\s\(\)\.<>]//g; $ndest =~ s/[\s\(\)\.<>]//g; diff --git a/smeserver-callback.spec b/smeserver-callback.spec index 276312d..e5a0f54 100644 --- a/smeserver-callback.spec +++ b/smeserver-callback.spec @@ -1,7 +1,7 @@ Summary: A small page to originate calls through an asterisk server %define name smeserver-callback Name: %{name} -%define version 0.1.0 +%define version 0.1.1 %define release 1 Version: %{version} Release: %{release}%{?dist} @@ -23,6 +23,9 @@ This package contains all the needed scripts and templates to run the callback form %changelog +* Fri Apr 13 2012 Daniel Berteaud - 0.1.1 +- Read CallerID from ENV (sent by LL::NG, from LDAP) + * Fri Nov 18 2011 Daniel Berteaud - 0.1.0 - Initiale release