NO JOY Anybody get Bulk Handler Module to work withouth the following error

mainenotarynet

Not really a Guru - Just a long time user
Joined
May 29, 2010
Messages
619
Reaction score
82
Location
Bangor, ME USA
I know I 'complained' about this module befor but now it is just one error that keeps coming up.

The function that causes it (by the line number and where it is) is below

Code:
public function generateDefaultDeviceSettings($tech,$number,$displayname,&$flag = 2) {
        $flag = !empty($flag) ? $flag : 2;
        $dial = '';
        $settings = array();
        //Ask our tech if it has default settings
        if(isset($this->drivers[$tech])) {
            $settings = $this->drivers[$tech]->getDefaultDeviceSettings($number, $displayname, $flag);
            if(empty($settings)) {
                return array();
            }
        }
        $gsettings  = array(
            "devicetype" => array(
                "value" => "fixed"
            ), <-- This is 1435
            "user" => array(
                "value" => $number
            ),
            "description" => array(
                "value" => $displayname
            ),
            "emergency_cid" => array(
                "value" => '',
            ),
            "dial" => array( <-- this is the index it cannot find but Ext 701 adds the field to the exported csv file.
                "value" => $settings['dial']."/".$number, <-- Ext 701 has this a SIP/701 -- 701 goes through but  stops at record 2 at same point but does add it but won't do record 3.
                "flag" => $flag++
            ),
            "secret" => array(
                "value" => $this->generateSecret(),
                "flag" => $flag++
            ),
            "context" => array(
                "value" => "from-internal",
                "flag" => $flag++
            ),
            "mailbox" => array(
                "value" => $number."@device",
                "flag" => $flag++
            ),
            "account" => array(
                "value" => $number,
                "flag" => $flag++
            ),
            "callerid" => array(
                "value" => "device <".$number.">",
                "flag" => $flag++
            )
        );

        return array_merge($settings['settings'],$gsettings);
    }
I added notes to what is happening. Did 13.13 break the database but the export didn't?

