Skip to content

Commit 0d940ad

Browse files
committed
Merge branch 'master' into FS-56_change_rvd_context
2 parents 0add98c + 390e288 commit 0d940ad

File tree

167 files changed

+6336
-2454
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+6336
-2454
lines changed

restcomm/configuration/config-scripts/as7-config-scripts/restcomm/advanced.conf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ SSL_MODE='strict' #Values allowall=allow self-signed certificates, strict=don't
3232
#JVM Options used to RUN RC and RMS.
3333
#RestComm JAVA_OPTS
3434
#RC_JAVA_OPTS='-Xms1024m -Xmx4096m -Xmn512m -XX:+CMSIncrementalPacing -XX:CMSIncrementalDutyCycle=100 -XX:CMSIncrementalDutyCycleMin=100 -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:MaxPermSize=512m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dorg.jboss.server.bootstrap.maxThreads=1 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=../../restcomm_dumpfile-$(date +%b_%d_%Y_%H_%M_%S).bin'
35-
RC_JAVA_OPTS="-Xms1048m -Xmx4096m -XX:MaxPermSize=512m -XX:+UseG1GC -XX:ParallelGCThreads=8 -XX:ConcGCThreads=8 -XX:G1RSetUpdatingPauseTimePercent=10 -XX:+ParallelRefProcEnabled -XX:G1HeapRegionSize=4m -XX:G1HeapWastePercent=5 -XX:InitiatingHeapOccupancyPercent=85 -XX:+UnlockExperimentalVMOptions -XX:G1MixedGCLiveThresholdPercent=85 -XX:+AlwaysPreTouch -XX:+UseCompressedOops -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=../../restcomm_dumpfile-$(date +%b_%d_%Y_%H_%M_%S).bin"
35+
RC_JAVA_OPTS="-Xms1048m -Xmx4096m -XX:MaxPermSize=512m -XX:+UseG1GC -XX:ParallelGCThreads=8 -XX:ConcGCThreads=8 -XX:G1RSetUpdatingPauseTimePercent=10 -XX:+ParallelRefProcEnabled -XX:G1HeapRegionSize=4m -XX:G1HeapWastePercent=5 -XX:InitiatingHeapOccupancyPercent=85 -XX:+UnlockExperimentalVMOptions -XX:G1MixedGCLiveThresholdPercent=85 -XX:+AlwaysPreTouch -XX:+UseCompressedOops -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=../../restcomm_dumpfile-$(date +%b_%d_%Y_%H_%M_%S).bin -Dtelscale.license.dir=../ -Dtelscale.license.key.location=../"
3636
#Additional Connectors
3737
#Add extra connectors if needed. Need to use the following rule:
3838
#ADDITIONAL_CONNECTOR_X=CONNECTOR_NAME:PORT
@@ -146,6 +146,8 @@ USSDGATEWAYUSER=''
146146
USSDGATEWAYPASSWORD=''
147147
#Used to set HTTP Response timeout for RC to download the RCML.
148148
HTTP_RESPONSE_TIMEOUT=6000
149+
#Maximum P2P call length configuration. Unit is munite
150+
MAX_P2P_CALL_LENGTH=60
149151

150152
# If set to true RestComm will NOT use cache for *.wav files playback.If set to false RestComm will use cache for *.wav files playback.
151153
CACHE_NO_WAV=false

