Jump to content

Rules: Stripping + symbol


Recommended Posts

Hello 2600hz, 

I would like assistance stripping the + symbol from being used for an outbound carrier. I have googled for some time and not been able to make heads or tails of how to tell the carrier not to add that symbol on when making outbound calls to VoIP.ms. 

Many thanks in advance for the assistance, as I'm unsure quite how to approach this other than adding the carrier. 

 

Kind Regards,

Sparky Tony  

Link to comment
Share on other sites

  • 10 months later...

Hi Sparky Tony, 

I managed to do this using the resources document at /v2/resources when you add a carrier. You use the rules property to capture the correct part of the CLI and then use the prefix property in the gateway to specify no prefix. E.g.

{
    "data": {
        "enabled": true,
        "emergency": false,
        "gateways": [
            {
                "caller_id_type": "external",
                "channel_selection": "ascending",
                "codecs": [
                    "PCMU",
                    "PCMA",
                    "OPUS"
                ],
                "enabled": true,
                "endpoint_type": "sip",
                "force_port": false,
                "invite_format": "route",
                "password": "carrier_password",
                "port": 5060,
                "prefix": "",
                "server": "carrier_host",
                "suffix": "",
                "username": "carrier_username"
            }
        ],
        "name": "Carrier",
        "rules": [
            "^\\+?(\\d{8,})$"
        ]
    }

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...