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@gda.pl or 1077@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.