4

Since i changed my phone number, i want to send most of my contacts a sms with my new number. On Ubuntu Phone this is very unconvient because the application has to switch to the contact register for every name i want to add. With over 100 of contacts this gets pretty annoying. Anybody knows a more elegant solution? Something like a check box for the conctacs register?

morast
  • 43

2 Answers2

2

If you type in the To field of a new message it will suggest matching contacts and you can tap to select one. Then you can type another name in the same To field and so on.

pomsky
  • 70,557
2

This is a slightly hack-ish solution and I haven't actually tested all of it (and due to the lack of a SIM card won't be able to, in the near future), but it might be helpful.

Firstly, you'll either need to either install the terminal app on your phone, if you haven't already, or connect to your phone from your computer (simply via adb shell or using ssh — for details see here). In any case, you'll need to enable developer mode on your phone.

Sending text messages via cli

According to this "Ubuntu phone gitbook", you can send sms from the command-line using /usr/share/ofono/scripts/send-sms. If you run the program without any arguments, you'll get the rather terse help message:

Usage: /usr/share/ofono/scripts/send-sms [modem] <to> <message> <delivery report>

It seems that "modem" can take the values /ril_0 and /ril_1 (for two SIM-cards — run mc-tool dump and inspect the lines "modem-objpath" if for other models these are different), "to" and "message" are self-explanatory (the telephone number and content of the message) and "delivery report" is presumably a boolean that determines whether you get a delivery report(?) — the guide sets it to 0, so we can probably do that as well.

Listing contacts via cli

Again, on the basis of the gitbook, it's possible to export your list of contacts cli to the file list_of_contact_telephone_numbers with this command:

syncevolution --export - backend=evolution-contacts | sed -n 's/^TEL;TYPE=[a-z,]*://p' | tr -d ' ' > list_of_contact_telephone_numbers

I suggest that you edit/inspect this file to remove any special numbers and check for errors.

Send SMS to all contacts

As a result, you should be able to send an SMS to all your contacts with the following:

cat list_of_contact_telephone_numbers | while read contact
do
    /usr/share/ofono/scripts/send-sms /ril_0 "$contact" "This is xxxx. My new phone number is +xxxx." 0
done

(I suggest you first test this with only one line in list_of_contact_telephone_numbers to see if it works.)

aplaice
  • 995