Skip to content

Commit

Permalink
KAZOO-2215:fixed this thing
Browse files Browse the repository at this point in the history
  • Loading branch information
jeai2600hz committed Mar 21, 2014
1 parent 04d6a30 commit 5038188
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions applications/stepswitch/src/stepswitch_cnam.erl
Expand Up @@ -221,7 +221,7 @@ fetch_cnam(Number, JObj) ->
CNAM.

make_request(Number, JObj) ->
Url = get_http_url(JObj),
Url = wh_util:to_list(get_http_url(JObj)),
Body = get_http_body(JObj),
Method = get_http_method(),
Headers = get_http_headers(),
Expand All @@ -244,11 +244,10 @@ get_http_url(JObj) ->
case binary:match(Template, <<"opencnam">>) of
'nomatch' ->
{'ok', Url} = render(JObj, Template),
lists:flatten(Url);
wh_util:to_binary(lists:flatten(Url));
_Else ->
{'ok', UrlIOList} = render(JObj, Template),
Url = iolist_to_binary(UrlIOList),
case mochiweb_util:urlsplit(wh_util:to_list(Url)) of
{'ok', Url} = render(JObj, Template),
case mochiweb_util:urlsplit(wh_util:to_list(iolist_to_binary(Url))) of
{_Scheme, _Host, _Path, "", _Segment} ->
lists:flatten([Url, "?ref=2600hz&format=pbx"]);
{Scheme, Host, Path, QS, Segment} ->
Expand Down

0 comments on commit 5038188

Please sign in to comment.