-
barney_
is anybody using any of the knm_carriers to acquire numbers ?
-
barney_
mc_? ^
-
barney_
Trying to acquire a number, but I can't see that anything calls ?CARRIER:acquire_number
-
mc_
barney_: i think there's a sys config for number_manager for default carrier module
-
mc_
and the phone_numbers API
-
mc_
we use knm_bandwidth2 i think?
-
barney_
I am using knm_simwood - searching for numbers works
-
barney_
but when I try and activate via cb.. it seems to search the numbers db and returns bad identifyrer the number could not be found
-
barney_
knm_search:433(<0.5271.140>) error requesting number from amqp: timeout
-
barney_
should there be something listening for this published amqp ?
-
barney_
-
barney_
"once searched for" seems to lead me to think that something is supposed to cache a previous search?
-
mc_
barney_: could be, i haven't worked in there for a while so rusty on particulars
-
mc_
but compare simwood to bw2 modules to see if they search/acquire diff
-
barney_
ok will do thanks mc_
-
barney_
cb_phone_numbers is add a sodding + to the number so it's not matching the ETS table :S
-
mc_
barney_: in general kazoo likes to deal with E164 internally, and convert to expected formats before sending numbers out of kazoo
-
barney_
E164 (without the +) I assume
-
barney_
/v2/accounts/{$account_id}/phone_numbers/{$ddi}/activate
-
mc_
with the +, so "4158867900" would be converted to "+1415867900" for internal handling
-
barney_
DDI is 44XXXXXXXXXX
-
mc_
yeah, presumably that would become +44...
-
barney_
ok.. so you'd expect the ETS table key to be +44
-
mc_
yeah, the numbers dbs are the first 5 chars, so "+44\\d{3}"
-
mc_
then knm_simwood would convert to whatever simwood API expects the format
-
barney_
Num = list_to_binary([kz_json:get_binary_value(<<"country_code">>, JObj)
-
barney_
,kz_json:get_binary_value(<<"number">>, JObj)
-
barney_
]),
-
barney_
so that's the issue... (country_code) is just 44
-
mc_
look at using `knm_converters:normalize(Num)`
-
barney_
simwood returns <<"44">>, <<"1444XXXXXX">>
-
barney_
ok thanks
-
mc_
should build it back to +441444...
-
barney_
mv_
-
barney_
response_jobj_to_number(JObj, QID) ->
-
barney_
Num = list_to_binary([kz_json:get_binary_value(<<"country_code">>, JObj)
-
barney_
,kz_json:get_binary_value(<<"number">>, JObj)
-
barney_
]),
-
barney_
Num2 = knm_converters:normalize(Num),
-
barney_
{QID, {Num2, ?MODULE, ?NUMBER_STATE_DISCOVERY, JObj}}.
-
barney_
Works like a dream! thanks :)