ladendirekt / pjsip4net

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

Documentation issues #99

Closed RShadowhand closed 5 years ago

RShadowhand commented 5 years ago

Hello,

I can't find proper documentation, and I'm trying to achieve a few things that requires it.
First of all, I'm sending arbitrary information as SIP headers to the registered extension when a call is sent to it, but I couldn't find a way to receive and review this information without reading AMI, and getting it from there. Secondly, I couldn't find a way to get uniqueid of the call, again, without the use of AMI.

Do you have any examples for these problems, or does pjsip4net not have a way to these yet?

siniypin commented 5 years ago

Hi,

you can find a call identifier by querying a call instance for it's DialogId https://github.com/siniypin/pjsip4net/blob/master/pjsip4net/Calls/Call.cs#L118

As for custom message headers - pjsip4net is of little help here, because it's API wrapper currently doesn't let you to interfere with low level stuff like custom headers. It is possible to add support for such feature though. Let me know if you want to participate. I can give you hints.

Cheers

RShadowhand commented 5 years ago

Hello again,

I have investigated DialogId as per your information, but that's not UniqueID (e.g. 1550829776.1663 in cdr, which is also sent by asterisk when the phone rings). However, I did a bit more digging, and figured that's not a problem with pjsip4net, but rather pjsip on the asterisk end.

About the sip headers, I believe the project lead wants to move to pjsua, which would solve our problems. You can consider this issue closed, or maybe keep it for your future plans to improve it. You did a great job.

RShadowhand commented 5 years ago

Ah, I forgot to ask, what about attended transfer?

siniypin commented 5 years ago

CDR is a registrar/relay's server internal call data. https://www.onsip.com/blog/what-are-call-detail-records-cdrs. If your sever populate a call with a CDR identifier, then you'd need to be able to access message headers. Which as I've mentioned aren't available in pjsip4net.

siniypin commented 5 years ago

As for headers, they are available in pjsua API, afaik: https://github.com/siniypin/pjsip4net/blob/master/pjsip.Interop/Interop.cs#L12975. However, pjsip4net makes no use of them.
If you're willing to assist introducing this feature to pjsip4net - you are highly welcome.

siniypin commented 5 years ago

https://gist.github.com/siniypin/7504504 - is that you were looking for regarding transfer?

RShadowhand commented 5 years ago

Yes, those links are very useful. Thank you very much!