@@ -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 );
0 commit comments