Deviceanduser problems

I am setting up a new PBX-in-a-Flash (PIAF) box to replace my old TB box. I d/l PIAF 32-bit iso and setup the A1.4 version. It has FreePBX 2.4.0 installed. The first thing I did was to set it to use deviceanduser mode and then added some users and devices. I set the devices to be adhoc with no default user. So now the devices are displaying the correct device number on their consoles and I try logging into one as a user. The *11 prompt says to enter extension number then press # (I’m assuming it means user number) so I do that and then it says an error has occurred - goodbye. What am I doing wrong? I had this working on TB/A1.2 before.

Here is some info:

[email protected]:/ $ su - asterisk
[[email protected] ~]$ retrieve_conf

Checking for PEAR DB…OK
Checking for PEAR Console::Getopt…OK
Checking for /etc/amportal.conf …OK
Bootstrapping /etc/amportal.conf …OK
Parsing /etc/amportal.conf …OK
Parsing /etc/asterisk/asterisk.conf …OK
Connecting to database…OK
Connecting to Asterisk manager interface…OK
Added to globals: ASTETCDIR = /etc/asterisk
Added to globals: ASTMODDIR = /usr/lib/asterisk/modules
Added to globals: ASTVARLIBDIR = /var/lib/asterisk
Added to globals: ASTAGIDIR = /var/lib/asterisk/agi-bin
Added to globals: ASTSPOOLDIR = /var/spool/asterisk
Added to globals: ASTRUNDIR = /var/run/asterisk
Added to globals: ASTLOGDIR = /var/log/asterisk
Added to globals: CWINUSEBUSY = true
Added to globals: AMPMGRUSER = admin
Added to globals: AMPMGRPASS = amp111
Use of uninitialized value in string eq at /var/lib/asterisk/bin/retrieve_op_conf_from_mysql.pl line 415.
DB Error: no such table
[[email protected] ~]$ grep AMPEXTENSION /etc/amportal.conf

AMPEXTENSIONS: the type of view for extensions admin

AMPEXTENSIONS=deviceanduser

[email protected]:/ $ asterisk -rvvvvv
Asterisk 1.4.19.2, Copyright © 1999 - 2008 Digium, Inc. and others.
Created by Mark Spencer [email protected]
Asterisk comes with ABSOLUTELY NO WARRANTY; type ‘core show warranty’ for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type ‘core show license’ for details.

== Parsing ‘/etc/asterisk/asterisk.conf’: Found
Connected to Asterisk 1.4.19.2 currently running on pbx (pid = 27390)
Verbosity was 3 and is now 5
– Executing [[email protected]:1] Macro(“SIP/0001-08bf49c0”, “user-logon|”) in new stack
– Executing [[email protected]:1] Set(“SIP/0001-08bf49c0”, “DEVICETYPE=adhoc”) in new stack
– Executing [[email protected]:2] GotoIf(“SIP/0001-08bf49c0”, “0?s-FIXED|1”) in new stack
– Executing [[email protected]:3] Set(“SIP/0001-08bf49c0”, “AMPUSER=”) in new stack
– Executing [[email protected]:4] GotoIf(“SIP/0001-08bf49c0”, “0?gotpass”) in new stack
– Executing [[email protected]:5] Playback(“SIP/0001-08bf49c0”, “please-enter-your&extension”) in new stack
– <SIP/0001-08bf49c0> Playing ‘please-enter-your’ (language ‘en’)
– <SIP/0001-08bf49c0> Playing ‘extension’ (language ‘en’)
– Executing [[email protected]:6] Read(“SIP/0001-08bf49c0”, “AMPUSER|then-press-pound”) in new stack
– <SIP/0001-08bf49c0> Playing ‘then-press-pound’ (language ‘en’)
– User entered nothing.
– Executing [[email protected]:7] Set(“SIP/0001-08bf49c0”, “AMPUSERPASS=”) in new stack
– Executing [[email protected]:8] GotoIf(“SIP/0001-08bf49c0”, “1?s-NOPASSWORD|1”) in new stack
– Goto (macro-user-logon,s-NOPASSWORD,1)
– Executing [[email protected]:1] NoOp(“SIP/0001-08bf49c0”, “This extension does not exist or no password is set”) in new stack
– Executing [[email protected]:2] Playback(“SIP/0001-08bf49c0”, “an-error-has-occured&vm-goodbye”) in new stack
– <SIP/0001-08bf49c0> Playing ‘an-error-has-occured’ (language ‘en’)
– <SIP/0001-08bf49c0> Playing ‘vm-goodbye’ (language ‘en’)
– Executing [[email protected]:3] Hangup(“SIP/0001-08bf49c0”, “”) in new stack
== Spawn extension (macro-user-logon, s-NOPASSWORD, 3) exited non-zero on ‘SIP/0001-08bf49c0’ in macro ‘user-logon’
== Spawn extension (macro-user-logon, s-NOPASSWORD, 3) exited non-zero on 'SIP/0001-08bf49c0’
pbx
CLI>