I REALLY do NOT want to hand enter 148 Extensions, and I may be starting a new server for another group I am part of (they have two - I would be a third (HHC - Main one | HHX is other than Cisco phones | HHP - mine for unlicensed people to tie to these other two) - and if things go south I would not want to enter all these again either.

Is there anything I can do or does anyone have a clue as to what is wrong here.

Side Note -- my Port Knocker keeps shutting down, (I am on Hiformance which uses Venet0:0 what was the command AND file to add it to to fix the interface on PortKnocker?
 

Attachments

phonebuff

Guru
Joined
Feb 7, 2008
Messages
906
Reaction score
62
Have you looked at your source, to make sure you don't have an un escaped quote or coma in the source information, causing it to parse incorrectly.. If you have a lot of source data maybe put a simple awk script together to look at the data and tell you when the line does not have the correct number of fields.
 

mainenotarynet

Not really a Guru - Just a long time user
Joined
May 29, 2010
Messages
619
Reaction score
82
Location
Bangor, ME USA
Steps:

1 set up Extension 701 as a SIP and 10101 as Virtual to get the two types of extensions I will have (fields to import if you will)
2 Go to Bulk Handler and EXPORT (from the PBX itself) the file as a csv
3 Using this CSV (That the PBX provided itself (field names were NOT touched) ) added the other 145 extensions from the OLD FReePBX 12 format which had the Bulk DIDS and Bulk Extensions modules separated) and matched them up field for field
4 Saved file and went back into the PBX to Bulk Handler IMPORT
5 Selected the file that I just saved and clicked submit.

File opens and shows all 148 extensions to be added - I click Import.... row 0 -- 701 -- Green ||row 1 -- 3100 -Green BUT DIES with the Post #1 error.

If the first extension has the "dial" and the file has the "dial" where the #%#&$* does the index come from that the script is looking for -- The error is not mine as I only edit the exported file it gives me.
 

phonebuff

Guru
Joined
Feb 7, 2008
Messages
906
Reaction score
62
File opens and shows all 148 extensions to be added - I click Import.... row 0 -- 701 -- Green ||row 1 -- 3100 -Green BUT DIES with the Post #1 error.
So I do a lot of CSV work every day, but I have not done an Import / Export with Asterisk in a few years. All of my current systems are 10 ext. or less so I just bang them in by hand if I have to rebuild.

You have 148 Extensions, so your CSV should have 149 Rows in my mind. The header and each of the extensions.

What did you edit it in ? Excel can do some very weird things to a CSV so I like to use the Open Office LibreOffice project for editing.

If you are building this by hand or some other data source you may want to generate the CSV with a tool like awk.
 
  • Like
Reactions: ostridge

mainenotarynet

Not really a Guru - Just a long time user
Joined
May 29, 2010
Messages
619
Reaction score
82
Location
Bangor, ME USA
It's not the file but an index it says does not exist, look at the red pic in Post #1 when you look at the file at the line it states, it is actually ),

but it is within the function of the code block I posted. OI can try this in open Office (as I am using Excel, but in FPBX12 and prior this was not an issue. That used csv files too 128 columns for each extension, this FreePBX13 changed this to Bulk Handler and all my problems started. But Ward said that not many use these modules so, I'm on my own as to where to go for help.

I'd send the file but there is that nasty thing of security, I mean I can strip the secrets out but what does that prove?

I guess I'll be typing for days to get this in. What a shame -- The did part works, the Blacklist works -- the extensions part does not.
 

phonebuff

Guru
Joined
Feb 7, 2008
Messages
906
Reaction score
62
Syntax for associative arrays:
array(key=>value,key=>value,key=>value,etc.);

Code:
       "dial" => array( 
               "value" => $settings['dial']."/".$number, "flag" => $flag++
           ),
So in this paragraph you have three key / Value pairs.

Can you upload your CSV file with just the 701, 1011 and the extension that is failing in it. Change the password to Passw0rd if you have concerns.
 

mainenotarynet

Not really a Guru - Just a long time user
Joined
May 29, 2010
Messages
619
Reaction score
82
Location
Bangor, ME USA
OK I took and opened the cvs file in notepad++ which is just a plain text editor, Took the header row - 3 SIP extensions (701, 3100, 3101) and 3 Virtual extensions 10101, 10201, 10301) and copied them into a NEW text file (csv format) and tried again -- still no joy, but it is in the Validation steps it can't get through, it keeps saying the index does not exist.

You wanted it, so here is just the 3and3 stripped (numbers and passwords genericized) file -- if you have one or do virtuals start with Asterisk/Incredible 13-13 and you'll need the TGZ for the Bulk Handler, if you don't have that (I do), you DO want to create your 701 otherwise my guess is this won't make it past row 0.

Tried attaching file and got this:

The following error occurred
The uploaded file does not have an allowed extension.

stripped3and3.csv, so I cannot attch, how do you want it?
 

mainenotarynet

Not really a Guru - Just a long time user
Joined
May 29, 2010
Messages
619
Reaction score
82
Location
Bangor, ME USA
With the six extesions I gave you, I don't see it -- take your car to a mechanic and he says "you have a serious issue'

WHAT allignement issue?

A=Extension
B =was Password (is this suppsed to be secret? but that is further in -- Exported had this blank
C=Description - The person's name on FreeBX pages
D=is there Voicemail (Default or NoVM

Where is this alignment issue. And allignment with WHAT?

Whatever - I'll just do it by hand -- what a time water though when the import shou import what was Exported in the same format same field names etc..

I give up. You win, not wotrh trying to fix an 'obsolete' modle
 

phonebuff

Guru
Joined
Feb 7, 2008
Messages
906
Reaction score
62
If all the Headers and data don't align the import will not work --

CD and over which is the Voice mail settings are not in alignment here --

An now I can't get anything attached --

 

phonebuff

Guru
Joined
Feb 7, 2008
Messages
906
Reaction score
62
Okay,

Upload a file is back --

See this Snip it from the raw worksheet - And you will see that the column alignment is off.

CD-Capture.PNG
 

mainenotarynet

Not really a Guru - Just a long time user
Joined
May 29, 2010
Messages
619
Reaction score
82
Location
Bangor, ME USA
I don't know what you are using, but in both OpenOffice Cal and MS Excel there is no alignnment issue where you are showing it.

Anyone ELSE have any ideas, again it's a shame that this import for extensions in Bulk handler doesn't work , especially when you do the first extensions manually in each category (Sip and Virtual)
 

Attachments

phonebuff

Guru
Joined
Feb 7, 2008
Messages
906
Reaction score
62
Try my edited version of your file please --

Also, can you explain the steps you took to get the Bulk handler into you instance of 13-13.
 

Attachments

mainenotarynet

Not really a Guru - Just a long time user
Joined
May 29, 2010
Messages
619
Reaction score
82
Location
Bangor, ME USA
I was having a problem before with Superfecta, which is in this thread, start here and read Ward's answer to it: https://pbxinaflash.com/community/threads/enchilada-maybe-others-cid-superfecta-errors.22573/#post-136618

basicly he says to pull it from souce to desktop, and manually load it as it is not included in GPL (or whatever) repository to keep it updated, so because of this, I don't think this works right.

By the way, your modified file (changing only passwords back to 'real ones' and emails, produced this: Header row and data row count do not match.

This may be due to doing SIP and Virtual at once, but since Bulk handler does not say export SIP, Export IAX, Export tiddlywinks, etc the file is all a mess and this is why this is a waste.
 

Members online

PIAF 5 - Powered by 3CX

Forum statistics

Threads
22,564
Messages
138,894
Members
14,673
Latest member
vicndf