Skip to content

Commit 1fba758

Browse files
author
Antonis
committed
Fixed #586: Check/implement what other CI/CD automation might be needed
1 parent 4662f5a commit 1fba758

File tree

7 files changed

+38
-68
lines changed

7 files changed

+38
-68
lines changed

Diff for: Examples/restcomm-helloworld/app/app.iml

+6-6
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,7 @@
9494
</content>
9595
<orderEntry type="jdk" jdkName="Android API 25 Platform" jdkType="Android SDK" />
9696
<orderEntry type="sourceFolder" forTests="false" />
97-
<orderEntry type="library" exported="" name="android-jain-sip-ri-1.2.293" level="project" />
98-
<orderEntry type="library" exported="" name="restcomm-android-sdk-1.0.1-BETA6-83" level="project" />
99-
<orderEntry type="library" exported="" name="core-1.54.0.0" level="project" />
100-
<orderEntry type="library" exported="" name="prov-1.54.0.0" level="project" />
101-
<orderEntry type="library" exported="" name="log4j-1.2.17" level="project" />
10297
<orderEntry type="library" exported="" name="support-v4-25.1.1" level="project" />
103-
<orderEntry type="library" exported="" name="pkix-1.54.0.0" level="project" />
10498
<orderEntry type="library" exported="" name="support-compat-25.1.1" level="project" />
10599
<orderEntry type="library" exported="" name="support-media-compat-25.1.1" level="project" />
106100
<orderEntry type="library" exported="" name="support-core-ui-25.1.1" level="project" />
@@ -111,5 +105,11 @@
111105
<orderEntry type="library" exported="" name="support-core-utils-25.1.1" level="project" />
112106
<orderEntry type="library" exported="" name="support-fragment-25.1.1" level="project" />
113107
<orderEntry type="library" exported="" name="animated-vector-drawable-25.1.1" level="project" />
108+
<orderEntry type="module" module-name="restcomm.android.sdk" exported="" />
109+
<orderEntry type="library" exported="" name="android-jain-sip-ri-1.2.293" level="project" />
110+
<orderEntry type="library" exported="" name="core-1.54.0.0" level="project" />
111+
<orderEntry type="library" exported="" name="prov-1.54.0.0" level="project" />
112+
<orderEntry type="library" exported="" name="log4j-1.2.17" level="project" />
113+
<orderEntry type="library" exported="" name="pkix-1.54.0.0" level="project" />
114114
</component>
115115
</module>

