Skip to content

SmsSessionRequest Does not add X-RestComm-AccountSid #2374

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
AShabana opened this issue Jul 19, 2017 · 2 comments
Closed

SmsSessionRequest Does not add X-RestComm-AccountSid #2374

AShabana opened this issue Jul 19, 2017 · 2 comments

Comments

@AShabana
Copy link

Dear all ,
RestComm-Conenct ,Does not add any information regard Account SID in any summited messages ( SMS interpreter , Vase Voice Interpreter nor SmsMessagesEndpoint ) , so integration with billing system for accounting of SMSs will not work .

I patched original source tag -> (8.2.0.1266) as below

(8.2.0.1266) git diff 8742e3d32f5862017603ba58898022c7fd722c48 -- restcomm/restcomm.http/src/main/java/org/restcomm/connect/http/SmsMessagesEndpoint.java restcomm/restcomm.interpreter/src/main/java/org/restcomm/connect/interpreter/BaseVoiceInterpreter.java restcomm/restcomm.interpreter/src/main/java/org/restcomm/connect/interpreter/SmsInterpreter.java diff --git a/restcomm/restcomm.http/src/main/java/org/restcomm/connect/http/SmsMessagesEndpoint.java b/restcomm/restcomm.http/src/main/java/org/restcomm/connect/http/SmsMessagesEndpoint.java index de7b32f..c95b3c4 100644 --- a/restcomm/restcomm.http/src/main/java/org/restcomm/connect/http/SmsMessagesEndpoint.java +++ b/restcomm/restcomm.http/src/main/java/org/restcomm/connect/http/SmsMessagesEndpoint.java @@ -302,6 +302,7 @@ public abstract class SmsMessagesEndpoint extends SecuredEndpoint { customRestOutgoingHeaderMap.put(name, data.getFirst(name)); } } customRestOutgoingHeaderMap.put("X-RestComm-AccountSid", accountSid); final Timeout expires = new Timeout(Duration.create(60, TimeUnit.SECONDS)); try { Future<Object> future = (Future<Object>) ask(aggregator, new CreateSmsSession(sender, recipient, accountSid, true), expires); diff --git a/restcomm/restcomm.interpreter/src/main/java/org/restcomm/connect/interpreter/BaseVoiceInterpreter.java b/restcomm/restcomm.interpreter/src/main/java/org/restcomm/connect/interpreter/BaseVoiceInterpreter.java index 5a0359b..d3453a6 100644 --- a/restcomm/restcomm.interpreter/src/main/java/org/restcomm/connect/interpreter/BaseVoiceInterpreter.java +++ b/restcomm/restcomm.interpreter/src/main/java/org/restcomm/connect/interpreter/BaseVoiceInterpreter.java @@ -122,6 +122,7 @@ import java.util.Map; import java.util.Set; import java.util.concurrent.TimeUnit; import java.util.regex.Pattern; +import java.util.concurrent.ConcurrentHashMap; import static akka.pattern.Patterns.ask; @@ -2089,7 +2090,9 @@ public abstract class BaseVoiceInterpreter extends RestcommUntypedActor { // Store the sms record in the sms session. session.tell(new SmsSessionAttribute("record", record), source); // Send the SMS. final SmsSessionRequest sms = new SmsSessionRequest(from, to, body, null); final ConcurrentHashMap<String, String> _header = new ConcurrentHashMap<String, String>() ; _header.put("X-RestComm-AccountSid",accountId.toString()); final SmsSessionRequest sms = new SmsSessionRequest(from, to, body, _header); session.tell(sms, source); smsSessions.put(sid, session); } diff --git a/restcomm/restcomm.interpreter/src/main/java/org/restcomm/connect/interpreter/SmsInterpreter.java b/restcomm/restcomm.interpreter/src/main/java/org/restcomm/connect/interpreter/SmsInterpreter.java index d43da86..cd1182e 100644 --- a/restcomm/restcomm.interpreter/src/main/java/org/restcomm/connect/interpreter/SmsInterpreter.java +++ b/restcomm/restcomm.interpreter/src/main/java/org/restcomm/connect/interpreter/SmsInterpreter.java @@ -640,6 +640,7 @@ public final class SmsInterpreter extends RestcommUntypedActor { } // Ask the parser for the next action to take. Header[] headers = response.getHeaders(); customHttpHeaderMap.put("X-RestComm-AccountSid", accountId.toString()); for(Header header: headers) { if (header.getName().startsWith("X-")) { customHttpHeaderMap.put(header.getName(), header.getValue());
_

@deruelle
Copy link
Member

@AShabana can you please do a formal github Pull Request as described in our Open Source Playbook so we can review and potentially merge ?

@AShabana
Copy link
Author

no problem, I will do as soon as I can

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants