Eulnono
February 16, 2022, 6:33pm
1
Hi,
I’ve got a strange problem, just configuring my realtime like this :
switch => Realtime/SBC@extensions
Storage in my table (name is extensions) is :
id;context;exten ;priority;app ;appdata
1 ;SBC ;0970271010;1 ;DIAL;SIP/0970271010
When I trying a call, the Asterisk’s query is :
SELECT * FROM extensions WHERE exten = ‘s ’ AND context = ‘SBC’ AND priority = ‘1’
Why asterisk is looking for an exten “start” instead of my phone number ?
Asterisk query should be :SELECT * FROM extensions WHERE exten = ‘0970271010 ’ AND context = ‘SBC’ AND priority = ‘1’, no ?
Many thanks and Regards,
Eulnono:
0970271010
Can you show console to make sure extensions 0970271010 is the extensions sent to Asterisk on the incoming call
Eulnono
February 17, 2022, 7:55am
3
Yes it is !
If I write a simple rule :
exten => 0970271010,1,Dial(SIP/${EXTEN)) it works perfectly !
Eulnono
February 17, 2022, 1:11pm
4
Hummm. My realtime seems to work in an other context.
So does ‘Switch => Realtime’ command line must to be alone in a [Context]
Eulnono
February 17, 2022, 2:19pm
5
Yet hummm…
Switch => 'Realtime’ don’t must to be alone, but the prority is less than other rules, even if Switch line is before the others rules
In this example ;
[SBC]
switch => Realtime/SBC@extensions
exten => _X.,1,Noop(Default route)
Default route is prefered !!!
jcolp
February 17, 2022, 2:24pm
6
Eulnono
February 17, 2022, 2:44pm
7
Yes I know that but why I wrote :
[SBC]
switch => Realtime/SBC@extensions
exten => _X.,1,Noop(Default route)
I have :
*CLI> dialplan show SBC
‘_X.’ => 1. Noop(${EXTEN}) [pbx_config]
Alt. Switch => ‘Realtime/SBC@extensions’ [pbx_config]
How can I put my Switch Realtime before my default rule ?
jcolp
February 17, 2022, 2:46pm
8
You can’t. The order is defined according to the order I linked.
Eulnono
February 17, 2022, 2:51pm
9
You didn’t understand, this is not for the same extension !
I have rules for one extension in Realtime and I have a default route and many others for others extensions.
Eulnono
February 17, 2022, 2:52pm
10
Your link explain me the priority rules on ONE extension.
I have differents extensions. This is not a priority problem on ONE extension, this a priority problems of extension matching !
jcolp
February 17, 2022, 2:54pm
11
I don’t know what you mean by “same extension”. The order applies for all extensions, and are evaluated at each priority. If a pattern match that matches is in extensions.conf in the context, then it would be used before the switch.
Eulnono
February 17, 2022, 2:56pm
12
If a pattern match that matches is in extensions.conf in the context, then it would be used before the switch.
Totally agree with this, but this is not the case !!!
[SBC]
switch => Realtime/SBC@extensions (With a better matching pattern inside !!!)
exten => _X.,1,Noop(Default route)
*CLI> dialplan show SBC
‘_X.’ => 1. Noop(${EXTEN}) [pbx_config]
Alt. Switch => ‘Realtime/SBC@extensions’ [pbx_config]
jcolp
February 17, 2022, 2:57pm
13
The switch is not a pattern match in the dialplan. It’s a switch. A switch has lower priority than the “_X.”.
Eulnono
February 17, 2022, 2:57pm
14
Ok, so how can I make a better priority for my switch ?
jcolp
February 17, 2022, 2:58pm
15
The order is what it says on the wiki, so you have to respect the order and make it work for what you want.
Eulnono
February 17, 2022, 3:00pm
16
Yes but in my case I need a final default route because of many extension.
And I need a Switch before the default to have a DIAL on special extension maintained in SQL database.
It may be possible to do this by adding another layer of context, so that it includes contexts with just the realtime switch and just the explicit dialplan.
Eulnono
February 17, 2022, 3:41pm
18
Hummm… I see !!! Thanks you for your help !
system
Closed
March 19, 2022, 3:41pm
19
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.