@@ -39,6 +39,7 @@ abstract public class TextServlet extends HttpServlet {
39
39
protected static final Logger log = Logger .getLogger (TextServlet .class .getSimpleName ());
40
40
protected static final int LOOP_DETECTION =10 ;
41
41
protected static final String DEMODIALOG = "/charlotte/" ;
42
+ protected String sessionKey = null ;
42
43
43
44
/**
44
45
* @deprecated use {@link TextServlet#broadcastMessage(String,String,String,
@@ -118,7 +119,7 @@ public Return formQuestion(Question question, String adapterID,String address) {
118
119
reply = reply .substring (0 , reply .length () - 1 ) + " ]" ;
119
120
break ; //Jump from forloop
120
121
} else if (question .getType ().equalsIgnoreCase ("comment" )) {
121
- question = question .answer (null , adapterID , null , null );//Always returns null! So no need, but maybe in future?
122
+ question = question .answer (null , adapterID , null , null , null );//Always returns null! So no need, but maybe in future?
122
123
} else if (question .getType ().equalsIgnoreCase ("referral" )) {
123
124
question = Question .fromURL (question .getUrl (), adapterID ,address );
124
125
} else {
@@ -137,7 +138,7 @@ public String startDialog(String address, String url, AdapterConfig config) thro
137
138
address = formatNumber (address );
138
139
}
139
140
String localaddress = config .getMyAddress ();
140
- String sessionKey =getAdapterType ()+"|" +localaddress +"|" +address ;
141
+ sessionKey =getAdapterType ()+"|" +localaddress +"|" +address ;
141
142
Session session = Session .getSession (sessionKey , config .getKeyword ());
142
143
if (session == null ){
143
144
log .severe ("XMPPServlet couldn't start new outbound Dialog, adapterConfig not found? " +sessionKey );
@@ -418,7 +419,8 @@ protected int processMessage(TextMessage msg) throws Exception
418
419
question .setPreferred_language (preferred_language );
419
420
// Do not answer a question, when it's the first and the type is comment or referral anyway.
420
421
if (!(start && (question .getType ().equalsIgnoreCase ("comment" ) || question .getType ().equalsIgnoreCase ("referral" )))) {
421
- question = question .answer (address , config .getConfigId (), null , escapeInput .body );
422
+ question = question .answer ( address , config .getConfigId (), null , escapeInput .body ,
423
+ Question .getRetryCount ( sessionKey ) );
422
424
}
423
425
Return replystr = formQuestion (question , config .getConfigId (),address );
424
426
escapeInput .reply = replystr .reply ;
0 commit comments