I am using a PBX (Asterisk) and all Inbound calls come through my Proxy (Kamailio). I would like for all outbound calls that go through my PBX to be controlled by the Proxy also. Currently outbound calls go through the PBX and communicate with endpoints. I would like my Proxy to be the endpoint for all communication. In my mind for this to happen, Kamailio would have to make the SIP call. Is this correct?
Thank you!
The question is rather vague, however, if you want to send the call from Asterisk PBX to Kamailio and Kamailio to send it further to a carrier or SIP device, then, yes, it is possible.
One of the common use cases is Asterisk sending the calls to Kamailio, which does least cost routing or load balancing to a group of carriers (see dispatcher, lcr or carrierroute modules).
You can use kamailio as an outbound proxy for calls that come from your B2BUA (in that case Asterisk).
An example in the pjsip.conf
[myitsp]
type = endpoint
; other stuff
outbound_proxy = sip:192.168.0.1\;lr
That will tell Asterisk to route all outbound calls through this outbound proxy. You just need to make sure that Kamailio is configured correctly to also receive traffic from your Asterisk server.
More information in the Asterisk docs
Related
I am using PJSIP for a SIP application and have the following problem. When I register via UDP with register URI "sip:test#172.31.5.153:5060" the register works fine. When a SipPhone calls via UDP it works fine but when the SoftPhone calls via TCP the application answers with a SIP OK where the "transport=tcp" param is missing in the contact of the SIP OK and so the Softphone declines the call. Does anybody knwos this problem and knows a easy solution? Thanks
The behaviour you described sounds like it could be perfectly "valid" sip proxy behaviour as defined in the SIP RFC depending on what the proxy supports against what you have setup in pjsip.
My guess is that you didn't setup the UDP transport correctly in pjsip setup?
What you have to remember is that the proxy is perfectly valid to send NEW dialog messages to the "contact" address.
Normally you have to setup both a UDP and TCP transport for pjsip even with using UDP by default because the SIP message size can get too big for UDP and have to use a TCP connection.
If you want to always connect via TCP you must add ";tansport=tcp" in the account pjsua_acc_config::id field where you setup the sip address for the account.
I would also recommend that if the pjsip client is connect via the internet via a NAT that you also turn on rport support (and hope that the proxy server support rport correctly) as it may be impossible for the sip server to create a TCP/UDP connection back to you when you are behind a NAT.
I used to think Skype sends and receives UDP data packets for real-time audio communication so it cannot use HTTP proxy as HTTP is based on TCP, as what people usually think. But in the support site of Skype, there is an article about HTTP proxy saying that'll affect how Skype makes the communication.
Skype uses different protocols based on the capabilities of the network. If it is behind a firewall and can not call out directly with UDP it will try to detect a HTTP proxy and use it to tunnel the traffic using a proxy CONNECT request. This means it will use TCP in this case. While this might degrade the quality of the connection because latency is often better with UDP (at the cost of data loss), this is often better than no connection at all.
I need a sip extension to receive sip call from anyone who have my sip address.
e.g. if anyone calls 101#xyz.com then sip call should drop on 101 extension configured in a soft phone, where xyz.com can be considered as my asterisk server IP address.
Help me. I am new to asterisk server.
Please provide me a step wise step guide to achieve the goal.
I got success in setting up sip extension that work in local network now I want to set sip extension which capable to receive incoming sip call from anywhere.
Thanks in advance.
You have set in sip.conf in general section
allowguest=yes
context=strangers
After that you can define in extensions.conf context strangers which have determine where to calls.
I want to know how two computers with VoIP software can be connected to each other and exchange voice data without having an external IP address.
You would need an static IP address only if you were trying to connect the two to each other directly. The VOIP server acts as a go-between.
Example:
Person 1 and Person 2 are trying to get into a VOIP call
They both register with the VOIP server with their IDs.
When one ID places a call to another, the there is a connection between the two, with the server in between, but not directly with each other.
SIP (Session Initiation Protocol) is usually the Protocol used for VOIP. There is a SIP registrar, which is the server. You can establish your own SIP server using Asterisk's free solution. SIP actually makes it possible to directly connect peers. However, this isnt possible over the internet where people dont have static IPS
Software like skype use a similar workflow. The skype client tries to connect the peers. When it cant, it uses something like UDP Hole Punching.
Every computer in the internet has an external IP.
The internet works that way.
There are numerous pages on the internet, where you can see your 'external IP'.
Regarding the voice exchange: They connect to a server and that server either does the relaying himself, or exchanges the IP information between the clients, who are then left to create a connection among themselves.
The actual data of a VoIP call is carried over RTP, which really only takes 24-64Kbps (depending upon codec) and requires UDP addresses going each way. Occasional RTCP packets are sent to report status, metrics, etc, but are not really needed.
SIP is used for call setup and teardown.
There is always a network address between two VoIP endpoints, comprised of the IP address and the VoIP socket.
And yes, you could proxy RTP over some other transport protocol, or tunnel (through http?), etc.
A broad question.
We have a client application that currently talks to a web service to exchange data between two clients. The first client stores data on the service and other clients poll the service to collect it at some later time.
We are looking to change this infrastructure a little in that clients will Connect() to the service supplying the IP and Port that they will 'speak' on. When client A wishes to send data to client B it will look up client B's IP and port on the service and then send the data directly to that IP and port.
In the situation where several clients exist behind a common firewall (and NAT), my gut instinct is that I would need to configure port forwarding for each client so that inbound messages at the public IP (ie public side of firewall) can be routed to the appropriate client. As our application is designed to shield 'techy' details we'd like to avoid this it all possible. One caveat is that we are quite happy for the client to have to open a port on the firewall, but to avoid the extra step of setting up port forwarding.
Hope this makes sense, and please feel free to ask for any clarification.
-- Edit --
We are aware of UPnP but it is a non-starter for us due to the fact that it is either not available on some routers and the fact that some corporate environments don't allow it.
Thanks,
Simon
Most home routers provide a UPnP interface to allow applications to set up port forwarding without requiring the user to do anything. Depending on the router model, they may need to enable it on the router, usually a checkbox in some buried config screen.