elastix
Information
Community
Developers
What We Sell
Forums
Addons
Download
Information
Community
Social Networks
For Developers
Manufacturer Support
Appliances
Training & Certification

authenticate external and internal users/reminders

Share your tips and tricks with the community

authenticate external and internal users/reminders

Postby franklin » Fri Feb 25, 2011 8:02 pm

I added the 4th step here and it broke the authentication for Reminders. I want to be able to have internal users auth by their VM, as in step 3, and let outside users auth by a simple password, as in step 4. I see on my tail that it uses the caller ID of my cell as a user: VERBOSE[20887] logger.c: -- Incorrect password '1234' for user '1xxxxxxxxxx' (context = default)

Is there a way to use both methods to auth Reminders?

[from-internal-custom]
exten => 123,1,Answer
exten => 123,2,Wait(1)
exten => 123,3,vmauthenticate(${CALLERID(number)})
exten => 123,4,Authenticate(1234)
exten => 123,5,Goto(reminder,s,1)
User avatar
franklin
Senior Boarder
Senior Boarder
 
Posts: 254
Joined: Fri Oct 22, 2010 12:23 pm
Karma: 7

Re:authenticate external and internal users/reminders

Postby dicko » Fri Feb 25, 2011 9:15 pm

http://www.voip-info.org/wiki/view/Aste ... thenticate

look at the "workaround" and the j option
There are other solutions!!
dicko
Platinum Boarder
Platinum Boarder
 
Posts: 4099
Joined: Fri Oct 24, 2008 12:39 pm
Location: Not available
Karma: 156

Re:authenticate external and internal users/reminders

Postby franklin » Fri Feb 25, 2011 11:41 pm

I'd like to start out with a simple password file. Authenticate(/passwdfile|[,options[,maxdigits]])

in /etc I did vi reminderspasswords
and put 4 lines of 4-digit passwords and saved
then did what you see below and amportal restart. I don't seem to be hitting the password file. Where should that be kept? I see passwd in /etc, but it doesn't seem like adding to that is a good idea.


[from-internal-custom]
exten => 123,1,Answer
exten => 123,2,Wait(1)
;exten => 123,3,vmauthenticate(${CALLERID(number)})
exten => 123,3,Authenticate(/reminderspasswords)
exten => 123,4,Goto(reminder,s,1)

Thank you.
User avatar
franklin
Senior Boarder
Senior Boarder
 
Posts: 254
Joined: Fri Oct 22, 2010 12:23 pm
Karma: 7

Re:authenticate external and internal users/reminders

Postby dicko » Sat Feb 26, 2011 1:03 am

The asterisk home directory is /var/lib/asterisk
There are other solutions!!
dicko
Platinum Boarder
Platinum Boarder
 
Posts: 4099
Joined: Fri Oct 24, 2008 12:39 pm
Location: Not available
Karma: 156

Re:authenticate external and internal users/reminders

Postby franklin » Sat Feb 26, 2011 1:31 am

little lost. I put a file in /var/lib/asterisk called passwords and changed ownership to asterisk asterisk. Put a single line of 1234. Called that file out in extensions_custom.conf

[from-internal-custom]
exten => 123,1,Answer
exten => 123,2,Wait(1)
;exten => 123,3,vmauthenticate(${CALLERID(number)})
exten => 123,3,Authenticate(/passwords)
exten => 123,4,Goto(reminder,s,1)

Still doesn't work. Spent a lot of time going over all the links at http://www.voip-info.org/wiki/view/Aste ... thenticate

I assume that Authenticate(/) would look up whatever is in "filename." What am I doing wrong? Tried twice to reg to the pbxinaflash forum. Their mod does not authenticate you. ???

Thanks.
User avatar
franklin
Senior Boarder
Senior Boarder
 
Posts: 254
Joined: Fri Oct 22, 2010 12:23 pm
Karma: 7

Re:authenticate external and internal users/reminders

Postby fmvillares » Sat Feb 26, 2011 9:46 am

sorry guys the authentication files for pin sets ned to be saved in etc/asterisk...
fmvillares
Gold Boarder
Gold Boarder
 
Posts: 1785
Joined: Sat Sep 08, 2007 3:20 pm
Location: Rosario
Karma: 117

Re:authenticate external and internal users/reminders

