Permalink
Browse files

WHISTLE-1388: cache the port in/out param so lookup_number returns a …

…4-tuple when a local number is dialed
  • Loading branch information...
1 parent 3f52ed9 commit 49c2176855eddf1de263b3929864d13fa71b2cd2 @jamesaimonetti jamesaimonetti committed Jul 17, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 whistle_apps/apps/stepswitch/src/stepswitch_util.erl
View
6 whistle_apps/apps/stepswitch/src/stepswitch_util.erl
@@ -23,11 +23,11 @@
lookup_number(Number) ->
Num = wnm_util:normalize_number(Number),
case wh_cache:fetch_local(?STEPSWITCH_CACHE, cache_key_number(Number)) of
- {ok, {AccountId, ForceOut}} -> {ok, AccountId, ForceOut};
+ {ok, {AccountId, ForceOut, Ported}} -> {ok, AccountId, ForceOut, Ported};
{error, not_found} ->
case wh_number_manager:lookup_account_by_number(Num) of
- {ok, AccountId, ForceOut, _}=Ok ->
- wh_cache:store_local(?STEPSWITCH_CACHE, cache_key_number(Number), {AccountId, ForceOut}),
+ {ok, AccountId, ForceOut, Ported}=Ok ->
+ wh_cache:store_local(?STEPSWITCH_CACHE, cache_key_number(Number), {AccountId, ForceOut, Ported}),
lager:debug("~s is associated with account ~s", [Num, AccountId]),
Ok;
{error, Reason}=E ->

0 comments on commit 49c2176

Please sign in to comment.