HylaFAX The world's
most advanced open source fax server
|
|
[
Date Prev][Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
Re: [hylafax-users] Set outgoing CID on Diva 2Fx
We are using job control to set the caller id on our Diva PRI cards.
In our case we have a database table with 2 columns: Phone number and email address. A person is assigned a number and we use this table in 2 ways. For sending, we do something like this in the job control script (perl script):
($jobid) = @ARGV;
chomp ($senderemail = `grep ^mailaddr: sendq/q$jobid`);
($tmp, $senderemail) = split(/:/, $senderemail);
We use that senderemail address to look up in the table the number (via a second script called atcfetch) and then do:
chomp ($tsi = `bin/atcfetch $senderemail`) if $senderemail;
$dialcmd = "+IO$tsi" . $dialcmd if $tsi;
$dialcmd = "AT$dialcmd";
print "ModemDialCmd: $dialcmd" if $tsi;
print "\n";
exit;
-----Original Message-----
From: hylafax-users-bounce@xxxxxxxxxxx [mailto:hylafax-users-bounce@xxxxxxxxxxx] On Behalf Of Meuser, Lars
Sent: Sunday, June 29, 2008 11:31 PM
To: Klaus Rörig; hylafax-users@xxxxxxxxxxx
Subject: Re: [hylafax-users] Set outgoing CID on Diva 2Fx
Hi,
i searched also for this and found here http://hylafax.sourceforge.net/docs/hylafax-differences.php an possible solution.
See chapter 3.ModemSetOriginCMD:
>>The sendfax client uses the 'sendfax -e "name"' and 'sendfax -u "number"' options for this purpose.
I will test now !
Cheers
Lars
Bonn, Germany
-----Original Message-----
From: hylafax-users-bounce@xxxxxxxxxxx [mailto:hylafax-users-bounce@xxxxxxxxxxx] On Behalf Of Klaus Rörig
Sent: Monday, June 09, 2008 3:11 PM
To: hylafax-users@xxxxxxxxxxx
Subject: [hylafax-users] Set outgoing CID on Diva 2Fx
Hi!
I want to set the outgoing CID througt jobcontrol. In my config.ttyds01
I set "ModemSetOriginCmd: AT+iO%d" but where comes the value for %d
from?
I searched the archive but didn't find it.
What so I have to set in my jobcontrol-script?
It looks like this now:
---
JOBID=$1
## GetClient <owner> <email>
## - returns a string - the client identifier
## Result of "REJECT" is a non-authorized submitter, and ## should be rejected.
## Result of "" means it's not a virtualized client and ## should be subject to our default modem settings GetClient () {
# Pretend to lookup the user
CUSTOMER=`echo "SELECT customer FROM $MYSQL_DB.users WHERE username='$1' AND email='$2';" | mysql -u $MYSQL_USER -p$MYSQL_PASSWD -h $MYSQL_HOST --skip-col umn-names`
if [ $CUSTOMER ]
then
# Return client if exists
echo "$CUSTOMER"
else
# Reject all others
echo "REJECT"
fi
# All others are not full virtual clients }
##
## GetJobParam <param>
## - returns the value of the job param
GetJobParam ()
{
grep "^$1:" sendq/q$JOBID | cut -d : -f 2- }
##
## SetControlParam <tag> <value>
SetControlParam ()
{
echo "$1: \"$2\""
}
OWNER=$(GetJobParam owner)
EMAIL=$(GetJobParam mailaddr)
CLIENT=$(GetClient "$OWNER" "$EMAIL")
if [ "$CLIENT" == "REJECT" ]
then
SetControlParam RejectNotice "Not authorized"
exit
fi
##
## And now client-specific settings
IFS=""
NOTIFY=`echo "SELECT notify FROM $MYSQL_DB.clients WHERE customer='$CLIENT';" | mysql -u $MYSQL_USER -p$MYSQL_PASSWD -h $MYSQL_HOST --skip-column-names` IDENTIFIER=`echo "SELECT CIDName FROM $MYSQL_DB.clients WHERE customer='$CLIENT';" | mysql -u $MYSQL_USER -p$MYSQL_PASSWD -h $MYSQL_HOST --skip-column-names`
# These guys can do whatever they want - they pay big bucks for the # privilege, but we make the calling_party appear to be them SetControlParam UseJOBTSI true SetControlParam UseJobTagLine true SetControlParam Notify ${NOTIFY} SetControlParam LocalIdentifier ${IDENTIFIER}
---
Thx for you help.
Klaus
____________________ HylaFAX(tm) Users Mailing List _______________________
To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
On UNIX: mail -s unsubscribe hylafax-users-request@xxxxxxxxxxx < /dev/null
*To learn about commercial HylaFAX(tm) support, mail sales@xxxxxxxxx*
____________________ HylaFAX(tm) Users Mailing List _______________________
To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
On UNIX: mail -s unsubscribe hylafax-users-request@xxxxxxxxxxx < /dev/null
*To learn about commercial HylaFAX(tm) support, mail sales@xxxxxxxxx*
____________________ HylaFAX(tm) Users Mailing List _______________________
To subscribe/unsubscribe, click http://lists.hylafax.org/cgi-bin/lsg2.cgi
On UNIX: mail -s unsubscribe hylafax-users-request@xxxxxxxxxxx < /dev/null
*To learn about commercial HylaFAX(tm) support, mail sales@xxxxxxxxx*