Click here to Skip to main content
15,915,093 members
Home / Discussions / C#
   

C#

 
QuestionRe: Phone caller Pin
HojatAlizadehfard27-Sep-06 7:06
HojatAlizadehfard27-Sep-06 7:06 
AnswerRe: Phone caller Pin
Nader Elshehabi27-Sep-06 10:41
Nader Elshehabi27-Sep-06 10:41 
GeneralRe: Phone caller Pin
HojatAlizadehfard28-Sep-06 7:36
HojatAlizadehfard28-Sep-06 7:36 
GeneralRe: Phone caller Pin
Nader Elshehabi28-Sep-06 8:02
Nader Elshehabi28-Sep-06 8:02 
GeneralRe: Phone caller Pin
HojatAlizadehfard28-Sep-06 9:30
HojatAlizadehfard28-Sep-06 9:30 
GeneralRe: Phone caller Pin
Nader Elshehabi28-Sep-06 9:42
Nader Elshehabi28-Sep-06 9:42 
QuestionRe: Phone caller Pin
HojatAlizadehfard1-Oct-06 1:20
HojatAlizadehfard1-Oct-06 1:20 
AnswerRe: Phone caller Pin
Nader Elshehabi1-Oct-06 4:22
Nader Elshehabi1-Oct-06 4:22 
HojatAlizadehfard wrote:
I wrote a program with C# and use TAPI.My program dial a number and play a wave file for listener.

Good! I'm glad you made it!! So, which approach did you choose to send the audio? Please don't forget to tell me, I'm interested in this point.
HojatAlizadehfard wrote:
m_CTapi.CallStateEvent += new CTapi.CallStateEventHandler(MyCallStateEventHandler);

I don't know why did choose to handle that event yourself, but here is my approach:

TAPIClass tapi;
ITAddress address;
ITBasicCallControl TheCall;

((ITAddress2)address).set_EventFilter(TAPI_EVENT.TE_CALLNOTIFICATION, 0, true);
            ((ITAddress2)address).set_EventFilter(TAPI_EVENT.TE_CALLMEDIA, 0, true);
tapi.ITTAPIEventNotification_Event_Event += new ITTAPIEventNotification_EventEventHandler(tapi_ITTAPIEventNotification_Event_Event);
            int test = tapi.RegisterCallNotifications(address, true, true, TapiConstants.TAPIMEDIATYPE_DATAMODEM, 1);

void tapi_ITTAPIEventNotification_Event_Event(TAPI_EVENT TapiEvent, object pEvent)
        {
            switch (TapiEvent)
            {
                case TAPI_EVENT.TE_CALLNOTIFICATION:
                    {
                        TheCall = (ITBasicCallControl)(((ITCallNotificationEvent)pEvent).Call);
                        DialogResult res = MessageBox.Show("Answer?", "Incoming", MessageBoxButtons.YesNo);
                        if (res == DialogResult.Yes)
                            TheCall.Answer();
                        else
                            TheCall.Disconnect(DISCONNECT_CODE.DC_REJECTED);
                        break;
                    }
                case TAPI_EVENT.TE_CALLMEDIA:
                    {
                        if (((ITCallMediaEvent)pEvent).Cause == CALL_MEDIA_EVENT_CAUSE.CMC_LOCAL_REQUEST
                            || ((ITCallMediaEvent)pEvent).Cause == CALL_MEDIA_EVENT_CAUSE.CMC_REMOTE_REQUEST)
                        {
                            MessageBox.Show("data");
                        }
                        break;
                    }
            }
        }


Sorry, my application is about data calls so, it might look a bit different. My point is I use TAPI_EVENT.TE_CALLNOTIFICATION call notification event instead of Call state.

Tell me if it worked, if not, I'll try to look up more.

RegardsRose | [Rose]

QuestionQuestion about messaging in C# Pin
Jethro6325-Sep-06 7:00
Jethro6325-Sep-06 7:00 
AnswerRe: Question about messaging in C# Pin
led mike25-Sep-06 7:44
led mike25-Sep-06 7:44 
AnswerRe: Question about messaging in C# Pin
Nader Elshehabi25-Sep-06 7:59
Nader Elshehabi25-Sep-06 7:59 
GeneralRe: Question about messaging in C# Pin
Jethro6325-Sep-06 8:13
Jethro6325-Sep-06 8:13 
GeneralRe: Question about messaging in C# Pin
Nader Elshehabi25-Sep-06 10:42
Nader Elshehabi25-Sep-06 10:42 
GeneralRe: Question about messaging in C# Pin
Jethro6325-Sep-06 16:20
Jethro6325-Sep-06 16:20 
QuestionProblem with SmtpClient Pin
Hmitosh25-Sep-06 6:36
Hmitosh25-Sep-06 6:36 
AnswerRe: Problem with SmtpClient Pin
led mike25-Sep-06 7:45
led mike25-Sep-06 7:45 
AnswerRe: Problem with SmtpClient Pin
Nadia Monalisa25-Sep-06 10:15
Nadia Monalisa25-Sep-06 10:15 
Questionchoosing appropriate data type Pin
biaali25-Sep-06 6:24
biaali25-Sep-06 6:24 
AnswerRe: choosing appropriate data type Pin
Jon Sagara25-Sep-06 6:33
Jon Sagara25-Sep-06 6:33 
GeneralRe: choosing appropriate data type Pin
biaali25-Sep-06 6:36
biaali25-Sep-06 6:36 
GeneralRe: choosing appropriate data type Pin
Jon Sagara25-Sep-06 6:44
Jon Sagara25-Sep-06 6:44 
GeneralRe: choosing appropriate data type Pin
biaali25-Sep-06 6:46
biaali25-Sep-06 6:46 
QuestionThreading in C# Pin
Omkar Ghaisas25-Sep-06 6:13
Omkar Ghaisas25-Sep-06 6:13 
AnswerRe: Threading in C# Pin
Nader Elshehabi25-Sep-06 6:48
Nader Elshehabi25-Sep-06 6:48 
QuestionHow to Open popup window in Mozilla firefox Pin
eswarattaluri25-Sep-06 5:26
eswarattaluri25-Sep-06 5:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.