Skip to content

Commit

Permalink
- fixed issue with "User Not Found" releaseCause seen in the ccxml
Browse files Browse the repository at this point in the history
received from broadsoft when user is out of network area.
- issue #16 closed.
  • Loading branch information
shravanjc committed Oct 25, 2013
1 parent f16a762 commit 74c0439
Show file tree
Hide file tree
Showing 8 changed files with 399 additions and 195 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public HashMap<String, String> outboundCallWithMap( @Name( "addressMap" ) Map<St
AdapterConfig config = AdapterConfig.findAdapterConfigFromList( adapterID, adapterType, adapterList );
if ( config != null )
{
log.info( "Config found: " + config.getConfigId() );
log.info( String.format( "Config found: %s of Type: %s", config.getConfigId(), config.getAdapterType() ) );
adapterType = config.getAdapterType();
if ( adapterType.toUpperCase().equals( "XMPP" ) )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ protected int broadcastMessage( String message, String subject, String from, Str
if(senderName!=null)
{
msg.setFrom( new InternetAddress( from, senderName ) );
//add the senderName to the reply list if its an emailId
if ( senderName.contains( "@" ) )
{
Address[] addresses = new InternetAddress[1];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ abstract public class TextServlet extends HttpServlet {
protected static final Logger log = Logger.getLogger(TextServlet.class.getSimpleName());
protected static final int LOOP_DETECTION=10;
protected static final String DEMODIALOG = "/charlotte/";
protected String sessionKey = null;

/**
* @deprecated use {@link TextServlet#broadcastMessage(String,String,String,
Expand Down Expand Up @@ -118,7 +119,7 @@ public Return formQuestion(Question question, String adapterID,String address) {
reply = reply.substring(0, reply.length() - 1) + " ]";
break; //Jump from forloop
} else if (question.getType().equalsIgnoreCase("comment")) {
question = question.answer(null, adapterID, null, null);//Always returns null! So no need, but maybe in future?
question = question.answer(null, adapterID, null, null, null);//Always returns null! So no need, but maybe in future?
} else if (question.getType().equalsIgnoreCase("referral")) {
question = Question.fromURL(question.getUrl(), adapterID ,address);
} else {
Expand All @@ -137,7 +138,7 @@ public String startDialog(String address, String url, AdapterConfig config) thro
address = formatNumber(address);
}
String localaddress = config.getMyAddress();
String sessionKey =getAdapterType()+"|"+localaddress+"|"+address;
sessionKey =getAdapterType()+"|"+localaddress+"|"+address;
Session session = Session.getSession(sessionKey, config.getKeyword());
if (session == null){
log.severe("XMPPServlet couldn't start new outbound Dialog, adapterConfig not found? "+sessionKey);
Expand Down Expand Up @@ -418,7 +419,8 @@ protected int processMessage(TextMessage msg) throws Exception
question.setPreferred_language(preferred_language);
// Do not answer a question, when it's the first and the type is comment or referral anyway.
if(!(start && (question.getType().equalsIgnoreCase("comment") || question.getType().equalsIgnoreCase("referral")))) {
question = question.answer(address, config.getConfigId(), null, escapeInput.body);
question = question.answer( address, config.getConfigId(), null, escapeInput.body,
Question.getRetryCount( sessionKey ) );
}
Return replystr = formQuestion(question, config.getConfigId(),address);
escapeInput.reply = replystr.reply;
Expand Down
Loading

0 comments on commit 74c0439

Please sign in to comment.