ladendirekt / pjsip4net

A wrapper library exposing the pjsip library to the .NET world in a OO-friendly way.
71 stars 42 forks source link

Unable to make call #42

Closed sanjeevspr closed 8 years ago

sanjeevspr commented 8 years ago

hello ,

i register sip client successfully,but unable to make call ,its give me error asterisk cli error " chan_sip.c:23613 handle_request_invite: Call from '1001' (192.168.1.101:5060) to extension '192.168.1.102' rejected because extension not found in context 'internal " another sip client is working fine with this username and password how can i fix this problem .kindly provide me some code for make call

my code for call is below

var call = Agent.CallManager.MakeCall(x => x.To("1002") .At(192.168.1.102) .Through("5060") .From(Agent.AccountManager.GetAccountById(Convert.ToInt32(1))) .Call());

image

siniypin commented 8 years ago

Hello, if you want me to help you, you have to describe your setup in details. What network is that, where do you register your accounts, what Registrar server is in use and so on. Having a SIP trace always proves to be handy to debug those cases. This is how to turn SIP trace on in pjsip: https://github.com/siniypin/pjsip4net/issues/41#issuecomment-172958621

sanjeevspr commented 8 years ago

this is my local asterisk server , my local sip server ip is 192.168.1.102 port is : 5060 i can register successfully but unable to call .

and i make local call in other extension

siniypin commented 8 years ago

Please collect your SIP trace and upload here, so I could have a look.

siniypin commented 8 years ago

Hi, so do you still need help with that? If you do, please send me your client's SIP trace.

sanjeevspr commented 8 years ago

This is error message i recived when i trying to call

image

siniypin commented 8 years ago

I see, you have a synchronization problem, most likely. Do you have any non-synchronised event handlers? pjsip4net is not a thread safe library and it raises events in different threads. You'd have to synchronise your handlers, if you want to provide a feedback to you UI. I know it isn't the case in this example, but just try running the same code in Console app. You won't face this error.

To sync your code with main UI thread you can use a SynchronizationContext, or WindowsFormsSynchronizationContext in your case to be precise.

sanjeevspr commented 8 years ago

i use console application but still same problem error message get in asterisk Call from '1001' (192.168.1.84:5060) to extension '192.168.1.91' rejected because extension not found in context 'internal'. and console error is below image

siniypin commented 8 years ago

Can you make a call using a pjsip4net.Console.exe app?

sanjeevspr commented 8 years ago

you mean your pjsip4net.Console.exe ?

i m unable to run your project in my visual studio , i download NuGet Package and i try to make my own application but both (windows & Console ) application is not working deadlock problem

siniypin commented 8 years ago

I mean you can upload your code. And I mean you can build and run pjsip4net.Console.exe yourself.

sanjeevspr commented 8 years ago

will you provide me any working windows application Program ?

siniypin commented 8 years ago

Seriously? Would you pay me for that?

sanjeevspr commented 8 years ago

hahah :+1: how much you want ?

siniypin commented 8 years ago

I'm sorry mate, but I can't help you. There is a project called pjsip4net.Console that is a commandline client capable to make calls. Use it as a reference.

All the best