Kazoo/Freeswitch bridged call from restricted number, how to set sip privacy off - sip

Am bridging an inbound leg to an outbound leg and want to display the called id from the inbound leg on the outbound leg.
Restricted -> (123)456-7890 -> (987)765-4321 (callerId Restricted)
When the caller on the inbound leg has restricted their caller id (*67...), kazoo or freeswitch is setting the "privacy=full" sip header on the outbound leg, so that caller id shows up as restricted.
When the caller on the inbound leg does not restrict their caller id, the outbound leg shows the inbound called number as we desire.
(123)555-1212 -> (123)456-7890 -> (987)765-4321 (callerid 1234567890)
FreeSWITCH Version 1.4.26~64bit ( 64bit)
Kazoo V3.0
Added custom_sip_headers.privacy on the device, kazoo sends sip_h_privacy to freeswitch.
Added privacy to Custom_SIP_Headers on the endpoint and kazoo sends ecallmgr_SIP-Privacy=no to freeswitch.
Here is information from the INVITE sip packet on outbound leg showing the privacy=yes and that it we are sending the desired CallerID.
Remote-Party-ID: "11234567890" <sip:+11234567890#192.168.0.0>;party=calling;screen=yes;privacy=full
When the inbound callee is not restricted the outbound leg INVITE sip packet shows privacy=off as expected and displays the inbound called number.
Remote-Party-ID: "11234567890" <sip:+11234567890#198.168.0.0>;party=calling;screen=yes;privacy=off
What should I be doing to show the caller id in this situation?

You can update kazoo to latest 4.3 branch and latest monster-ui
Caller-ID privacy now managed from web interface.
In current kazoo this more simple then on kazoo 3.0.

Related

Multiple contact headers in 200OK response for a Register request

I am using a Linphone mobile app on android and a Freeswitch server for Audio/video calls.
Now when Linphone sends a Register request to server it gets multiple contact headers in the 200OK response from the Freeswitch Server.
**Contact:
;expires=3211
**Contact: ;expires=3303
**Contact: ;expires=3475
**Contact: ;expires=3600
Because of these bindings,server tries to send invite to multiple contacts for B-leg at the time of call.
Can somebody help me with the probable cause for multiple contact headers in 200OK from server side?
RFC 3261 states in 10.2.4 Refreshing Bindings:
The 200 (OK) response from the registrar contains a list of Contact fields enumerating all current bindings.
Multiple bindings for a single AOR can be registered
by different SIP instances, each registering their own contact address, and/or
by a single SIP instance when it has multiple contact addresses
by a single SIP instance when it registers its new contact address without first unregistering its previous (outdated) address
Looking at your comment it appears the same number (1008) is registered with multiple IP addresses. You should check the REGISTER request(s) your Linphone app sends:
If it contains multiple contact addresses then the host your app runs on is multihomed.
If it registers different contact addresses in subsequent sessions you could consider unregistering a contact address before ending a session.
Otherwise probably other SIP phones in the system register with the same number.
Update:
Extended answer to reflect comment by #artemy-vysotsky

SIP Session Tracking

I am currently working on a project that collect a users login and extension information through parsing SIP header messages after capturing packets. I am currently using PCAP.net and SIPSorcery libraries to accomplish this. The project is written in C#
How it works:
By using filters in PCAP.net I can zone in on the SIP related traffic. Each time a packet is captured an event is fired and I check for the packet type e.g. whether it is SIP or something else UDP related such as DNS. If this is a SIP message I parse the header pulling out the information I am interested in
The problem:
Some SIP endpoints generates multiple registration packets which contains the same UID. It is hard to keep track of a single session and when the endpoint is actually finally registered (i.e. receives the 200OK from the SIP Server). I tried using Dictionary with CallID and then checking when a packet is received if it is already in the Dictionary.
The question:
How do I keep track the session so I know when I receive the 200OK for that particular session, it is registered and stream is complete
A SIP endpoint sends a REGISTER request to bind its contact address(es) to an address-of-record. Such a registration is identified by the Call-ID header field.
Keep in mind that multiple REGISTER requests with the same Call-ID value can occur because:
the endpoint will periodically update its registration, since every registration has an expiration interval
a REGISTER request is challenged for authentication and the SIP endpoint sends a new request with authentication information.
retransmissions
Furthermore, a 200 response doesn't mean that the endpoint is registered. You should check the 'expires' header and/or contact parameter to know how long the registration will remain valid.
Call-ID field in the SIP message is used to track a SIP session. Check RFC 3261 to get more details about Call-ID.
Call-IDs act as unique identifier for a SIP session. In your case you can try searching the Call-ID from the SIP-REGISTER message to track the subsequent messages.

