john990 / sipdroid

Automatically exported from code.google.com/p/sipdroid
GNU General Public License v3.0
0 stars 0 forks source link

Add "replace" option #83

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I'm using sipdroid with netvoip.ch. All my phone numbers are stored in the
"+41xxxxxxxxx" format. Netvoip.ch does not accept this format and I need to
replace the number with "0041xxxxxxxxx" before calling.

I contacted netvoip.ch and they told me that they have not planned to
support this "feature"!?

So I would really appreciate a "replace" feature in sipdroid. It could be
based on regular expressions. Something like:

Replace: ^\+41(.*)$
With: 0041\1

Original issue reported on code.google.com by cyril.ja...@gmail.com on 16 Jul 2009 at 1:38

GoogleCodeExporter commented 8 years ago
Going thru PBXes would be a possible solution.

Original comment by pmerl...@googlemail.com on 16 Jul 2009 at 2:19

GoogleCodeExporter commented 8 years ago
I know this but I prefer to have only one account. Would you accept a patch?

Original comment by cyril.ja...@gmail.com on 16 Jul 2009 at 2:25

GoogleCodeExporter commented 8 years ago
Yes, please outline what you want to change, and I will add you as a member to 
check it 
in.

Original comment by pmerl...@googlemail.com on 16 Jul 2009 at 2:59

GoogleCodeExporter commented 8 years ago
I think we could extend (replace) the prefix option with a replace feature. 
Then the
prefix option would be:

Replace: (.*)
With: 123\1

So that we have a more flexible solution.

GUI

* Rename "Prefix" to "Adapt phone number" (or something similar)
* Create a dialog with 2 edit field: "Search pattern" and "Replace with"
* If possible add help about regular expressions

Core

* Add 2 new preferences "adaptsearch" and "adaptreplace"
* Implement the match/replace function in the Caller class ("prefix" is done 
there so
I guess this would be the right place. Do phone numbers entered in sipdroid 
directly
also come here?)
* Automatically migrate the "prefix" option

Original comment by cyril.ja...@gmail.com on 16 Jul 2009 at 3:34

GoogleCodeExporter commented 8 years ago
These preferences can be collapsed into one field (Replace Pattern), by taking 
in
input in the format (replacePattern,withPattern), parsing the input and then 
applying
the transformation.

Will save screen real estate and reduce clutter...

Original comment by wavehill09@gmail.com on 16 Jul 2009 at 9:05

GoogleCodeExporter commented 8 years ago
Indeed. IMHO this would be less user-friendly. But regular expressions are 
already a
nightmare for standard users ;) And this will simply the implementation a lot.

I found 3 references to SipdroidEngine#call. I guess the only one that needs to 
be
modified is in Caller#onReceive. I think the value typed by the user in sipdroid
should be used as this. Is SIPUri still needed?

wavehill09, do you mind if I change your "prefix" feature? Or do you want to do 
it?

Original comment by cyril.ja...@gmail.com on 16 Jul 2009 at 9:32

GoogleCodeExporter commented 8 years ago
I've added cyril as a member.

Original comment by pmerl...@googlemail.com on 16 Jul 2009 at 9:51

GoogleCodeExporter commented 8 years ago
Please go ahead and change it.

Original comment by mntwoo...@gmail.com on 16 Jul 2009 at 10:52

GoogleCodeExporter commented 8 years ago

Original comment by pmerl...@googlemail.com on 16 Jul 2009 at 11:52

GoogleCodeExporter commented 8 years ago
Accepted Cyril's patch. Thank you!

Original comment by pmerl...@googlemail.com on 22 Jul 2009 at 9:55

GoogleCodeExporter commented 8 years ago
I use (.*),3651\1 for adding 3651 (for french private calls).

Now an old bug (from prefix option) is back: how do I call twice a number 
without
adding twice the prefix?

Original comment by Murphy2...@gmail.com on 20 Aug 2009 at 1:41