Yate Community Forum
Yate server => Other Yate server issues => Topic started by: bnaetsch on January 07, 2016, 05:13:12 AM
-
Hello
I dont understand why this
^.*$=fork $(index,$idx00,|sip/sip:\0@62.XXX.XX.XX0:5065,|sip/sip:\0@213.XX.XX.XX0:5065)
not works
It should distribute all incomming calls to more than one telephonie systems
I followed your example in the documentation
http://docs.yate.ro/wiki/Round_Robin_Routing
If I dont use round robin, like this
.*$=sip/sip:\0@62.XXX.XX.XX0:5065
it works fine
Here the Log
20160107114728.768263 <sip/2:ALL> YateSIPConnection::YateSIPConnection(0x6e69800658f0,0x6e6980065090) [0x6e6980065d40]
20160107114728.768731 <sip/2:ALL> NAT address is '(null)' [0x6e6980065d40]
20160107114728.769961 <sip/2:ALL> Set media: audio=alaw,mulaw [0x6e6980065d40]
20160107114728.771294 <INFO> Classifying caller '+493512XXXXX' in context 'inbound' in 273 usec
20160107114728.771470 <cdrbuild:INFO> Got message 'call.route' for untracked id 'sip/2'
20160107114728.772071 <INFO> Routing call to '+493518XXXXXX' in context 'inbound' via 'fork |sip/sip:+493518XXXXXX@213.XX.XX.XX0:5065' in 355 usec
20160107114728.772146 <sip/2:ALL> NAT address is '(null)' [0x6e6980065d40]
20160107114728.772928 <callfork:MILD> Call 'sip/2' ignoring modifier 'sip/sip:+493518XXXXXX@213.XX.XX.XX0:5065'
20160107114728.772989 <sip/2:ALL> YateSIPConnection::disconnected() '(null)' [0x6e6980065d40]
20160107114728.773215 <sip/2:MILD> Call rejected error='(null)' reason='(null)' [0x6e6980065d40]
20160107114728.775265 <sip/2:ALL> YateSIPConnection::hangup() state=0 trans=0x6e6980065090 error='failure' code=500 reason='(null)' [0x6e6980065d40]
20160107114728.775379 <sip/2:ALL> YateSIPConnection::~YateSIPConnection() [0x6e6980065d40]
20160107114728.775687 <sip:INFO> 'udp:0.0.0.0:5060' sending code 500 0x3927af0 to 85.XXX.XXX.206:5060 [0x390ddb0]
or
20160107111057.003374 <sip/1:ALL> YateSIPConnection::YateSIPConnection(0x6e6980058090,0x6e6980059f90) [0x6e698005a480]
20160107111057.003981 <sip/1:ALL> NAT address is '(null)' [0x6e698005a480]
20160107111057.005136 <sip/1:ALL> Set media: audio=alaw,mulaw [0x6e698005a480]
20160107111057.006194 <INFO> Classifying caller '+493512XXXXX' in context 'inbound' in 236 usec
20160107111057.006602 <cdrbuild:INFO> Got message 'call.route' for untracked id 'sip/1'
20160107111057.007068 <INFO> Routing call to '+493518XXXXXX' in context 'inbound' via 'fork |sip/sip:+493518XXXXXX@62.XXX.XX.XX0:5065' in 340 usec
20160107111057.007241 <sip/1:ALL> NAT address is '(null)' [0x6e698005a480]
20160107111057.008891 <callfork:MILD> Call 'sip/1' ignoring modifier 'sip/sip:+493518XXXXXX@62.XXX.XX.XX0:5065'
20160107111057.008921 <sip/1:ALL> YateSIPConnection::disconnected() '(null)' [0x6e698005a480]
20160107111057.009072 <sip/1:MILD> Call rejected error='(null)' reason='(null)' [0x6e698005a480]
20160107111057.009426 <sip/1:ALL> YateSIPConnection::hangup() state=0 trans=0x6e6980059f90 error='failure' code=500 reason='(null)' [0x6e698005a480]
20160107111057.009464 <sip/1:ALL> YateSIPConnection::~YateSIPConnection() [0x6e698005a480]
20160107111057.010929 <sip:INFO> 'udp:0.0.0.0:5060' sending code 500 0x3925ba0 to 85.131.161.206:5060 [0x390ddb0]
Thank you for your advice
Regards
Burkhard
-
The pipe character '|' is a target by itself.
In your case you should either insert a space between | and next target or remove the pipe character: you have only one target.
More that that:
Since you have only one target you don't need the fork module, just route the call to sip:
^.*$=sip/sip:\0@$(index,$idx00,62.XXX.XX.XX0:5065,213.XX.XX.XX0:5065)
-
Thanks for your advice
it works fine
Regards
Burkhard
-
marian,
how can I round-robin between lines configured in accfile?
for instance I have two lines :
[123]
enabled=yes
protocol=sip
username=123
password=123
registrar=sip.registrar.com:5260
[456]
enabled=yes
protocol=sip
username=456
password=456
registrar=sip.registrar.com:5260
will this line in regexroute work? I mean if I have incoming call to dnis 123 will it be routed to line 123 and dnis 456 to according line 456?
^\(.*\)$=line/\1;line=\1
-
If you want to route called number to its line: yes
-
marian,
but how can I do round-robin between these two lines?
Like this:
^.*$=sip/sip:\0@$(index,$idx00,62.XXX.XX.XX0:5065,213.XX.XX.XX0:5065)
but for registered lines
-
If you want to round robin lines no matter the called number:
[$once]
line=0
[default]
^.*$=line/\0;line=$(index,$line,123,456)
If not, please post a description of what exactly do you want to do.
-
yes, thats what I need.
can you explain what does it mean?
[$once]
line=0
-
Initialize variable.
You may take a look at regexroute.conf for any information related to sections, functions ...
-
Line id is basically source number. Can I change caller-id on outgoing leg to selected line id?
Something like that:
^.*$=line/\0;line=$(index,$line,123,456);callername=$line
-
^.*$=line/\0;line=$(index,$line,123,456);callername=${line}
-
marian,
as I can see from regexroute I can split called number with regexp and use parts further after "="
But how can I split caller number the same way? I have in incoming INVITE:
Contact: <sip:295987456223@1.2.3.4:5060>
I need to route it like this:
^38\(.*\)$=line/\1;line=23
where 23 is the last 2 digits from caller number
-
as far as I understand building routing rules I have to do the following
[$once]
ani=0
[default]
.*=call borsch
[borsch]
${caller}^.*\(..\)$=;ani=\1
^38\(.*\)$=line/\1;line=${ani}
or maybe I can do it with "match" but I didn't find any examples how to use it :(
-
Here is an example of matching last 2 digits:
${caller}\([0-9]\{2\}\)$=;any=\1