restcomm/configuration/config-scripts/as7-config-scripts/restcomm/autoconfig.d/config-restcomm.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,13 +608,11 @@ configRestCommURIs() {
608608

609609
sed -i "s|<prompts-uri>.*</prompts-uri>|<prompts-uri>$REMOTE_ADDRESS/restcomm/audio<\/prompts-uri>|" $FILE
610610
sed -i "s|<cache-uri>.*</cache-uri>|<cache-uri>$REMOTE_ADDRESS/restcomm/cache</cache-uri>|" $FILE
611-
sed -i "s|<cache-path>.*</cache-path>|<cache-path>$CACHE_PATH</cache-path>|" $FILE
612611
sed -i "s|<error-dictionary-uri>.*</error-dictionary-uri>|<error-dictionary-uri>$REMOTE_ADDRESS/restcomm/errors</error-dictionary-uri>|" $FILE
613612

614613
#Equivalent changes in case XML tags are empty after empty values
615614
sed -i "s|<prompts-uri/>|<prompts-uri>$REMOTE_ADDRESS/restcomm/audio<\/prompts-uri>|" $FILE
616615
sed -i "s|<cache-uri/>|<cache-uri>$REMOTE_ADDRESS/restcomm/cache</cache-uri>|" $FILE
617-
sed -i "s|<cache-path/>|<cache-path>$CACHE_PATH</cache-path>|" $FILE
618616
sed -i "s|<error-dictionary-uri/>|<error-dictionary-uri>$REMOTE_ADDRESS/restcomm/errors</error-dictionary-uri>|" $FILE
619617

620618
echo "Updated prompts-uri cache-uri error-dictionary-uri External MSaddress for "
@@ -710,6 +708,11 @@ otherRestCommConf(){
710708

711709
echo "CACHE_NO_WAV $CACHE_NO_WAV"
712710
sed -i "s|<cache-no-wav>.*</cache-no-wav>|<cache-no-wav>${CACHE_NO_WAV}</cache-no-wav>|" $FILE
711+
712+
echo "CACHE_PATH $CACHE_PATH"
713+
sed -i "s|<cache-path>.*</cache-path>|<cache-path>$CACHE_PATH</cache-path>|" $FILE
714+
sed -i "s|<cache-path/>|<cache-path>$CACHE_PATH</cache-path>|" $FILE
715+
713716

714717
#Configure USESBC
715718
echo "USESBC: $RCUSESBC"
@@ -861,6 +864,11 @@ configConferenceTimeout(){
861864
xmlstarlet ed --inplace -u "/restcomm/runtime-settings/conference-timeout" -v "$CONFERENCE_TIMEOUT" $FILE
862865
}
863866

867+
configMaxP2PCallLength(){
868+
echo "Configure Max P2P Call Length $MAX_P2P_CALL_LENGTH"
869+
xmlstarlet ed --inplace -u "/restcomm/runtime-settings/max-p2p-call-length" -v "$MAX_P2P_CALL_LENGTH" $FILE
870+
}
871+
864872
configSdrService(){
865873
xmlstarlet ed --inplace -d "/restcomm/runtime-settings/sdr-service" $FILE
866874
if [ -n "$SDR_SERVICE_CLASS" ]; then
@@ -924,5 +932,6 @@ configRMSNetworking
924932
configAsrDriver
925933
configDnsProvisioningManager
926934
configConferenceTimeout
935+
configMaxP2PCallLength
927936
configSdrService
928937
echo 'Configured RestComm!'

restcomm/configuration/config-scripts/as7-config-scripts/restcomm/gsed_macos.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
## Description: Change 'sed' to 'gsed' for MacOS users in order for the autoconfig scripts to work properly
33
## Prerequisites: Install gnu-sed using homebrew (brew install gnu-sed)
44
## Author: George Vagenas
5-
gsed -i 's/sed/gsed/g' ./*.sh
6-
gsed -i 's/sed/gsed/g' ./autoconfig.d/*.sh
5+
gsed -i 's/\bsed\b/gsed/g' ./*.sh
6+
gsed -i 's/\bsed\b/gsed/g' ./autoconfig.d/*.sh

restcomm/restcomm.application/src/main/java/org/restcomm/connect/application/Bootstrapper.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import org.restcomm.connect.commons.loader.ObjectFactory;
3838
import org.restcomm.connect.commons.loader.ObjectInstantiationException;
3939
import org.restcomm.connect.commons.util.DNSUtils;
40+
import org.restcomm.connect.core.service.RestcommConnectServiceProvider;
4041
import org.restcomm.connect.dao.DaoManager;
4142
import org.restcomm.connect.dao.entities.InstanceId;
4243
import org.restcomm.connect.dao.entities.Organization;
@@ -233,10 +234,10 @@ private String home(final ServletContext context) {
233234
}
234235
}
235236

236-
private DaoManager storage(final Configuration configuration, Configuration daoManagerConfiguration, S3AccessTool s3AccessTool, final ClassLoader loader, final ExecutionContext ec) throws ObjectInstantiationException {
237+
private DaoManager storage(final Configuration configuration, Configuration daoManagerConfiguration, final ClassLoader loader) throws ObjectInstantiationException {
237238
final String classpath = daoManagerConfiguration.getString("dao-manager[@class]");
238239
final DaoManager daoManager = (DaoManager) new ObjectFactory(loader).getObjectInstance(classpath);
239-
daoManager.configure(configuration, daoManagerConfiguration, s3AccessTool, ec);
240+
daoManager.configure(configuration, daoManagerConfiguration);
240241
daoManager.start();
241242
return daoManager;
242243
}
@@ -409,14 +410,15 @@ public void servletInitialized(SipServletContextEvent event) {
409410
// Share the actor system with other servlets.
410411
context.setAttribute(ActorSystem.class.getName(), system);
411412
ec = system.dispatchers().lookup("restcomm-blocking-dispatcher");
413+
context.setAttribute(ExecutionContext.class.getName(), ec);
412414

413415
S3AccessTool s3AccessTool = prepareS3AccessTool(xml);
414416
context.setAttribute(S3AccessTool.class.getName(), s3AccessTool);
415417

416418
// Create the storage system.
417419
DaoManager storage = null;
418420
try {
419-
storage = storage(xml, daoManagerConf, s3AccessTool, loader, ec);
421+
storage = storage(xml, daoManagerConf, loader);
420422
} catch (final ObjectInstantiationException exception) {
421423
logger.error("ObjectInstantiationException during initialization: ", exception);
422424
}

restcomm/restcomm.application/src/main/webapp/WEB-INF/conf/restcomm.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,9 @@
266266
or send appropriate response according to the response from outbound dial-->
267267
<!-- https://github.com/RestComm/Restcomm-Connect/issues/1649 -->
268268
<enable-200-ok-delay>false</enable-200-ok-delay>
269+
270+
<!-- Maximum P2P call length within RestComm, unit is minute -->
271+
<max-p2p-call-length>60</max-p2p-call-length>
269272

270273
<push-notification-server-enabled>false</push-notification-server-enabled>
271274
<!-- Path to Restcomm Push Notification Server (Notification API) -->

restcomm/restcomm.application/src/main/webapp/WEB-INF/scripts/mariadb/sql/call-detail-records.xml

Lines changed: 65 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,75 @@
114114
<if test="startTime != null">
115115
AND start_time &gt;= #{startTime}
116116
</if>
117-
118117
<if test="endTime != null">
119118
AND end_time &lt;= DATE_ADD(#{endTime},INTERVAL 1 DAY)
120119
</if>
120+
<choose>
121+
<when test="sortByDate != null">
122+
<if test="sortByDate.name() == 'ASCENDING'">
123+
order by date_created ASC
124+
</if>
125+
<if test="sortByDate.name() == 'DESCENDING'">
126+
order by date_created DESC
127+
</if>
128+
</when>
129+
<when test="sortByFrom != null">
130+
<if test="sortByFrom.name() == 'ASCENDING'">
131+
order by sender ASC
132+
</if>
133+
<if test="sortByFrom.name() == 'DESCENDING'">
134+
order by sender DESC
135+
</if>
136+
</when>
137+
138+
<when test="sortByTo != null">
139+
<if test="sortByTo.name() == 'ASCENDING'">
140+
order by recipient ASC
141+
</if>
142+
<if test="sortByTo.name() == 'DESCENDING'">
143+
order by recipient DESC
144+
</if>
145+
</when>
146+
<when test="sortByDirection != null">
147+
<if test="sortByDirection.name() == 'ASCENDING'">
148+
order by direction ASC
149+
</if>
150+
<if test="sortByDirection.name() == 'DESCENDING'">
151+
order by direction DESC
152+
</if>
153+
</when>
154+
<when test="sortByStatus != null">
155+
<if test="sortByStatus.name() == 'ASCENDING'">
156+
order by status ASC
157+
</if>
158+
<if test="sortByStatus.name() == 'DESCENDING'">
159+
order by status DESC
160+
</if>
161+
</when>
162+
<when test="sortByDuration != null">
163+
<if test="sortByDuration.name() == 'ASCENDING'">
164+
order by duration ASC
165+
</if>
166+
<if test="sortByDuration.name() == 'DESCENDING'">
167+
order by duration DESC
168+
</if>
169+
</when>
170+
<when test="sortByPrice != null">
171+
<if test="sortByPrice.name() == 'ASCENDING'">
172+
order by cast(price as unsigned) ASC
173+
</if>
174+
<if test="sortByPrice.name() == 'DESCENDING'">
175+
order by cast(price as unsigned) DESC
176+
</if>
177+
</when>
121178

122-
order by start_time
123-
LIMIT #{limit} OFFSET #{offset}
179+
<otherwise>
180+
order by date_created DESC
181+
</otherwise>
182+
</choose>
183+
<if test="limit != null">
184+
LIMIT #{limit} OFFSET #{offset}
185+
</if>
124186
</select>
125187

126188
<!-- Issue 1215: https://github.com/RestComm/Restcomm-Connect/issues/1215 -->

restcomm/restcomm.application/src/main/webapp/WEB-INF/scripts/mariadb/sql/incoming-phone-numbers.xml

Lines changed: 50 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,26 @@
4848
AND pure_sip = #{pureSIP}
4949
</if>
5050
<choose>
51-
<when test="sortBy == 'phone_number'">
52-
order by phone_number ${sortDirection}
51+
<when test="sortByNumber != null and sortByNumber.name() != 'NONE'">
52+
<if test="sortByNumber.name() == 'ASCENDING'">
53+
order by phone_number ASC
54+
</if>
55+
<if test="sortByNumber.name() == 'DESCENDING'">
56+
order by phone_number DESC
57+
</if>
5358
</when>
54-
<when test="sortBy == 'friendly_name'">
55-
order by friendly_name ${sortDirection}
59+
<when test="sortByFriendly != null and sortByFriendly.name() != 'NONE'">
60+
<if test="sortByFriendly.name() == 'ASCENDING'">
61+
order by friendly_name ASC
62+
</if>
63+
<if test="sortByFriendly.name() == 'DESCENDING'">
64+
order by friendly_name DESC
65+
</if>
5666
</when>
5767
<otherwise>
58-
order by phone_number ${sortDirection}
68+
order by phone_number
5969
</otherwise>
60-
</choose>
70+
</choose>
6171
<if test="limit != null">
6272
LIMIT #{limit} OFFSET #{offset}
6373
</if>
@@ -94,17 +104,27 @@
94104
<if test="pureSIP != null">
95105
AND n.pure_sip = #{pureSIP}
96106
</if>
97-
<choose>
98-
<when test="sortBy == 'phone_number'">
99-
order by n.phone_number ${sortDirection}
107+
<choose>
108+
<when test="sortByNumber != null and sortByNumber.name() != 'NONE'">
109+
<if test="sortByNumber.name() == 'ASCENDING'">
110+
order by n.phone_number ASC
111+
</if>
112+
<if test="sortByNumber.name() == 'DESCENDING'">
113+
order by n.phone_number DESC
114+
</if>
100115
</when>
101-
<when test="sortBy == 'friendly_name'">
102-
order by n.friendly_name ${sortDirection}
116+
<when test="sortByFriendly != null and sortByFriendly.name() != 'NONE'">
117+
<if test="sortByFriendly.name() == 'ASCENDING'">
118+
order by n.friendly_name ASC
119+
</if>
120+
<if test="sortByFriendly.name() == 'DESCENDING'">
121+
order by n.friendly_name DESC
122+
</if>
103123
</when>
104124
<otherwise>
105-
order by n.phone_number ${sortDirection}
125+
order by n.phone_number
106126
</otherwise>
107-
</choose>
127+
</choose>
108128
<if test="limit != null">
109129
LIMIT #{limit} OFFSET #{offset}
110130
</if>
@@ -138,17 +158,27 @@
138158
<if test="pureSIP != null">
139159
AND n.pure_sip = #{pureSIP}
140160
</if>
141-
<choose>
142-
<when test="sortBy == 'phone_number'">
143-
order by n.phone_number ${sortDirection}
161+
<choose>
162+
<when test="sortByNumber != null and sortByNumber.name() != 'NONE'">
163+
<if test="sortByNumber.name() == 'ASCENDING'">
164+
order by n.phone_number ASC
165+
</if>
166+
<if test="sortByNumber.name() == 'DESCENDING'">
167+
order by n.phone_number DESC
168+
</if>
144169
</when>
145-
<when test="sortBy == 'friendly_name'">
146-
order by n.friendly_name ${sortDirection}
170+
<when test="sortByFriendly != null and sortByFriendly.name() != 'NONE'">
171+
<if test="sortByFriendly.name() == 'ASCENDING'">
172+
order by n.friendly_name ASC
173+
</if>
174+
<if test="sortByFriendly.name() == 'DESCENDING'">
175+
order by n.friendly_name DESC
176+
</if>
147177
</when>
148178
<otherwise>
149-
order by n.phone_number ${sortDirection}
179+
order by n.phone_number
150180
</otherwise>
151-
</choose>
181+
</choose>
152182
<if test="limit != null">
153183
LIMIT #{limit} OFFSET #{offset}
154184
</if>

restcomm/restcomm.application/src/main/webapp/WEB-INF/scripts/mariadb/sql/sms-messages.xml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
-->
66
<mapper namespace="org.mobicents.servlet.sip.restcomm.dao.SmsMessagesDao">
77
<insert id="addSmsMessage" parameterType="map">
8-
INSERT INTO restcomm_sms_messages (sid, date_created, date_updated, date_sent, account_sid, sender, recipient, body, status, direction,
9-
price, api_version, uri, status_callback, status_callback_method) VALUES (#{sid}, #{date_created}, #{date_updated}, #{date_sent}, #{account_sid}, #{sender}, #{recipient}, #{body},
10-
#{status}, #{direction}, #{price}, #{api_version}, #{uri}, #{status_callback)},
11-
#{status_callback_method)});
8+
INSERT INTO restcomm_sms_messages (sid, date_created, date_updated, date_sent,
9+
account_sid, sender, recipient, body, status, direction,
10+
price, api_version, uri, status_callback, status_callback_method) VALUES (#{sid},
11+
#{date_created}, #{date_updated}, #{date_sent}, #{account_sid}, #{sender}, #{recipient}, #{body},
12+
#{status}, #{direction}, #{price}, #{api_version}, #{uri}, #{status_callback},
13+
#{status_callback_method});
1214
</insert>
1315

1416
<select id="getSmsMessage" parameterType="string" resultType="hashmap">

0 commit comments

Comments
 (0)