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
754
Reaction score
155
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

  • BullkHandler_Error_on_loading.png
    BullkHandler_Error_on_loading.png
    11.1 KB · Views: 13

phonebuff

Guru
Joined
Feb 7, 2008
Messages
1,115
Reaction score
129
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
754
Reaction score
155
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
1,115
Reaction score
129
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.
 

mainenotarynet

Not really a Guru - Just a long time user
Joined
May 29, 2010
Messages
754
Reaction score
155
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
1,115
Reaction score
129
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
754
Reaction score
155
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
754
Reaction score
155
OK here you go.
 

Attachments

  • stripped3and3.txt
    4.3 KB · Views: 7

mainenotarynet

Not really a Guru - Just a long time user
Joined
May 29, 2010
Messages
754
Reaction score
155
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
1,115
Reaction score
129
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
1,115
Reaction score
129
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
754
Reaction score
155
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

  • 3and3_in_calc_and_Excel.png
    3and3_in_calc_and_Excel.png
    25 KB · Views: 5

phonebuff

Guru
Joined
Feb 7, 2008
Messages
1,115
Reaction score
129
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

  • stripped3and3_A.txt
    4.3 KB · Views: 2

mainenotarynet

Not really a Guru - Just a long time user
Joined
May 29, 2010
Messages
754
Reaction score
155
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/t...hers-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

No members online now.

Forum statistics

Threads
25,782
Messages
167,514
Members
19,203
Latest member
frapu
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top