Each application instance doesn't share information with each other instance. Only through application design can communication between instances be achieved, which would have to be done with something external to TeleFlow(Eg. a database).
I suspect what is happening is that multiple applications are actually requesting the information at almost the EXACT same time.
If the basics of you application are as follows, you will invariably have some jobs picked up by multiple ports:
-- Application starts, checks for a task where call_status = "INCOMPLETE"
-- Application updates call_status to "CALLING"
The reason being, there is nothing in what I just described to stop two or more processes from running the first check at the same time. It is possible, as well, that one runs slightly behind the other, and the update to call_status doesn't happen before the second application instance gets the task. This all happens in milliseconds, I'm sure, but they will still bump into each other.
The "quick fix" if you are doing something like the above:
1) Add a port field to the task table, make its default value 0.
2) Making some assumptions about how this table "looks", your update query might look much like this:
Code:
UPDATE
calls_tasks
SET
call_status = 'CALLING',
port = @PORT
WHERE
call_status = 'INCOMPLETE' AND
port = 0
3) After the update, only place an outbound call if this query gets a row:
Code:
SELECT
fld1
FROM
calls_tasks
WHERE
call_status = 'CALLING' AND
port = @PORT
4) Be sure the application updates the call_status to something other than CALLING when complete.
Obviously, I'm making a great many assumptions about your application, but it seems to fit the problem.
The quick fix I describe isn't necessarily an ideal system, as it means the ports are in some respects "battling each other" for tasks. It is just a quick fix based on what I suspect is happening from your description.
Ideally, you might want to consider having ports "register themselves" as available in your database when they are idle, and having another process provide them with tasks to do, perhaps by assigning them a phone number and a call status of "PENDING" or some such thing.