Skip to content
This repository has been archived by the owner on Nov 26, 2020. It is now read-only.

Commit

Permalink
dial first implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
dkgupta2501 committed May 9, 2018
1 parent b873997 commit 1a4fc5f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Call<ServerResponse> post(
@Field("method") String method,
@Field("pilot_number") String pilot_number,
@Field("caller") String caller,
@Field("receiver") String receiver
@Field("receiver") String receiver,
@Field("dial_first") String dial_first
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class Mobtexting {
private Retrofit retrofit;
private Context context;
private String api_key;
private String dialFirst;

/**
* @param context
Expand All @@ -33,6 +34,14 @@ public Mobtexting(Context context) {
this.context = context;
}

public String getDialFirst() {
return dialFirst;
}

public void setDialFirst(String dialFirst) {
this.dialFirst = dialFirst;
}

/**
* click to call
* @param pilot_number
Expand Down Expand Up @@ -63,7 +72,17 @@ public void clickToCall(String pilot_number,String caller,String receiver,final

Interface service = retrofit.create(Interface.class);

Call<ServerResponse> call = service.post(api_key, "click2call", pilot_number, caller,receiver);
if(dialFirst!=null&&!dialFirst.equals("")){
if(dialFirst.equals("agent")){
dialFirst="agent";
}else{
dialFirst="customer";
}
}else{
dialFirst="customer";
}

Call<ServerResponse> call = service.post(api_key, "click2call", pilot_number, caller,receiver,dialFirst);

call.enqueue(new Callback<ServerResponse>() {
@Override
Expand Down

0 comments on commit 1a4fc5f

Please sign in to comment.