javascript - How to set Caller ID with area code matching using RingCentral WebRTC? -
when using ringcentral webrtc, possible set caller id (clid) outbound voice? have set of 1000+ phone numbers various area codes company want able use caller id when dialing out. have number of different agents making calls need multiple agents able use same caller id simultaneously.
i'm using ringcentral webrtc javascript sdk , didn't see caller id option.
after asking , trying things out figured out following:
(1) assigning caller id (clid) phone numbers
to load multiple clid phone numbers ringcentral account, add them company numbers can done in online account portal admin account under:
home
> phone system
> company numbers , info
> add number
i assigned of these auto-receptionist
.
once these numbers loaded company numbers, should available users use clid. verify this, retrieve list of clid numbers available user calling following rest api endpoint after user has authorized app:
/restapi/v1.0/account/~/extension/~/phone-number
the numbers returned can used caller id have callerid
1 of elements in features
property.
(2) selecting proper clid based on destination number
in app, once have number dialed, find closest matching area code. best if there exact match area code. after that, find 1 have geographically closest.
to identify best number use, areacode lat/lon mapping nearest-neighbor matching can used. wasn't able find direct code lat/lon mapping it's possible 1 of following:
- areacode lat/lon: can use direct areacode lat/lon database such 1 here: https://github.com/grokify/gotilla/blob/master/strconv/phonenumber/us-area-code-geo.csv
- areacode zipcode lat/lon: can use zipcode dataset areacode , lat/lon data mentioned benjamin dean. zipcodes useful because more dense areas have more zipcodes ensuring highly populated areas represented more.
- areacode locode lat/lon: un locodes have lat/lon information , can used. ideally each locode mapped population weighting purposes.
for quick solution, took areacodes , mapped each un locode dataset here:
once un locode available, lat/lon in locode dataset can used , distance can calculated. of note, cities not have lat/lon data ideal submit un locode project. right 1 primary city per areacode can enhanced have multiple cities. in ideal case, cities un locodes in , canada mapped areacodes (and zipcodes).
(3) making call clid
users should login own extensions user calls not conflict each other. app can set preferred clid using ringcentral webrtc sdk using fromnumber
parameter shown:
var session = webphone.useragent.invite('phone_number', { media: { render: { remote: document.getelementbyid('remotevideo'), local: document.getelementbyid('localvideo') } }, fromnumber: 'callerid_number', // optional, company number used default homecountryid: '1' // optional, value of }).then(...);
Comments
Post a Comment