VoIP switch workings

Hello all,

I have a question about asterisk - and voip switches in general. About how it actually works. I know some things about the protocols involved, but I’m definitely not an expert, and I don’t know much about switches in general.
Let’s say the caller calls the callee, where the caller uses asterisk (or any other switch for that matter). I can imagine two ways it could work:

  1. Like a proxy; it would modify the packet and send it on to the callee’s provider.
  2. Like a phone-client itself. Basically it would send its own request to the callee, if an event occurs it will ‘simulate’ the event on its own for the client. So basically, per call, the server will have two calls itself.

With 2, I can imagine one of two things happening again:
2.1. It would tell the caller to send the stream data (RTP) directly to the callee.
2.2. It would request the caller to send the stream data to the switch, which will forward it to the callee.

My first question is: which of these methods does asterisk use? And what if SIP calls another protocol, like h323? I can’t imagine another method than 2.2 here.

Now, let’s assume the caller is to be billed for this call. Using method 1 and 2.1, the caller and callee will learn each other’s IP address on the invite and the answering of the call. This would mean the entire switch could be bypassed by the client, making billing impossible. However, 2.2 would take a lot of bandwidth that would not be needed.
I’ve never done billing, so I’m not even sure if SIP to SIP should be billed or not. But if it would, wouldn’t that be an issue?

Thanks in advance,

  1. Not 1 or 2. It calls out to your carrier and then they send out the call to whom ever you are calling. If you call in to asterisk and then it calls the callee then it would be like #2.
  2. Again neither. This actually epends on how you set up your Asterisk server. If you want you can have the RTP go from the phone directly to the carrier or from the phone to asterisk and then to your carrier. If you are behind NAT you will the Asterisk server to handle the RTP stream.
  3. Asterisk supports h323 but there are many isuses with it. I would stick to SIP. Asterisk also supports IAX, SCCP, SKINY, POTS, and PRI’s/BRI’s.
  4. I have never tested billing with Asterisk if the RTP goes direct between the two phones. You can bill for SIP->SIp calls if you want.

EDIT: I am a bit tired while responding to this post so if I did not make sense please let me know.