Summary:ASTERISK-06564: [patch] Add registrar dialstring in realtime
Reporter:Roy Sigurd Karlsbakk (rkarlsba)Labels:
Date Opened:2006-03-18 05:08:16.000-0600Date Closed:2006-06-28 09:09:58
Versions:Frequency of
Environment:Attachments:( 0) sip-rt-dialstring-trunk.patch
Description:If using multiple SIP/SIP gateways in front with DNS roundrobin and multiple SIP/PSTN gateways in the back, clients choose registrar by 'random'. Then, when dialing from PSTN, one needs to contact client from the SIP gateway to which the client registered. Otherwise, if client is behind NAT, the server's INVITE is blocked by the NAT firewall.

This patch adds a dialstring, settable from sip.conf, so that PSTN/SIP gateways can lookup which of the SIP/SIP gateways that should handle the call.

I'll do some more changes to app_dial to integrate with this, but any feedback is appreciated.

Comments:By: Olle Johansson (oej) 2006-03-18 05:21:26.000-0600

This is not a dialstring, it's a device address. But I would guess that you don't need that. The important part is really the host that got the registration, the dialstring to reach that host can be figured out by the other servers in the dialplan by func_realtime (another patch) or if we add functionality to the sip_peer function to look this up.

By: Roy Sigurd Karlsbakk (rkarlsba) 2006-03-18 09:18:18.000-0600

IMHO the peer name is what should be stored here as the IP or host name is part of the peer definition. I also want the technology stored there to allow all of them to work (given changes in the other realtime parts, though).

By: Olle Johansson (oej) 2006-03-19 02:41:20.000-0600

In the SIP table, all devices are SIP/ so why save it?

Other hosts can't call to the peer name, they call to the extension. The peer name is already stored in the "name" field.

By: Roy Sigurd Karlsbakk (rkarlsba) 2006-03-19 03:05:56.000-0600

erm, yes, quite correctly, this is the sip table :P

but i beleive you misunderstand the peer/host situation. a call comes in on box pstngw1, that server looks up the number/peer in sipfriends and finds the peer was last registered at server sipgw2 and forwards the call to that server. sipgw2 is, as all other sip peers, registered in the database, the ip address is thus implicit.


By: Olle Johansson (oej) 2006-03-19 03:29:59.000-0600

How does it find that the peer was registred at server sipgw2 if you are not storing the name "sipgw2" in the database for the peer that registers? And how does it now the extension for the peer at sipgw2?

By: Olle Johansson (oej) 2006-05-17 12:04:33

RoyK: We need to discuss this.

By: Olle Johansson (oej) 2006-06-27 12:09:49

No answer from reporter. This is an interesting feature, that needs some thought.

By: Olle Johansson (oej) 2006-06-27 12:20:27

This is how I do it now in svn trunk: If there's an asterisk system name configured in asterisk.conf, we store that in the "regserver" field in the sippeer's table. At expiry, we remove that field.

Now you can define a SIP peer named after the system name and call that peer to reach the registered device.

By: Olle Johansson (oej) 2006-06-27 12:30:37

Committed another solution to svn trunk, rev 36177.

By: Olle Johansson (oej) 2006-06-27 12:31:17

(This is what happens when you go to Malmö for a holiday without replying to me, Roy :-) )

By: Roy Sigurd Karlsbakk (rkarlsba) 2006-06-28 00:55:19

Can you please detail the other solution?

By: Olle Johansson (oej) 2006-06-28 09:09:58

See note above or read the docs :-)

The changes are here: