Interfax developer account configuration for multiple recipients - send

I want to configure an interfax account for sending and receiving faxes.
Can anyone tell me how to send/receive a test fax?
I know about the .sendFax() and .GetList() methods, but how do I send fax to myself (in test account)?

I followed the article,
Receive incoming faxes via callback to a web application
it works fine. But it only gives you intimation that you have received fax.
Edit:
You can set feedback url and use the parameter which they asked. When interfax will receive fax for you, it will send it to your feedback url and it will go directly to your database (If you set this in page load event).

You can use following code
MessageItem[] faxList = null;
Inbound inbound = new Inbound();
ListType messageListType = ListType.NewMessages;
int interFaxResult = inbound.GetList(AppConfig.InterfaxUsername, AppConfig.InterfaxPassword, messageListType, AppConfig.InterfaxMaxitems, ref faxList);
if (interFaxResult == 0)
{
// Save faxes in DB
}

Related

How to pass UserName & Password in IBMMQ Client Message using .NET or C++ Program

I am writing a .NET Console application, our goal is keep a message on the queue and read the message. the message header should contain User Name & Password. I try to pass the Message with below code it is not working.
hashTable.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);
hashTable.Add(MQC.HOST_NAME_PROPERTY, strServerName);
hashTable.Add(MQC.CHANNEL_PROPERTY, strChannelName);
hashTable.Add(MQC.PORT_PROPERTY, 1414);
hashTable.Add(MQC.USER_ID_PROPERTY, "XXXXXX");
hashTable.Add(MQC.PASSWORD_PROPERTY, "XXXXXX");
hashTable.Add(MQC.USE_MQCSP_AUTHENTICATION_PROPERTY, true);
queueManager = new MQQueueManager(strQueueManagerName,hashTable);
queue = queueManager.AccessQueue(requestQueue, MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING);
requestMessage = new MQMessage();
requestMessage.WriteString(StrAPICMessage);
requestMessage.Format = MQC.MQFMT_STRING;
requestMessage.MessageType = MQC.MQMT_REQUEST;
requestMessage.Report = MQC.MQRO_COPY_MSG_ID_TO_CORREL_ID;
requestMessage.ReplyToQueueName = responseQueue;
requestMessage.ReplyToQueueManagerName = strQueueManagerName;
queuePutMessageOptions = new MQPutMessageOptions();
queue.Put(requestMessage, queuePutMessageOptions);
In the Message Descriptor it is taking the default value mentioned MQ Server. it is not takeing my UserName "XXXXX"
I have tried using the CSICS Bridge header also unable to send the message with my application Service account + Password.
help me on this scenario.
See "MQCSP authentication mode" here: https://www.ibm.com/docs/en/ibm-mq/latest?topic=authentication-connection-java-client
It says:
In this mode, the client-side user ID is sent as well as the user ID and password to be authenticated, so you are able to use ADOPTCTX(NO). The user ID and password are available to a server-connection security exit in the MQCSP structure that is provided in the MQCXP structure.
"client-side user ID" means the UserId that the application is running under. Therefore, if you are authenticating with a different UserId than the one that the application is running under.
Therefore, you (or your MQAdmin) will need to change ADOPTCTX to YES.
Your program works fine for me, when I fill in the correct values for my qmgr connection.
Except for one change I made: instead of TRANSPORT_MQSERIES_CLIENT I used TRANSPORT_MQSERIES_MANAGED. That keeps everything in the managed .Net space.
Without that change, I was actually getting MQRC_UNSUPPORTED_FUNCTION during the connection which typically means either some kind of mismatch between versions of interfaces, or it couldn't find the C dll that underpins the unmanaged environment. And I wasn't going to take time to dig into that further.
Running amqsbcg against the output queue, I see
UserIdentifier : 'mqguest '
which is the id I had set in the USER_ID_PROPERTY.

User destinations in a multi-server environment? (Spring WebSocket and RabbitMQ)

The documentation for Spring WebSockets states:
4.4.13. User Destinations
An application can send messages targeting a specific user, and Spring’s STOMP support recognizes destinations prefixed with "/user/" for this purpose. For example, a client might subscribe to the destination "/user/queue/position-updates". This destination will be handled by the UserDestinationMessageHandler and transformed into a destination unique to the user session, e.g. "/queue/position-updates-user123". This provides the convenience of subscribing to a generically named destination while at the same time ensuring no collisions with other users subscribing to the same destination so that each user can receive unique stock position updates.
Is this supposed to work in a multi-server environment with RabbitMQ as broker?
As far as I can tell, the queue name for a user is generated by appending the simpSessionId. When using the recommended client library stomp.js this results in the first user getting the queue name "/queue/position-updates-user0", the next gets "/queue/position-updates-user1" and so on.
This in turn means the first users to connect to different servers will subscribe to the same queue ("/queue/position-updates-user0").
The only reference to this I can find in the documentation is this:
In a multi-application server scenario a user destination may remain unresolved because the user is connected to a different server. In such cases you can configure a destination to broadcast unresolved messages to so that other servers have a chance to try. This can be done through the userDestinationBroadcast property of the MessageBrokerRegistry in Java config and the user-destination-broadcast attribute of the message-broker element in XML.
But this only makes the it possible to communicate with a user from a different server than the one where the web socket is established.
I feel I'm missing something? Is there anyway to configure Spring to be able to safely use MessagingTemplate.convertAndSendToUser(principal.getName(), destination, payload) in a multi-server environment?
If they need to be authenticated (I assume their credentials are stored in a database) you can always use their database unique user id to subscribe to.
What I do is when a user logs in they are automatically subscribed to two topics an account|system topic for system wide broadcasts and account|<userId> topic for specific broadcasts.
You could try something like notification|<userid> for each person to subscribe to then send messages to that topic and they will receive it.
Since user Ids are unique to each user you shouldn't have an issue within a clustered environment as long as each environment is hitting the same database information.
Here is my send method:
public static boolean send(Object msg, String topic) {
try {
String destination = topic;
String payload = toJson(msg); //jsonfiy the message
Message<byte[]> message = MessageBuilder.withPayload(payload.getBytes("UTF-8")).build();
template.send(destination, message);
return true;
} catch (Exception ex) {
logger.error(CommService.class.getName(), ex);
return false;
}
}
My destinations are preformatted so if i want to send a message to user with id of one the destinations looks something like /topic/account|1.
Ive created a ping pong controller that tests websockets for users who connect to see if their environment allows for websockets. I don't know if this will help you but this does work in my clustered environment.
/**
* Play ping pong between the client and server to see if web sockets work
* #param input the ping pong input
* #return the return data to check for connectivity
* #throws Exception exception
*/
#MessageMapping("/ping")
#SendToUser(value="/queue/pong", broadcast=false) // send only to the session that sent the request
public PingPong ping(PingPong input) throws Exception {
int receivedBytes = input.getData().length;
int pullBytes = input.getPull();
PingPong response = input;
if (pullBytes == 0) {
response.setData(new byte[0]);
} else if (pullBytes != receivedBytes) {
// create random byte array
byte[] data = randomService.nextBytes(pullBytes);
response.setData(data);
}
return response;
}

Is it possible to send a single message to multiple numbers at a time using Twilio?

I'm developing an app that allows users to add people, info, and Name/phone, or select multiple numbers from their iPhone contact list to send SMS messages to the selected numbers. the problem is Twillio API needs to be call every time per number. Is their any way to call the API once for multiple numbers?
Is it possible to send message to multiple number at a time?
Is it possible to send multiple messages?
Thanks in advance
It's not possible, you need to iterate through the list and make one request per message (which is probably better than batching it and dealing with the potential of multiple errors / resends).
Each new SMS message from Twilio must be sent with a separate REST API request. To initiate messages to a list of recipients, you must make a request for each number to which you would like to send a message. The best way to do this is to build an array of the recipients and iterate through each phone number.
const numbersToMessage = ["+15558675310", "+14158141829", "+15017122661"]
numbersToMessage.forEach(async number => {
const message = await client.messages.create({
body: 'message body',
from: '+16468635472',
to: number
});
console.log(message.status)
});
Yes this is possible. Infact i'm trying to do the same thing at the moment(which is why i'm here) and Twilio has some advanced stuff that lets us achieve this.
Assuming you have a twilio ssid, twilio auth token and a twilio phone number, the next thing you have to do is create a "Twilio Messaging Service" from the dashboard. You can use the ssid of the created messaging service and use or if you want to send a message to like 10k numbers in one go, you create a "Twilio Notify Service" from the dashboard which takes the previously created messaging service as part of its configuration. Once this is done you can call the twilio.notifications.create() and pass bindings({ binding_type: 'sms', address: number }) for each phone number to it.
Complete explanation found in this twilio blog right here with perfectly working code.
https://www.twilio.com/blog/2017/12/send-bulk-sms-twilio-node-js.html
Yes it is possible to send message to multiple user's from your Twilio Number.
You can try this for your node.js file:
var arr = ["+1xxxxxxxxxx","+1xxxxxxxxx"];
arr.forEach(function(value){console.log(value);
client.messages.create({
to:value,
from: "+19253504188",
body: msg,
}, function(err,message){
console.log(err);
});
});
Yes it is possible. You have to provide the numbers as a list and iterate API call.
For example send a message to two numbers.
numbers = ['+1234562525','+1552645232']
for number in numbers:
proxy_client = TwilioHttpClient()
proxy_client.session.proxies = {'https': os.environ['https_proxy']}
client = Client(account_sid, auth_token, http_client=proxy_client)
message = client.messages \
.create(
body="Your message",
from_='Your Twilio number',
to=number
)

Testing WCF with SoapUI

I need your help on one practical issue. I have created a WCF service with basic binding with two operation contact.
1- void StartRegistration - Anonymous member can fill the basic registration form and press submit. All the information will be stored into the database and one link with some random token will be send to user's email address.
2 - void CompleteRegistration - This method validates the token sent into the email address and if token is valid, user account will be activated.
Now I have issue here. Using SoapUI I can call StartRegistration method. Email is sent to destination but I want to pass the token to CompleteRegistration method.
Since it is a WCF service so can not do dependency injection to pass the SoapUI tests :).
Please help.
If I understand your question correctly, you have two WCF methods, one for creating a token and another for confirming it.
What I would do in this case is have the first method, StartRegistration, return the token. Then you could use that token to pass into the CompleteRegistration method quite easily in Soap UI.
Another, quite messy solution, would be to have a groovy script test step in Soap UI that actually connected to the mail account, read the link and parsed the contents.
Edited:
Here is part of the script you'll need. Place it in a groovy step, that will then return the token from your mail.
Note: This code assumes that mail is plain text, not multipart. It also assumes that the mail box only has a single mail. The API for JavaMail is pretty extensive, so if you want to do any magic with it, Google is your friend :) At least, this is somewhere to start.
import javax.mail.*;
import javax.mail.internet.*;
// setup connection
Properties props = new Properties();
def host = "pop3.live.com";
def username = "mymailadress#live.com";
def password = "myPassword";
def provider = "pop3s";
// Connect to the POP3 server
Session session = Session.getDefaultInstance props, null
Store store = session.getStore provider
Folder inbox = null
String content
try
{
store.connect host, username, password
// Open the folder
inbox = store.getFolder 'INBOX'
if (!inbox) {
println 'No INBOX'
System.exit 1
}
inbox.open(Folder.READ_ONLY)
Message[] messages = inbox.getMessages()
content = messages[0].getContent()
//Do some parsing of the content here, to find your token.
//Place the result in content
}
finally
{
inbox.close false
store.close()
}
return content; //return the parsed token

How to check email using a vb.net application

I am looking for a vb.net code for receiving e-mails without using any 3rd party libraries. I want to check Unread messages, Inbox and Sent messages. A Working sample is appreciated.
What is the default port for SMTP , is it port 25 (is it the same for all SMTP mail servers?). Which is more flexible in my case POP3 or IMAP ?
Edit:
Someone please give me a sample working code for receiving mail using lumisoft (pop) in vb.net
From lumisoft Help.
/*
To make this code to work, you need to import following namespaces:
using LumiSoft.Net.Mime;
using LumiSoft.Net.POP3.Client;
*/
using(POP3_Client c = new POP3_Client()){
c.Connect("ivx",WellKnownPorts.POP3);
c.Authenticate("test","test",true);
// Get first message if there is any
if(c.Messages.Count > 0){
// Do your suff
// Parse message
Mime m = Mime.Parse(c.Messages[0].MessageToByte());
string from = m.MainEntity.From;
string subject = m.MainEntity.Subject;
// ...
}
}
Pop is more supported and most servers have it on if you want to implement your own pop service a good place to start is the rfc.