Diff for: Examples/restcomm-helloworld/app/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ repositories {
4040
dependencies {
4141
compile fileTree(dir: 'libs', include: ['*.jar'])
4242
//testCompile 'junit:junit:4.12'
43-
//compile project(':restcomm.android.sdk')
44-
compile 'org.restcomm:restcomm-android-sdk:1.0.1-BETA6-83'
43+
compile project(':restcomm.android.sdk')
44+
//compile 'org.restcomm:restcomm-android-sdk:1.0.1-BETA6-83'
4545
compile 'com.android.support:appcompat-v7:25.1.1'
4646
//compile 'com.android.support:design:24.2.0'
4747
//compile 'com.android.support:support-v4:24.2.0'

Diff for: Examples/restcomm-helloworld/app/src/main/java/com/telestax/restcomm_helloworld/MainActivity.java

+18-47
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
import org.restcomm.android.sdk.RCDevice;
5757
import org.restcomm.android.sdk.RCDeviceListener;
5858
import org.restcomm.android.sdk.RCPresenceEvent;
59+
import org.restcomm.android.sdk.util.RCException;
5960
//import org.webrtc.VideoRenderer;
6061
//import org.webrtc.VideoRendererGui;
6162
//import org.webrtc.VideoTrack;
@@ -178,8 +179,13 @@ public void onServiceConnected(ComponentName className, IBinder service)
178179
//params.put(RCDevice.ParameterKeys.SIGNALING_JAIN_SIP_LOGGING_ENABLED, prefs.getBoolean(RCDevice.ParameterKeys.SIGNALING_JAIN_SIP_LOGGING_ENABLED, true));
179180

180181
if (!device.isInitialized()) {
181-
device.initialize(getApplicationContext(), params, this);
182-
device.setLogLevel(Log.VERBOSE);
182+
try {
183+
device.initialize(getApplicationContext(), params, this);
184+
device.setLogLevel(Log.VERBOSE);
185+
}
186+
catch (RCException e) {
187+
Log.e(TAG, "RCDevice Initialization Error: " + e.errorText);
188+
}
183189
}
184190

185191
serviceBound = true;
@@ -258,47 +264,11 @@ public void onStartListening(RCDevice device, RCDeviceListener.RCConnectivitySta
258264

259265
}
260266

261-
public void onStopListening(RCDevice device)
262-
{
263-
264-
}
265-
266267
public void onStopListening(RCDevice device, int errorCode, String errorText)
267268
{
268269
Log.i(TAG, errorText);
269270
}
270271

271-
public boolean receivePresenceEvents(RCDevice device)
272-
{
273-
return false;
274-
}
275-
276-
public void onPresenceChanged(RCDevice device, RCPresenceEvent presenceEvent)
277-
{
278-
279-
}
280-
281-
public void onIncomingConnection(RCDevice device, RCConnection connection)
282-
{
283-
Log.i(TAG, "Connection arrived");
284-
this.pendingConnection = connection;
285-
}
286-
287-
public void onIncomingMessage(RCDevice device, String message, HashMap<String, String> parameters)
288-
{
289-
final HashMap<String, String> finalParameters = parameters;
290-
final String finalMessage = message;
291-
292-
runOnUiThread(new Runnable() {
293-
@Override
294-
public void run()
295-
{
296-
String newText = finalParameters.get("username") + ": " + finalMessage + "\n";
297-
Log.i(TAG, "Message arrived: " + newText);
298-
}
299-
});
300-
}
301-
302272
public void onConnectivityUpdate(RCDevice device, RCConnectivityStatus connectivityStatus)
303273
{
304274

@@ -360,7 +330,7 @@ public void onDigitSent(RCConnection connection, int statusCode, String statusTe
360330
{
361331
}
362332

363-
public void onMessageSent(RCDevice device, int statusCode, String statusText)
333+
public void onMessageSent(RCDevice device, int statusCode, String statusText, String jobId)
364334
{
365335
}
366336

@@ -372,18 +342,19 @@ public void onInitialized(RCDevice device, RCDeviceListener.RCConnectivityStatus
372342
{
373343
}
374344

375-
public void onInitializationError(int errorCode, String errorText)
376-
{
377-
}
378-
379345
// Resume call after permissions are checked
380346
private void resumeCall()
381347
{
382348
if (connectParams != null) {
383-
connection = device.connect(connectParams, this);
384-
if (connection == null) {
385-
Log.e(TAG, "Error: error connecting");
386-
return;
349+
try {
350+
connection = device.connect(connectParams, this);
351+
if (connection == null) {
352+
Log.e(TAG, "Error: error connecting");
353+
return;
354+
}
355+
}
356+
catch (RCException e) {
357+
Log.e(TAG, "Error: not connected" + e.errorText);
387358
}
388359
}
389360
}

Diff for: restcomm.android.sdk/src/main/java/org/restcomm/android/sdk/RCDevice.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ public RCConnection connect(HashMap<String, Object> parameters, RCConnectionList
683683
*
684684
* @param message Message text
685685
* @param parameters Parameters used for the message, such as 'username' that holds the recepient for the message
686-
* @return status for the send action
686+
* @return Job Id (string) of the the job created to asynchronously handle the transmission of the message, so that we can correlate the status when it arrives later
687687
*/
688688
public String sendMessage(String message, Map<String, String> parameters) throws RCException
689689
{

Diff for: restcomm.android.sdk/src/main/java/org/restcomm/android/sdk/RCDeviceListener.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ enum RCConnectivityStatus {
3434
}
3535

3636
/**
37-
* RCDevice initialized successfully. For regular scenarios (i.e. non-registrarless) this means that registration is successful.
38-
* For registrarless scenarios this means that RCDevice is initialized properly (with no registration)
37+
* RCDevice initialized either successfully or with error (check statusCode and statusText). For regular scenarios (i.e. non-registrarless) success
38+
* means that this means that registration is successful. For registrar-less scenarios success means that RCDevice is initialized properly (with no registration)
3939
*
4040
* @param device Device of interest
4141
* @param connectivityStatus Connectivity status

Diff for: scripts/main.bash

+9-8
Original file line numberDiff line numberDiff line change
@@ -75,35 +75,36 @@ else
7575
echo "-- Skipping Documentation Generation."
7676
fi
7777

78-
# Build SDK and publish to maven repo (trusted build)
79-
if [ "$CURRENT_BRANCH" == $RELEASE_BRANCH ] && [[ -z "$SKIP_SDK_PUBLISH_TO_MAVEN_REPO" || "$SKIP_SDK_PUBLISH_TO_MAVEN_REPO" == "false" ]]
78+
79+
# Build and upload Olympus to Test Fairy (strusted build only)
80+
if [ "$CURRENT_BRANCH" == $RELEASE_BRANCH ] && [[ -z "$SKIP_TF_UPLOAD" || "$SKIP_TF_UPLOAD" == "false" ]]
8081
then
8182
if [ -z $TRUSTED_BUILD ]
8283
then
8384
echo "Cannot generate doc in an untrusted build, skipping"
8485
else
85-
if ! ./scripts/publish-sdk.bash
86+
if ! ./scripts/upload-olympus-to-testfairy.bash
8687
then
8788
exit 1
8889
fi
8990
fi
9091
else
91-
echo "-- Skipping SDK publishing."
92+
echo "-- Skipping Test Fairy upload."
9293
fi
9394

94-
# Build and upload Olympus to Test Fairy
95-
if [ "$CURRENT_BRANCH" == $RELEASE_BRANCH ] && [[ -z "$SKIP_TF_UPLOAD" || "$SKIP_TF_UPLOAD" == "false" ]]
95+
# Build SDK and publish to maven repo (trusted build)
96+
if [ "$CURRENT_BRANCH" == $RELEASE_BRANCH ] && [[ -z "$SKIP_SDK_PUBLISH_TO_MAVEN_REPO" || "$SKIP_SDK_PUBLISH_TO_MAVEN_REPO" == "false" ]]
9697
then
9798
if [ -z $TRUSTED_BUILD ]
9899
then
99100
echo "Cannot generate doc in an untrusted build, skipping"
100101
else
101-
if ! ./scripts/upload-olympus-to-testfairy.bash
102+
if ! ./scripts/publish-sdk.bash
102103
then
103104
exit 1
104105
fi
105106
fi
106107
else
107-
echo "-- Skipping Test Fairy upload."
108+
echo "-- Skipping SDK publishing."
108109
fi
109110

Diff for: scripts/update-doc.bash

-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ echo "== Updating Reference Documentation"
1515
echo "== "
1616
echo
1717

18-
git status
19-
2018
if [ -z $GITHUB_OAUTH_TOKEN ]
2119
then
2220
echo "-- Error: GITHUB_OAUTH_TOKEN environment variable missing"

0 commit comments

Comments
 (0)