What do you think about a config parameter defining a default phone number prefix (code) that will be automatically prepended if the number does not start with a "plus" character. For those who operate in a specific country/region, this may be handy.
Announcement
Collapse
No announcement yet.
Default phone number prefix?
Collapse
X
-
+1
but how you will resolve the national number if user add so ?
sample :
02 111 22 22 -> national number of region brussels
the result must so :
3221112222
I have forget how work voip extension (how he resolve that)
in resume, i think we need store in database the full countryCode+number, it's just my opinion.
Comment
-
The full number "+{code}{number}" will be stored. "+{code}" will be prepended dynamically (in the UI input) if the entered number does not start with "+". Will it work for you?
Comment
-
- Likes 1
Comment
-
I don't think this lib suits CRMs. It's fine for online forms. Plus I don't like that it relies on a JS script lazy-loading.
Comment
-
Hi Yuri,
i post here for add a print-screen of dial rules.
The problem is "User".. you can't imagine how phone field is filled​
Yes, we can call from GSM or HomePhone with only 02 111 222 22 for brussels (as sample) .. just for out of country, we need make de country code.
For Voip Provider and too SMS provider only international format is accepted. (E164 i think !?)
Ours Voip Provider, only accept call outbound like 32x. and when a call is received, it's too 32x.
So it's why i use some "dial rules" in ours office pbx (see print-screen) and it's why i think your Voip Extension must be too ready to this feature
Just for your information, i have try to resolve National or Country with library .. maybe to brainstorm.
Best Regards
PHP Code:<?php
namespace Espo\Custom\Jobs;
use Espo\Core\Job\JobDataLess;
use Espo\Core\ORM\EntityManager;
use Espo\Core\Utils\Log;
use Brick\PhoneNumber\PhoneNumber as PhoneNumberUtil;
use Brick\PhoneNumber\PhoneNumberParseException;
use Brick\PhoneNumber\PhoneNumberFormat;
class PhoneNumber implements JobDataLess
{
public function __construct(
private EntityManager $em,
private Log $log
){}
public function run() : void
{
$integration = $this->em->getEntity('Integration', 'Huawei');
$number = PhoneNumberUtil::parse('+32496520352');
if (! $number->isPossibleNumber()) {
}
$this->log->error( $number->format(PhoneNumberFormat::NATIONAL) );
echo $number->getNumberType();
echo $number->getRegionCode();
$this->log->error( $number->format(PhoneNumberFormat::NATIONAL) );
$number->format(PhoneNumberFormat::INTERNATIONAL);
}
}​
Comment
-
Hello,
How can I store internal phone numbers with International phone numbers feature enabled?
I've found this funkction comes with validation for lenght of phone number to 9 digits and I cannot add separator as .#:
E.g. phone as +12987654321.123 is stored as +12987654321
+12 - country prefix
987654321 - phone number
123 - internal (office) phone number
PS: when International phone numbers​option is disabled I can strore such numbers in database
Regards
Jacek
- Likes 1
Comment
-
Extensions support will be available in v8.3: https://github.com/espocrm/espocrm/issues/3022. No ETA yet.
- Likes 2
Comment
Comment