Postby franklin » Fri Mar 04, 2011 6:53 pm

fm, dicko,

I put a file in /etc/asterisk/ called passwords. It has asterisk:asterisk ownership

dialing 123 hangs up when I have exten => 123,3,Authenticate(/passwords) or exten => 123,3,Authenticate/passwords

I put a file in /etc/asterisk/ called passwords. It has asterisk:asterisk ownership

dialing 123 hangs up when I have exten => 123,3,Authenticate(/passwords) or exten => 123,3,Authenticate/passwords

[from-internal-custom]
exten => 123,1,Answer
exten => 123,2,Wait(1)
;exten => 123,3,vmauthenticate(${CALLERID(number)})
exten => 123,3,Authenticate(/passwords)
exten => 123,4,Goto(reminder,s,1)

I want the Authenticate to take a password from a file. Any help? Thanks.
User avatar
franklin
Senior Boarder
Senior Boarder
 
Posts: 254
Joined: Fri Oct 22, 2010 12:23 pm
Karma: 7

Re: Re:authenticate external and internal users/reminders

Postby fmvillares » Fri Mar 04, 2011 7:02 pm

i have my passwords files in /tc/asterisk named pins and works perfect
exten=> 123,1,Authenticate(pins)
fmvillares
Gold Boarder
Gold Boarder
 
Posts: 1785
Joined: Sat Sep 08, 2007 3:20 pm
Location: Rosario
Karma: 117

Re: Re:authenticate external and internal users/reminders

Postby franklin » Fri Mar 04, 2011 7:10 pm

in /etc/asterisk/
-rw-rw-r-- 1 asterisk asterisk 15 Mar 4 16:25 passwords
inside passwords
1234
5678
9876
in extensions_custom.conf
[from-internal-custom]
;exten => 123,1,Answer
;exten => 123,2,Wait(1)
;exten => 123,3,vmauthenticate(${CALLERID(number)})
exten => 123,1,Authenticate(passwords)
exten => 123,2,Goto(reminder,s,1)

She answers but tells me my password is incorrect. I do an amportal restart after every change to extensions_custom.conf

?
User avatar
franklin
Senior Boarder
Senior Boarder
 
Posts: 254
Joined: Fri Oct 22, 2010 12:23 pm
Karma: 7

Re: Re:authenticate external and internal users/reminders

Postby fmvillares » Sat Mar 05, 2011 10:02 am

http://www.voip-info.org/wiki/view/Aste ... thenticate

i was having a long time ago a bug in asterisk # as send key for this type of apps...1.4.33 i think...and it was repetead in 1.6.2.17 as of today...the solution was to wait after the enter of the password without pressing # and worked...
fmvillares
Gold Boarder
Gold Boarder
 
Posts: 1785
Joined: Sat Sep 08, 2007 3:20 pm
Location: Rosario
Karma: 117

Re:authenticate external and internal users/reminders

Postby franklin » Sat Mar 05, 2011 2:28 pm

Still doesn't work. I am running 1.6. FreePBX updated to 2.7.

I put a new pswd file in etc/asterisk called pins. Put 1234 on the first line. That's it.

Have tried pins with as (/pins) and (pins) and did an amportal restart after every change. She tells me password incorrect every time. If I put (1234) after Authenticate it works. Tried not pressing #, too. Doesn't work. Am I putting the pswd file in the right place -- /etc/asterisk I get this on a tail:

WARNING[4187] app_authenticate.c: Unable to open file '/pins' for authentication: No such file or directory
[Mar 5 12:40:12] VERBOSE[4187] logger.c: -- Playing 'auth-incorrect' (language 'en')
[Mar 5 12:40:21] WARNING[4187] file.c: Failed to write frame


Thanks.

[from-internal-custom]
;exten => 123,1,Answer
;exten => 123,2,Wait(1)
;exten => 123,3,vmauthenticate(${CALLERID(number)})
exten => 123,1,Authenticate(pins)
exten => 123,2,Goto(reminder,s,1)
User avatar
franklin
Senior Boarder
Senior Boarder
 
Posts: 254
Joined: Fri Oct 22, 2010 12:23 pm
Karma: 7

Re: Re:authenticate external and internal users/reminders

Postby fmvillares » Sun Mar 06, 2011 9:01 am

