Skip to content

Commit 396eff9

Browse files
committed
Merge branch 'master' into restcomm-1861-sl
2 parents 1e65dca + 81e1a23 commit 396eff9

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

  • restcomm

restcomm/restcomm.http/src/main/java/org/restcomm/connect/http/CallsEndpoint.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ protected Response putCall(final String accountSid, final MultivaluedMap<String,
367367

368368
String customHeaders = getCustomHeaders(to);
369369

370-
if (customHeaders != null && !to.contains("@")) {
370+
if (customHeaders != null) {
371371
to = (customHeaders != null) ? to.substring(0, to.indexOf("?")) : to;
372372
data.remove(to);
373373
data.putSingle("To", to);
@@ -403,7 +403,7 @@ protected Response putCall(final String accountSid, final MultivaluedMap<String,
403403
try {
404404
if (to.contains("@")) {
405405
create = new CreateCall(from, to, username, password, true, timeout, CreateCallType.SIP,
406-
accountId, null, statusCallback, statusCallbackMethod, statusCallbackEvent, null);
406+
accountId, null, statusCallback, statusCallbackMethod, statusCallbackEvent, customHeaders);
407407
} else if (to.startsWith("client")) {
408408
create = new CreateCall(from, to, username, password, true, timeout, CreateCallType.CLIENT,
409409
accountId, null, statusCallback, statusCallbackMethod, statusCallbackEvent, customHeaders);

restcomm/restcomm.telephony.api/src/main/java/org/restcomm/connect/telephony/api/CreateCall.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,15 @@ public CreateCall(final String from, final String to, final String username, fin
6565
statusCallbackEvent, "", null, new MediaAttributes(), null);
6666
}
6767

68+
//Used to create CreateCall objects (CallsEndpoint, UssdPushEndpoint, VI)
69+
public CreateCall(final String from, final String to, final String username, final String password,
70+
final boolean isFromApi, final int timeout, final CreateCallType type, final Sid accountId, final Sid parentCallSid,
71+
final URI statusCallbackUrl, final String statusCallbackMethod, final List<String> statusCallbackEvent, final String customHeaders) {
72+
this(from, to, username, password, isFromApi, timeout, type, accountId, parentCallSid, statusCallbackUrl, statusCallbackMethod,
73+
statusCallbackEvent, "", null, new MediaAttributes(), customHeaders);
74+
}
75+
76+
//Used to create CreateCall objects with MediaAttributes (VI)
6877
public CreateCall(final String from, final String to, final String username, final String password,
6978
final boolean isFromApi, final int timeout, final CreateCallType type, final Sid accountId, final Sid parentCallSid,
7079
final URI statusCallbackUrl, final String statusCallbackMethod, final List<String> statusCallbackEvent, final MediaAttributes mediaAttributes, final String customHeaders) {

0 commit comments

Comments
 (0)