Regards,
Gerry

With the adhoc phones I’ve been setting the SIP User to the Device ID which is what displays on the phone. With the Fixed+DefaultUser phones I’ve been setting the SIP User to the Default User.

If you have that tftp-hpa and generator tweaked, I’d like to take a look at them when you’re ready. :wink:
I could use something like that for my grandscreams.

Regards,
Gerry

Still not getting anywhere:

More info:
extensions_additional.conf

[ext-local]
include => ext-local-custom
exten => 1001,1,Macro(exten-vm,1001,1001)
exten => 1001,n,Hangup
exten => ${VM_PREFIX}1001,1,Macro(vm,1001,DIRECTDIAL)
exten => ${VM_PREFIX}1001,n,Hangup
exten => vmb1001,1,Macro(vm,1001,BUSY)
exten => vmb1001,n,Hangup
exten => vmu1001,1,Macro(vm,1001,NOANSWER)
exten => vmu1001,n,Hangup
exten => vms1001,1,Macro(vm,1001,NOMESSAGE)
exten => vms1001,n,Hangup

; end of [ext-local]

[from-did-direct-ivr]
include => from-did-direct-ivr-custom
exten => 1001,1,ExecIf($["${BLKVM_OVERRIDE}" != “”],dbDel,${BLKVM_OVERRIDE})
exten => 1001,n,Set(__NODEST=)
exten => 1001,n,Goto(from-did-direct,1001,1)
exten => ${VM_PREFIX}1001,1,ExecIf($["${BLKVM_OVERRIDE}" != “”],dbDel,${BLKVM_OVERRIDE})
exten => ${VM_PREFIX}1001,n,Set(__NODEST=)
exten => ${VM_PREFIX}1001,n,Macro(vm,1001,DIRECTDIAL)

sip_additional.conf:

[0001]
type=friend
secret=XXXX
record_out=On-Demand
record_in=On-Demand
qualify=yes
port=5060
pickupgroup=
nat=yes
[email protected]
host=dynamic
dtmfmode=rfc2833
dial=SIP/0001
context=from-internal
canreinvite=no
callgroup=
callerid=Grandstream GXP2000 <0001>
accountcode=
call-limit=50

In working with this some more, it is almost like asterisk is not reading the dtmf after it prompts for the user to enter the extension. No matter what I input it always seems to just sit there and wait until it finally says an error has occurred. The phone is a GXP2000 w/1.1.6.16 firmware. I just upgraded these phones yesterday to the new firmware.

Regards,
Gerry

UPDATE: That was it. We needed to go back into all the phones and reset the dtmf option to include rfc2833 for all accounts.

So now deviceanduser mode is working fine with one small exception. When the device is in Fixed mode we see the default users name on the device console. When we switch the device to Adhoc mode then no name is displayed on the device console either for the default user or for any other user that may log in from this device. Is there a way to get the default and logged in users names displayed on the console for Adhoc devices?

Regards,
Gerry

I have a feeling you can’t do that…

Infact, I;m a little surprised that you even got the device number on the street without configuring that on your phone (or via phone config file).

Though I’m using Aastra phones, and as far as I know, the only way to change the text on the display is by configuring it on the phone itself, in the phones .cfg file, or by using an XML push to the phone (the method this occurs in is Aastra propritary I believe, so I wouldn;t expect FreePBX to support it).

I;m also running deviceanduser mode, what I do however is configure Line 1 as “Fixed” with a specific user as the default, and Line 3 as “Ad-Hoc” that users can log in/out of. For my phones config I enter the MAC address in the “description” field of FreePBX.

And I have a custom version of tftp-hpa that i modified to run a script for me whenever an Aastra phone requests its config file… the script then reads the FreePBX database and automatically creates the config file for me using the default user and their extension # from the database to display on the phone:


displayName1: Matt Watson
displayName2: 2011

Its incredibly handy for me, I;m planning on making the source for the tftp-hpa mod and the aastra config file generator available sometime in the near future.