There may be a better or easier way of doing this but it works for me.
Under Apps->Contacts there is an import option. You can specify a .csv file to upload and then you are offered field mapping options. If you want to add speed dial contacts, a minimal file may look something like this:
Then map the fields in the import file something like this:
In order for speed dial to work, a user must be allocated to the extension making the call and that user must have permission to access the contact record. In most cases it is sufficient to add the "users" group to the contact.
If you have imported a lot of contacts, it will be tedious to add the users group to them all one by one, so for this I use a simple sql insert.
-- uuid of group users (In my case): 41ae078a-7042-4f4d-9d94-e361f612c245
-- uuid of domain we are playing with (In my case): 98e5a682-e6fc-4c00-a118-8bc7c2126bb4
-- as the pgsql installations does not have a uuid generator by default,
-- we can safely use the contact uuid as the contact group uuid. Just check it doesn't already exist.
-- ensure that no contact group permissions exist for the domain
insert into v_contact_groups select contact_uuid, domain_uuid, contact_uuid, '41ae078a-7042-4f4d-9d94-e361f612c245' from v_contacts