Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
add-numbers-and-add-to-campaign
@client = Client.where(name: /vascon/i).first
params = {city: "Delhi", phones: ["918879081322","918879081536","918879081716","918879081072","918879081754","918879081837","918879081905","918879081953","918879070028","918879068439","918879065871","918879065925","918879066016","918879066021","918879066185","918879066190","918879066295","918879066497","918879066782","918879066801","918879066802","918879067087","918879067149","918879067394","918879067435","918879067519","918879067630","918879068133","918879068345","918879068682","918879068847","918879068961","918879067273","918879082432","917414968481","918879082694","918879082707","918879082779","918879083402","918879083729","918879084067","918767679006","918767767181","918879084391","918879082494","917414967179","918879084110","917414967191","917414967307","918879084436","917414967309","917414967360","917414967388","917414967504","917414967526","917414967571","917414967653","917414967776","917414967808","918879082198","917414967817","917414967982","918879084117","918879084297","918879084144","917414967985","917414969522","917414968075","917414968132","917414968214","917414968256","917414968414","918767677679","918767577547","918767576426","918767767754","918080285009","918767383166","919699597664","917303538749","918767320188","918767147443","918767423902","918767481678","918767575970","918767625864","918767628300","918767674958","918767759380","918767831696","917414969280","917414969486","917414969344","918448980470","918448980471","918448980472","918530478133","918530477807","918448980475","918530477602","918448980477","918448980478","918448980479","917827978279","919205511772","919024200200","917828600600","918448980500","918448980555","918448980560","918448980481","918448980482","918448980483","918448980484","918448980485","918448980486","918530478023","918448980487","918448980489","918448980490","918448980491","918448980492","918448980493","918448980494","918448980496","918448980498","918448980499","918448980501","918448980502","918448980503","918448980504","918448980505","918448980506","918448980507","918448980508","918448980509","918448980510","918448980511","918448980512","918448980513","918448980514","918448980515","918448980516","918448980517","918448980518","918448980519","918448980520","918448980521","918448980522","918448980523","918448980524","918448980525","918448980526","918448980527","918448980528","918448980529","918448980530","918448980531","918448980532","918448980533","918448980534","918448980535","918448980536","918448980537","918448980538","918448980539","918448980540","918448980541","918448980542","918448980543","918448980544","918448980545","918448980546","918448980547","918448980548","918448980549","918448980550","918448980551","918448980552","918448980553","918448980554","918448980556","918448980557","918448980558","918448980559","918448980561","918448980562","918448980563","918448980564","918448980565","918448980566","918448980567","918448980568","918448980569","918448980570","918448980571","918448980572","918448980573","918448980574","918448980575","918448980576","918448980577","918448980578","918448980579","918448980580","918448980581","918448980582","918448980583","918448980584","918448980585","918448980586","918448980587","918448980588","918448980589","918448980590","918448980645","918448980591","918448980592","918448980593","918448980594","918448980595","918448980596","918448980597","918448980598","918448980599","918448980600","918448980601","918448980602","918448980603","918448980604","918448980605","918448980606","918448980607","918448980608","918448980609","918448980610","918448980611","918448980612","918448980613","918448980614","918448980615","918448980616","918448980617","918448980618","918448980619","918448980620","918448980621","918448980622","918448980623","918448980624","918448980625","918448980626","918448980627","918448980628","918448980629","918448980630","918448980631","918448980632","918448980633","918448980634","918448980635","918448980636","918448980637","918448980638","918448980639","918448980640","918448980641","918448980642","918448980643","918448980644","919167025958","917414969085","917414968921","917414968482","917414968728","917414968871","918879081168","918448980495","912230147396","918048130500","918048130505","918048130689","918048130837","918861189745","918861204357","918048132979","918048132980","918048132981","918048132982"]}.with_indifferent_access
city = params[:city]
numbers = params[:phones]
data = []
data=numbers.collect do |num|
num.strip!
vnum = @client.virtual_numbers.new(phone: num, city: city, is_premium: false, premium_category: "", billable: false, price: 0.to_f)
vnum.provider = 'VirtualNumberManager::KnowlarityNumber'
vnum.force_save = true
if(vnum.save)
{ph: num, id: vnum.id, city: city, success: true}
else
{ph: num, id: nil, city: city, success: false}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.