|
I am new to SIP and i have been the Lumisoft examples for SIP Call Out and SIP UA. I am having a big problem making a call. I can call another SIP client and the call will be received. However, my application does not recognize the response form the other end. For example, even if the call is picked from the other end, my application still keeps on ringing.
About the incoming call, from wireshark, i can see that the call is going through but the application does not seem to be noticing this. Has anyone used this API? Kindly help me know how i can listen on the incoming calls, especially that. And how can i ensure that the response is well received on my end to ensure that if someone accepts a call, i can actually initiate a dialog?
|
|
|
|
|
There are lot of client/ Server tcp chat program but they all are doing broadcasting.
I want a program where i can talk to a specific client-to-client.
I know there is
serverSocket.LocalEndPoint and
serverSocket.RemoteEndPoint which can be used.
Is there any good article or program which I can use as reference to develop this program
|
|
|
|
|
There are lots to be found through Google[^], but you may need to read through a few to get one that matches your exact needs.
|
|
|
|
|
nitin_ion wrote: I want a program where i can talk to a specific client-to-client.
There are some articles here in CP about chat applications that support private messaging, if that's what you mean. Take a look.
A Complete TCP Server/Client Communication and RMI Framework - Usage[^]
LanTalk[^]
Or you can choose what you need on the list of articles here[^]
Signature construction in progress. Sorry for the inconvenience.
|
|
|
|
|
The server needs to hold a map of client sockets to user names, and then when you request chat to a particular user, the server looks up the socket and sends a message only to that one.
My lobby server does this by using the socket ID number and storing user information including that ID. Joining a game, chatting within a game or PMing another user use the member IDs to route messages. But (i) that uses my socket library and (ii) does a lot more than just this, so it may not be a good example.
|
|
|
|
|
Since socket is internetwork and they all are connected to server with same port and IP.
When i try to send message to a particular client using RemoteEndPoint and IPAddress
var ip = new IPEndPoint(i, j) it still send messages to all clients.
Then how can i connect to a client?
|
|
|
|
|
A client will always send data down the same socket (to the server). It must put something in the message to indicate its target, and the server needs to look at the message to decide what to do with it.
|
|
|
|
|
So if i send the target to server along with message, the problem still remain the same.
should then i use <pre>var ip = new IPEndPoint(i, j)</pre> with port as RemoteEndPoint and then use <pre lang="c#">SendTo(Message, Address)</pre> to send.
is that what you are saying?
|
|
|
|
|
In the server, look at the message that the client sends. If it specifies a particular target for the message, look that client up in the list of currently connected clients (by ID number, username, etc), and send to that socket.
Note that this is not really 'client to client' (peer-to-peer), you are still chatting through the server. TCP is always client-server. You could have each instance of the chat app try to start a server and connect directly between users, but that's usually not what people want – they want to be on one server with lots of people but be able to send messages to only a subset of them. That's server side logic and you need to write it.
|
|
|
|
|
Thanks, I have done some changes to the server code and now it is sending it to particular client if it is there.
But there has to be some nmodel where peer to peer is poosible may b using some othe protocol but i guess it should be there.
|
|
|
|
|
Peer-to-peer services require that each peer can see each other peer*, and each peer is capable of receiving data directly from anywhere. In TCP that means every peer must run a server; with UDP it means every peer must be globally visible for incoming connections. If you already have a chat room running on a server, I don't understand why you'd want to get into that.
Peer-to-peer is useful if your server has limited bandwidth and some of the transactions are bandwidth-saturating, if latency is critical or if you have legal concerns about the data being resident (however transiently) on your server. File sharing, the traditional home of P2P, is mostly about the first and a bit about the third. I don't see how any of them apply to a chat service.
* – at least, all the peers that are in the group you want to be able to communicate with.
|
|
|
|
|
You should save the client's socket address as a result of the EndAccept() method. you can then use that socket to communicate with the individual client. If you are dealing with multiple clients then you need to have some sort of login protocol that allows you to map a socket to a particular user. TCP/IP Chat Application Using C#[^] uses this method and should help to explain things for you.
|
|
|
|
|
The way i did was sending the user name to server and a flag with the client with which i want to communicate.
Then server send the message to that particular client on that socket.
So this looks like peer to peer but it is not. It is actually Client -to Server -to - Client.
I guess there should be some way in which we can have Peer ro Peer, may not be using TCP but something else.
|
|
|
|
|
i have textbox that do something on GotFocus.
how i can disable the GotFocus on this textbox ?
and how to enable it back ?
thanks in advance
|
|
|
|
|
Presumably you are talking winforms!
GotFocus is an event, you can't disable it, you can disable the control or you can handle the problem inside the event.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
if you want to disable a textbox, you can use
textbox.enable = false; and true to reanable it ofc.
If you don't like this solution, you can try to overwrite the GotFocus method to only do "something" if you want it.
|
|
|
|
|
Gali1978 wrote: how i can disable the GotFocus on this textbox ?
textBox1.GetFocus -= this.textBox1_GotFocus;
Gali1978 wrote: and how to enable it back ?
textBox1.GetFocus += this.textBox1_GotFocus;
Alternatively, you could set a flag to indicate your "disabledness" and act on that;
bool isFocusEnabled = false;
void this.textBox1_GotFocus(object sender, EventArgs e)
{
if (!isFocusEnabled) then return;
} That'd allow you to disable/enable the execution of the event with a simple boolean.
Bastard Programmer from Hell
|
|
|
|
|
We are producing proofs of files we intend to print; however, the files are sometimes 80 mg in size. Producing a proof with variable data is not an issue. The issue is the amount of time it takes to open and view the pdf's over the web; therefore, the question is...
Is there a way to automatically reduce the resolution of the pdf using C#, VB, C++ or iTextSharp?
Thanks,
Steve
|
|
|
|
|
You'd have to recompose the entire document in order to do that. Any "oversized" pictures would need to be resampled to a lower resolution and put back into the document to reduce it's size. You might just want to compose two documents instead. One with reduced size pictures and another with "normal". If they want the "good" one, you can provide a link to the second download.
|
|
|
|
|
|
Are you accidentally including text as images, instead of text? That is usually why PDFs get huge.
For included images (or other large resources e.g. embedded fonts) within a document, make sure you're using a sensible compression scheme (JPEG or gzip). Complex page streams should also be compressed, but simple ones shouldn't (it makes the file bigger).
|
|
|
|
|
Hi, in my project I tried to backup my database and then restore using SMO. While backing up and restoring it gives no errors and catches no exception. All of them seem to work great. However, after I perform backup to a file, I deleted the data and/or a table from my database to see whether restoring operation will perform correctly or not. However, when I deleted a table or just data in the table, if I perform restore operation, neither the table nor the data in the table comes back. As a result either backup or restore operation does not work correctly. My backup and restore methods are as in the following :
public bool BackUpDB(string DBpath)
{
try
{
ServerConnection srvConn = new ServerConnection(Program.serverName);
srvConn.LoginSecure = true;
srvr = new Server(srvConn);
Backup bkpDatabase = new Backup();
bkpDatabase.Action = BackupActionType.Database;
bkpDatabase.Database = Program.databaseName;
bkpDatabase.Incremental = false;
bkpDatabase.Initialize = true;
bkpDatabase.LogTruncation = BackupTruncateLogType.Truncate;
BackupDeviceItem bkpDevice = new BackupDeviceItem(DBpath , DeviceType.File);
bkpDatabase.Devices.Add(bkpDevice);
bkpDatabase.SqlBackupAsync(srvr);
return true;
}
catch (Exception)
{
return false;
}
}
The following is my restore method :
public bool RestoreDB(string DBpath)
{
try
{
ServerConnection srvConn = new ServerConnection(Program.serverName);
srvConn.LoginSecure = true;
srvr = new Server(srvConn);
Restore rstDatabase = new Restore();
rstDatabase.Action = RestoreActionType.Database;
if (!srvr.Databases.Contains(Program.databaseName))
{
try
{
DbConnection dbcon = new DbConnection("Data Source=" + Program.serverName + ";Initial Catalog=master;Integrated Security=True");
dbcon.ExecuteCommand("CREATE DATABASE "+Program.databaseName, null);
}
catch (Exception)
{
MessageBox.Show("Veritabanı yaratılırken hata oluştu. Program yine de yedeğinizi geri yüklemeye çalışacak. Ancak bu değişiklik programınıza yansımayabilir. Bu durumda bizimle iletişime geçiniz.","Uyarı",MessageBoxButtons.OK,MessageBoxIcon.Warning);
}
}
rstDatabase.Database = Program.databaseName;
rstDatabase.Devices.AddDevice(@DBpath, DeviceType.File);
rstDatabase.ReplaceDatabase = true;
rstDatabase.SqlRestoreAsync(srvr);
return true;
}
catch (Exception)
{
return false;
}
}
I searched on this issue a lot and all of the codes seems correct however I could not understand why it does not perform correctly. Anyone can help me on this issue ? Please it is a bit urgent, Thanks...
|
|
|
|
|
kutbinayi wrote: Please it is a bit urgent, Thanks...
Not even when the code is on fire.
The code looks like it swallows all exceptions. You could try and change the SqlBackupAsync to SqlBackup ; might be throwing something async
--edit;
The same question is in the database-forum; choose a forum and stick with it, cross-posting is annoying.
Bastard Programmer from Hell
|
|
|
|
|
Yes but when I use SqlBackup method then it nevers succeed backup operation. and catches an exception on data object System.Collections.ListDictionaryInternals. I think this object is used by SqlBackup method. If I use SqlBackupAsync then no exception is thrown. I catched all exceptions but it is not seen in the above code. I just use it while I was trying. Is it normal that SqlBackupAsync succeeds the backup operation but restoring the database does not affect the database ? What could be other reasons ?
|
|
|
|
|
kutbinayi wrote: If I use SqlBackupAsync then no exception is thrown.
I bet it is, only on another thread. That would mean that there could have been an exception, without it being reported.
kutbinayi wrote: Is it normal that SqlBackupAsync succeeds the backup operation but restoring the database does not affect the database ?
No, the software usually does as advertised.
kutbinayi wrote: What could be other reasons ?
Some application open (editing the database) while you're doing a restore? That would lock the database and result in an abort.
Can you paste the entire exception that you're getting?
Bastard Programmer from Hell
|
|
|
|