and your dmtf modes both in the phone and in asterisk box?
fmvillares
Gold Boarder
Gold Boarder
 
Posts: 1785
Joined: Sat Sep 08, 2007 3:20 pm
Location: Rosario
Karma: 117

Re: Re:authenticate external and internal users/reminders

Postby franklin » Mon Mar 07, 2011 11:29 am

DTMF modes are standard. rfc2833 on the Ext.
Trunk:
disallow=all
type=friend
trustrpid=yes
dendrpid=yes
host=xxx.xxx.xxx.xxx
context=from-trunk
canreinvite=no
insecure=port,invite
allow=ulaw
qualify=yes

Going to try adding dtmfmode=inband to Trunk. Had to do this with ohter 1.6 boxes to make remote IVR access work. But not on this box. Strange.
User avatar
franklin
Senior Boarder
Senior Boarder
 
Posts: 254
Joined: Fri Oct 22, 2010 12:23 pm
Karma: 7

Re: Re:authenticate external and internal users/reminders

Postby fmvillares » Mon Mar 07, 2011 11:33 am

with inband no asterisk tones or apps work...watch that !
fmvillares
Gold Boarder
Gold Boarder
 
Posts: 1785
Joined: Sat Sep 08, 2007 3:20 pm
Location: Rosario
Karma: 117

Re:authenticate external and internal users/reminders

Postby franklin » Sat Mar 19, 2011 6:22 pm

dicko, fm,
Sorry for the length of this post. Any advice on how to fix this time stamping issue? Thank you:
Scenario: At 3:13PM I dial 123, plus code. Get into Reminders. Record the message. Enter the date. And accept. (I am on 24-hour format) The only way I can get it to accept the hour is if I enter 1:05 past the current time. I enter 16:20 and it returns back “you entered 3:20PM. Is this correct?” I accept and schedule
Then, the file that logs each call -- /var/log/asterisk/reminder.txt -- time stamps itself at the top with the correct date but the time of “16:13:42 ***New session ***” This date and time is specified in reminder.php as full form“….ll Rights Reserved.\n\n" . date("F j, Y - H:i:s"),..”
Reminder.txt also shows APPTTIME: 1620
var/spool/asterisk/outgoing also lists it as Mar 19 2011 1620.20110319..call

But the call gets placed at 3:20P/15:20. (same thing happens with the Web interface, which I was able to secure by editing /etc/httpd/conf/httpd.conf – thanks to PS paid support)
I’ve been looking at the code on reminder.php and everything else I can find from a # locate reminder. I can’t figure out why "F j, Y - H:i:s is returning an hour ahead, and why all the calls show the wrong time, but get delivered at the right time. Been Googling and learning PHP. Stuck.
# date returns Sat Mar 19 15:33:54 MST 2011, so the time, relatively speaking, that Allison read back to me.
# /etc/sysconfig/clock returns:
UTC=false
ARC=false
ZONE="America/Phoenix"
The script in crontab and the routine at /var/lib/asterisk/agi-bin/run_reminders don’t seem to affect the time stamp. Seems it is in /var/lib/asterisk/agi-bin/reminder (contents which I have not posted)
crontab:
00 0 * * * root /var/lib/asterisk/agi-bin/run_recurring
03 0 * * * root /var/lib/asterisk/agi-bin/run_reminders


run_reminders :
#!/usr/bin/perl

$PENDING = "/var/spool/asterisk/reminders" ;
$OUTGOING = "/var/spool/asterisk/outgoing" ;
$SLEEP = 5 ;

chomp($DATE = `/bin/date +%Y%m%d`);

chdir($PENDING) ;

foreach $file ( <*.$DATE.*.call> )
{
if ( -r $file )
{
$file =~ m/^(\d\d\d\d)\.(\d\d\d\d\d\d\d\d)\..+\.call$/ ;
$timestamp = $2 . $1 ;
rename($file, "$OUTGOING/$file") ;
system("touch -t $timestamp $OUTGOING/$file") ;
sleep($SLEEP) ;
User avatar
franklin
Senior Boarder
Senior Boarder
 
Posts: 254
Joined: Fri Oct 22, 2010 12:23 pm
Karma: 7

Next

Return to Tips and Tricks

Who is online

Users browsing this forum: No registered users and 1 guest