[Serusers] forward to PSTN
Jan Janak
jan at iptel.org
Thu May 8 16:21:55 CEST 2003
Andrzej, comments inline.
On 08-05 09:37, Andrzej Radke wrote:
> Hello Jan !
>
> You right, maybe I've wrong described my problem.
> I'd like all numerical SIP requests i.e. sip:2411 at gda.pl
> or 1077 at gda.pl forward to my PSTN phone over my PSTN Gateway (Cisco2600)
> Everything is correct when I add new permanent contact for this users -> serctl ul add 2411
> I have also defined dial peers voice on my gateway for this numbers:
>
> dial-peer voice 4 pots
> description peer for numbers 2...
> application session
> destination-pattern 2...
> no digit-strip
> port 1/0/1
>
>
> dial-peer voice 5 pots
> description peer for numbers 1...
> application session
> destination-pattern 1...
> no digit-strip
> port 1/0/1
>
> What can I do when I'd like to add more numbers i.e 1010, 1011,
> 2419......an more and more.
You should use regular expression condition instead of usrloc.
> Have to I add all this nunerical user for ser configuration using
> serctl (new permanent contact for new numbers) ???
>
> When I try to use statement
>
> if (uri=~"sip:[0-9]*@gda.pl) {
> forward(10.10.10.1, 5060); my gateway
> };
>
> it doesn't works :((
This is the right approach but your regular expression probably
doesn't match the Request-URI. Try something like this:
if (uri=~"sip:[0-9]+@(gda\.pl|1\.2\.3\.4)") {
if (!t_relay_to_udp("10.10.10.1", "5060")) {
sl_reply_error();
};
break;
};
Don't forget to replace 1\.2\.3\.4 with IP address of your server
(note that dots represent any character in regular expressions so you
must insert a backslash if you want a real dot).
Jan.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20030508/a38c5ef6/attachment.pgp>
More information about the sr-users
mailing list