How do I use CNAM (Caller ID Name) with RingOut? - phone-call

When I set the Caller ID Name and make a RingOut through the RingCentral Java API, the receiving number displays only my Main Number, not my Caller ID Name. How do I get the call to show the CNAM?

Full disclosure, I am the COO of Telo, the makers of OpenCNAM and EveryoneAPI.
I wanted to clarify a few things contained in the initial answer to this question. I have had to answer the questions as my rep power on Stack Overflow limits my ability to post this as a comment to the question. :/
First is a quick overview of network CNAM. Next, a brief explanation of how it works and the caveats. After that, there are some specifics around Telo products, which some folks may find of value.
Overview of Network CNAM
In the +1 dialing plan (NANP) there are over 20 databases that store CNAM values, or caller name, on behalf of the telephone carriers. In practice, about 12 of them are actually queried by CNAM providers. The terminating carrier (the carrier receiving the call) queries their CNAM provider milliseconds after receiving the call with the CID (telephone number). While the call is being set up to ring, the CNAM provider will return the name value associated with that telephone number so that it can be delivered with the telephone call.
How This Works
If network CNAM is being delivered -- meaning, the carrier-supplied values that are being stored by the carrier's storage provider -- then the CNAM provider will route the query to the appropriate storage provider based on the telephone number. If a number has been ported, then the NPAC will contain the information needed to resolve the number to the appropriate storage source to be queried. If there is no record in the NPAC, then the CNARG will contain the information needed to match the telephone number to the carrier, and thus the correct storage provider.
Caveats
The match-rate for useful name values in the traditional CNAM network is about 50%. This is due to the fact that not all carriers participate. For example, while it is easy to set up CNAM values for AT&T Wireless, T-Mobile, and Sprint, Verizon Wireless is 'opt-in' and is not automatically supported. There are other carriers that do not participate in the CNAM network, and still, other VoIP providers that do not update CNAM values. The traditional CNAM network also does not provide values for toll-free numbers, and only has coverage inside of the +1 dialing plan.
About OpenCNAM
While OpenCNAM provides network CNAM through its Standard service level, it also provides two service levels that address the limitations of network CNAM mentioned above. The Plus service level is optimized for coverage, match-rate, and accuracy, while the Value service level provides excellent coverage and match-rates, but is optimized for cost. You can find out more about the service levels here.
EveryoneAPI For Current Carrier and Linetype
Our other product, EveryoneAPI, provides the most accurate data around linetype (landline or mobile) and current carrier, which will include ported numbers. The coverage for these data-points is global and the match-rate is nearly 100%. While the numverify looks very useful, it is providing what is known as LERG data for the +1 dialing plan, from what I can tell. This will not accurately reflect carrier information for ported telephone numbers.

CNAM Overview and Limitations
CNAM / Caller ID Name support is dependent on the the type of numbers used by the calling and receiving (callee) parties.
Caller must be using a local landline number, otherwise the phone number will be displayed.
Receiver must be using a non-mobile number, otherwise the phone number will be displayed.
I validated this by calling two numbers, a mobile number that showed only the phone number and a landline number that showed the CNAM.
You can read more on CNAM in this Knowlegebase Article:
Outbound Caller ID Name Overview and Frequently Asked Questions
This mentions the following excerpts:
The Outbound Caller ID Number must be a local landline number.
Toll free numbers are not supported. When the Outbound Caller ID is set to a Toll Free number, only the number will display.
Mobile numbers do not support CNAM. If the receiving party is a Mobile number, only the number will display.
When the Outbound Caller ID is set to Blocked, the call recipient will see UNKNOWN or ANONYMOUS as the Caller ID/Caller Name.
Checking Receiving Line Type
Given that mobile numbers don't support CNAM, it's useful to see if the number you are calling is a mobile number of not. You can verify the type of number you are calling by using the numverify API (https://numverify.com/). You can also use this CLI app and Go SDK grokify/numverify. Look for the line_type property in the validate API response which can be mobile or landline.
For example (phone number changed):
{
"valid": true,
"number": "16505550100",
"local_format": "6505550100",
"international_format": "+16505550100",
"country_prefix": "+1",
"country_code": "US",
"country_name": "United States of America",
"location": "Redwood Cy",
"carrier": "AT\u0026T Mobility LLC",
"line_type": "mobile"
}
Checking the CNAM Database
Receiving systems have their own CNAM databases, but you can check to see if your name has propagated by calling a CNAM database API, such as the one provided by OpenCNAM (https://www.opencnam.com/). Here is an example call for OpenCNAM. Adding the format query parameter is very important as the API will retry an empty body without it.
curl -XGET 'https://api.opencnam.com/v3/phone/+16505550100?format=json&account_sid=<myAccountSID>&auth_token=<myAuthToken>
You will receive a response like:
{
"name": "My Caller ID Name",
"number": "+16505550100",
"price": 0.0039,
"uri": "/v3/phone/+16505550100"
}

Related

HD wallet (bip32) addresses derivation path

I am creating an application that needs to generate a new address from a provided XPUB key.
For instance xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKrhko4egpiMZbpiaQL2jkwSB1icqYh2cfDfVxdx4df189oLKnC5fSwqPfgyP3hooxujYzAu3fDVmz
I am using the Electrum wallet and a key provided by this app.
My application allows users to add their own xpub keys, so my application will be able to generate new addresses without affecting users privacy, as far as xpub keys are only used by my application and not exposed to public.
So I am looking for a way to generate new addresses correctly, I have found some libraries, however I am not sure about the derivation path, how should it look like ?
Consider the following path example
Is the derivation path is more a convention rather than a rule?
Bitcoin first external first m / 44' / 0' / 0' / 0 / 0 is this is a valid path? I have found it here https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki
I have also found out that Electrum wallets uses another schema https://bitcoin.stackexchange.com/questions/36955/what-bip32-derivation-path-does-electrum-use/36956 in the following format. It uses m/0/ for receiving addresses, and m/1/ for change addresses.
What is the maximum number (n) of addresses? How online tools calculate the balance of an HD wallet, if the N number is quite large it will require a lot of processing power to calculate sum.
So all in all, I wonder what format of the derivation path should I use in order to have no problems with compatibility?
I would be grateful for any help.
question 1-3:
It's bip44 convention, electrum isn't following it therefore it's not compatiable with other wallets which support bip44.
question 4:
the number can be infinite, if you are talking about the maximum number for a certain parent key, answer is:
Each extended key has 2^31 normal child keys, and 2^31 hardened child
key
-https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki
if your application design leads to a very large quantity of addresses, that's your own issue which you need to handle it by better design, and if you mean the compatibility with other wallets, according to bip44,
Address gap limit is currently set to 20. If the software hits 20
unused addresses in a row, it expects there are no used addresses
beyond this point and stops searching the address chain.
https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#Address_gap_limit

How to mask credit card number mask in a text?

I have a form on my website and my customers send message to me with this form. Sometimes they write their credit card number on the message. So this is really critical. I want to mask these credit card numbers. But of course card numbers don't come on a regular basis.
Example 1: 1111222233334444
Example 2: 4444 3333 2222 1111
Example 3: 4444-3333-2222-1111
Example 4: 4444 - 3333 - 2222 - 1111
Example 5: 4444--3333--2222--1111
So I can mask for example 1, 2 and 3. But if there are more than one space or dash between numbers I can't.
And this is my last regex:
preg_replace("/(?:\b| )([3456]\d{3})([ -]+){0,1}\d{4}([ -]+){0,1}\d{4}([ -]+){0,1}(\d{0})/", "$1********$2", $a1);
And results for this regex:
Result 1: 4444********1111
Result 2: 4444******** 1111
Result 3: 4444********-1111
Result 4: 4444******** - 1111
Result 5: 4444********--1111
So what should I do in regex? Thanks.
May I suggest that you separate validation of your credit card number from the presentation of that number to your users via the UI? Assuming you have only stored valid credit card numbers, then it is probably safe to assume that every number has at least 8 digits. If so, then you can just use a blanket regex to only display the first 4 and last 8 digits:
$cc = "4444--3333--2222--1111";
echo preg_replace("/(\d{4}).*(\d{4})/", "$1********$2", $cc);
4444********1111
Demo
You might point out that this puts the same number of stars in between every card number. But, then again, this is a good thing, because it makes it even harder for a snooper to fish out what the real unmasked number actually is.
Edit:
Here is a smarter regex which will star out the middle portion of any number, leaving only the first and last 4 characters visible:
$cc = "4444--3333--2222--1111";
echo preg_replace("/(?<=.{4}).(?=.{4})/", "*", $cc);
4444**************1111
Note that this solution would not remove anything from 11114444 as a theoretical input.
How to mask credit card number mask in a text [with regex]?
Don't.
Sometimes they write their credit card number on the message.
They really shouldn't. Don't encourage this behavior. It is not PCI compliant:
What is PCI Compliance?
The Payment Card Industry Data Security Standard (PCI DSS) applies to companies of any size that accept credit card payments. If your company intends to accept card payment, and store, process and transmit cardholder data, you need to host your data securely with a PCI compliant hosting provider.
When you accept credit card data via a website, do so using an approved service provider like Stripe, PayPal, BlueSnap, SecurionPay, etc. These services are immensely popular not because it's hard to make payment systems, but because they're hard to make right (and legal). They all have PHP API's, so you can have people enter credit card data that you never see, and still charge them for amounts that you agree upon.
For example, if you were using Stripe and you wish to inform your customer what credit card they signed up with, their card object has a last4 property that gives the last four digits of the card: At this point you never knew the full credit card number, and you didn't even have to consider whether giving the first four and the last four was a security violation.
Further guidelines:
Never store electronic track data or the card security number in any form
While you may have a business reason for storing credit card information, processing regulations specifically forbid the storage of a card’s security code or any “track data” contained in the magnetic strip on the back of a credit card.
The card security number, called by many acronyms including CVV2, CID, and CSC, is the three digit number on the back of Visa/MasterCard/Discover cards or the 4 digit number on the front of American Express cards. It is designed to provide a way for merchants to know whether a customer authorizing a transaction over the phone or via the Internet actually has the card in their possession. This approach only works if the security code is never stored with the card number. Electronic storage makes this easy. You simply do not create a field for the security code. For paper storage, you need to redact (cross out with a dark pen to make unreadable) the security code after you successfully process the transaction and before you store a paper authorization form. [...]
Clearly you should store neither security codes nor track data purposely. But, you need to make sure you don’t store it inadvertently as well. To do this, be certain to use only approved hardware and software. [...]
Make sure all electronic storage of credit card account numbers is encrypted and all paper storage is secured
[...] Electronic storage of credit card numbers is also common if, for example, you process recurring or repeat transactions. If you do this, you need to make certain that you never store these files unencrypted. You need to make certain that any electronic storage is encrypted using a robust encryption algorithm. That way, if your computer is stolen or if someone in your office gains unauthorized access, you have some level of protection for the credit card numbers.
There are many service providers that offer secure storage—either as a standalone service or as part of a payment processing package. These services typically provide you with a “Token” for a card number they store. You can store the token in any unsecured file. When you’re ready to process a payment, you simply send the service provider the token and it retrieves the full card number for the sole purpose of processing the payment. (It’s technically more complicated than that, but you get the idea.) Just be certain to use a PCI DSS Verified provider [...]
Check the next regex \b([3-6]\d{3})(?: *-* *\d{4}){2} *-* *(\d{4})\b.

What is the data option of eth_sendTransaction?

I am trying to send ERC20 token using JSON RPC. I am very new in this step and learning. I am using eth_sendTransaction function. What is "value" and "data" option in this case ? Please help
From https://programtheblockchain.com/posts/2017/12/29/how-ethereum-transactions-work/:
The following values are encoded:
recipient – The account address to which the transaction is being sent.
value – The amount of ether to transfer from the sender to the recipient. This amount may be zero.
data – Optional arbitrary binary data. During contract deployment, this is where the contract’s bytecode is sent. When calling a function on a contract, this specifies which function should be called and with what arguments. For simple transfers of ether, the data portion of the transaction is typically omitted.
gas limit – The maximum amount of gas that can be consumed by the transaction.
gas price – The amount the sender will pay for each unit of gas.
nonce – A sequence number called a “nonce”. The sequence number is per sender and must match the next available sequence number exactly.
signature – Data that identifies and authenticates the transaction’s sender.
If you want to send ERC20 tokens via RPC calls, you need to call the transfer function of the token contract with correct parameters.
Since ERC20 is not a well-defined standard, but rather an interface I would not recommend doing that blindly, you would have to study the contract source first to make sure it's possible.
To answer your question on a higher level:
value is the amount of Ether transferred (in Wei) and should be 0 because you do not want to transfer any ETH.
data is the hex-encoded execution of the ERC20 transfer, e.g., the method name called, and it's parameters.
I highly recommend using a wallet that supports ERC20 tokens, such as MyCrypto or Parity, but that is probably not what you are asking for :)
Note, I work for Parity.

How do I Seperate landlines from cell numbers

Hi i have a list of phone numbers that id like to send sms messages too but some of them are landlines and some are cell phone numbers is there a way to clean the list to tell which is which?
There are services that will identify whether or not a phone number is a wireless or landline number. When trying to determine whether a phone number is a wireless or a landline number you need to make sure number portability is taken into consideration. Regarding North American phone numbers, some services only look at the exchange block (the first 7 digits) of the phone number to see if the phone number is assigned to a wireless or a landline block. Since numbers can be ported (e.g. you can port your original landline number to a cell phone and vice versa) it's important to check the full 10 digit number to see whether it has been ported or not.
The company I work for, PacificEast, provides this in batch (you send the entire file) or via a web service (you query one phone number at a time) for US and Canadian phone numbers. Have a look at our Line Identification Append service. Other companies provide similar services as well. Our TeliSight service will also provide the email address format you can use to send an email that will be converted to an SMS message for those North American carriers that support it.

Details of Bing Confidence Levels

Has anyone found a more complete description of what the Bing Confidence Enumeration values actually mean?
I'm trying to reconcile the results against another source of address data that has confidence values such as City, Street and Specific Address, and I want to get a feel for where the Bing results sit on this scale. I'm using the RESTful API.
The MSDN documentation only states that "High = The geocode service has high confidence in the match." etc.
Based on the MSDN documentation, you will be able to find various values for this property.
See: http://msdn.microsoft.com/en-us/library/ff701725.aspx
Extracted from the documentation:
The level of confidence that the geocoded location result is a match.
Use this value with the match code to determine for more complete
information about the match.
The confidence of a geocoded location is based on many factors
including the relative importance of the geocoded location and the
user’s location, if specified. The following description provides more
information about how confidence scores are assigned and how results
are ranked.
If the confidence is set to High, one or more strong matches were
found. Multiple High confidence matches are sorted in ranked order by
importance when applicable. For example, landmarks have importance but
addresses do not.
If a request includes a user location or a map area (see User Context
Parameters), then the ranking may change appropriately. For example, a
location query for "Paris" returns "Paris, France" and "Paris, TX"
both with High confidence. "Paris, France" is always ranked first due
to importance unless a user location indicates that the user is in or
very close to Paris, TX or the map view indicates that the user is
searching in that area.
In some situations, the returned match may not be at the same level as
the information provided in the request. For example, a request may
specify address information and the geocode service may only be able
to match a postal code. In this case, if the geocode service has a
high confidence that the postal code matches the data, the confidence
is set to High and the match code is set to UpHierarchy to specify
that it could not match all of the information and had to search
up-hierarchy.
If the location information in the query is ambiguous, and there is no
additional information to rank the locations (such as user location or
the relative importance of the location), the confidence is set to
Medium. For example, a location query for "148th Ave, Bellevue" may
return "148th Ave SE" and "148th Ave NE" both with Medium confidence.
If the location information in the query does not provide enough
information to geocode a specific location, a less precise location
value may be returned and the confidence is set to Medium. For
example, if an address is provided, but a match is not found for the
house number, the geocode result with a Roadblock entity type may be
returned. You can check the entityType field value to determine what
type of entity the geocode result represents. For a list of entity
types, see Entity Types.