[Spce-user] Addressbook troubles
Daniel Tiefnig
dtiefnig at sipwise.com
Sat Aug 20 12:46:18 EDT 2011
On 08/20/2011 04:25 AM, Skyler wrote:
> Hi daniel,
Hi!
> On Sat, 2011-08-20 at 03:21 +0200, Daniel Tiefnig wrote:
>> You could just remove the line to omit the broken substitution.
>
> Removing $$contact{$_} =~ s/^\+$user_cc/0/; entirely fixed the
> problem. Now it behaves as expected.
Ah yes, stupid me! The substitution is not based on the subscriber's
"cc" preference, but on the "cc" part of its E.164 number. Seems I did
not have enough sleep to spot that yesterday. This makes the code even
"wronger", if that's possible at all. :o)
> With the ($$contact{$_} =~ s/^\+$user_cc/0/;) this was adding cc& ac
> to any numbers entered into the addressbook.
Hmm, that's not possible and must be caused by something else, most
likely some normalization when processing the number input when creating
the addressbook entry. In your case, the substitution command would get
a string like "+12784562145" which is transformed into "02784562145". It
never adds something to the string, besides the hardcoded "0".
> ie: I enter 12784562145 as a contact and the csc would save
> '127812784562145' notice the cc+ac added?
Hmm, again I can't reproduce this over here with your settings. The
number input indeed uses the www_csc.(cc|ac)_dial_prefix settings to
parse the number string, and the first checks are:
* if the input matches "^+" (a plus sign at the beginning): do nothing
* if the input matches "^$ccdp": replace it by a plus sign
Here the www_csc.cc_dial_prefix setting is stored in the $ccdp
variable, so this looks for whatever has been configured at the
beginning of the number string. If the setting is empty, this would
always match and just prepend a plus sign to the entered string.
The only reason why cc+ac would be added to the beginning of the string
would be if both cc~ and ac_dial_prefix would not match, in this case
e.g. if you have configured them to the default "00" and "0". The
interface then thinks you're trying to dial a local number and therefore
adds the cc+ac.
br,
daniel
More information about the Spce-user
mailing list