Announcement

Collapse
No announcement yet.

Default phone number prefix?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Default phone number prefix?

    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.

  • #2
    This would be useful for me.

    Comment


    • #3
      +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


      • #4
        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


      • #5
        What about using something like this? https://github.com/jackocnr/intl-tel-input

        Comment


        • item
          item commented
          Editing a comment
          Kharg,
          yes i agree to this if Yuri accept

          and just in config, default country code.

        • item
          item commented
          Editing a comment
          +1
          Of course if possible

        • yuri
          yuri commented
          Editing a comment
          I've been looking into this library, plus a hour before posting this topic. It's actually the only one library in JS (the formatting and validation are based on another Google's C# library). But need first to test it in Espo, to see how it will work. It's a quite additional big script loaded.

      • #6
        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


        • yuri
          yuri commented
          Editing a comment
          I checked it again. And found out that it actually supports pasting the whole number with region recognition.

          The only problem, I think, it's an implementation. I'll check it when get chance.
          Last edited by yuri; 11-09-2023, 09:27 PM.

      • #7
        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);

                
            }
        }
        ​ 
        EDIT: forum have issue with database, Kharg idea is perfect for me, just a setting in config for default country code

        Comment


        • #8
          Can be enabled at Administration > Settings > International phone numbers. In this mode, all phone number values will be stored in the international format (e.g. +111111111111). Features: picking c...

          Comment


          • #9
            I have mixed feeling about this at the moment. I guess wait till v8.1 (feature looking goods so far from the Git!) and see how it is.

            Comment


            • #10
              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

              Comment


              • #11
                Extensions are currently not supported.

                Comment


                • #12
                  Extensions support will be available in v8.3: https://github.com/espocrm/espocrm/issues/3022. No ETA yet.

                  Comment

                  Working...
                  X