SIP Client (Peers) - Call received failed

I have to integrate the text, voice and video chat via SIP server into my application. So that I have chosen the "Peers" from http://peers.sourceforge.net/.
I have downloaded the code, registered a sip addressz(peers sip client) and call to another sip account(peers sip client). I can't receive a call in that peers client. If I call to another sip client(X-Lite), I can able to receive a call.
Can anybody tell me what may be the problem and how to fix?
when you want to call a remote party from peers you should use sip:user#domain.com where domain.com is the domain you used in your account. If you used an ip address in domain in your sip account, you should use the same domain.

In SIP, why the Contact header field MUST be present in the Invite request

Usually, the Contact header field in the Invite request is useless. For example, the UAC and the UAS are in different LANs. The Contact field may be:
INVITE sip:bob#sipprovider SIP/2.0
Contact: Alice<alice#192.168.1.10>
.....
There is no use of the Contact field while we can still build a dialog. Then, why the Contact header field is mandatory?
The Contact header says where you are (or rather, where your User Agent is), while the From header says who you are.
You might have several SIP devices all registered to the same Address of Record (the URI you put in the From header).
Further, REGISTER requests use Contact headers to maintain SIP's location service: they let a user agent update a registrar's location information.
(As an aside, if Alice calls Bob, the Contact header needs to be in a 2xx response so that Alice can route the 2xx's ACK to Bob. This points to DarkDust's comment about some SIP proxies mangling Contact headers: if it doesn't, you find yourself in the uncomfortable position of having a call that's only half established: Alice thinks the call's set up because she sent her ACK, but Bob never receives it. An alternative to a Contact-mangling Proxy is using a B2BUA as a network gateway; it wouldn't need to mangle the Contact header because the header would point to the B2BUA itself.)
In response to Phoenix Luo's comments, because of the shortcomings of using LAN IPs in a Contact header, RFC 5627 describes a solution - using globally routable user agent URIs
(GRUUs) in the Contact header/s.
The contact field contains the address at which the callee can reach the caller for future requests. For example, it's necessary so that the callee can send a BYE or a re-INVITE to the caller.

Is that possible to use SIP in LAN network?

I don't know enough about SIP. As far as I know SIP can not be used in LAN. But it's features are very good. I want to use it for a LAN messenger (with video conference facilities).
Is there any way of using SIP in LAN network ?
The SIP protocol can be used over any reliable transport (TCP, XMPP, instant messaging channel, etc...) to a service (e.g. a server such as a SIP proxy) that knows how to route the SIP INVITE message from the caller to the callee. e.g. If you send an INVITE to bob#foobar.com, there's needs to be a service that knows how to find "bob" and deliver the message. Likewise, when Bob sends back his response messages back, the messages need to route back to the caller who sent the original INVITE.
And you can do SIP without a server - provided the computer already have a connection (direct or indirect) to the other computer intended for the call.
But SIP isn't anything special. If you were to invent your own video conferencing protocol, it would probably look a lot like SIP. SIP's primary job is for both sides of a call to exchange IP/port candidates for connecting directly in addition to codec and bandwidth negotiation data.
After the SIP messages are exchanged, ICE/STUN/TURN take over and RTP packets typically flow. SIP isn't used in the call except to end the call.
What are you really trying to do anyway?
Thread is Old but still I would like to contribute to this. There are various SIP server like http://www.officesip.com/index.html which works in LAN and can be connected to hardware phone too and soft client also.
Jitsi is open source cross platform SIP/xmpp client:https://jitsi.org/
And if you want to XMPP server Openfire is the best:http://www.igniterealtime.org/projects/openfire/
I hope this will definitely help someone..!