Asteridex dial plan

TDF

New Member
Joined
Jul 16, 2008
Messages
206
Reaction score
0
I'm sure this is both simple and been asked before, but I cant find it and don't get it.

The callboth bit

[custom-callboth]
exten => _1NXXNXXXXXX,1,Wait(1)
exten => _1NXXNXXXXXX,2,Background(pls-wait-connect-call)
exten => _1NXXNXXXXXX,3,Macro(dialout-trunk,3,${EXTEN},)
exten => _1NXXNXXXXXX,4,Macro(outisbusy) ; No available circuits
exten => _NXXNXXXXXX,1,Wait(1)
exten => _NXXNXXXXXX,2,Background(pls-wait-connect-call)
exten => _NXXNXXXXXX,3,Macro(dialout-trunk,3,${EXTEN},)
exten => _NXXNXXXXXX,4,Macro(outisbusy) ; No available circuits
This is matching numbers to that pattern and passing them onto the trunk you picked ?

So if I already do my dial plans in the trunk settings, I can dispense with that and just pass all/any numbers onto the trunk ? If thats right what would that look like ?

edit/ Ive puzzled this for a good while, 2 minutes after posting it came to me, replace the lot with _X.
 

TDF

New Member
Joined
Jul 16, 2008
Messages
206
Reaction score
0
All right new problem, I'm trying to set Asteridex's database as a local look up for the caller ID

I set caller ID look up sources to

Host - localhost
Database - asteridex
Query - SELECT name FROM callerid WHERE number LIKE '%[NUMBER]%'
Username - root
Password - root password

but somethings not right, heres the logs

Gosub("SIP/xxxxxxx-a0000000", "cidlookup|cidlookup_3|1") in new stack
[Jul 25 15:27:10] VERBOSE[3161] logger.c: -- Executing [cidlookup_3@cidlookup:1] MYSQL("SIP/xxxxxxx-a0000000", "Connect connid localhost root root password asteridex") in new stack
[Jul 25 15:27:10] WARNING[3161] app_addon_sql_mysql.c: mysql_real_connect(mysql,localhost,root,dbpass,asteridex,...) failed
[Jul 25 15:27:10] VERBOSE[3161] logger.c: -- Executing [cidlookup_3@cidlookup:2] MYSQL("SIP/xxxxxxx-a0000000", "Query resultid SELECT name FROM callerid WHERE number LIKE '%07855123456%'") in new stack
[Jul 25 15:27:10] WARNING[3161] app_addon_sql_mysql.c: Identifier 0, identifier_type 1 not found in identifier list
[Jul 25 15:27:10] WARNING[3161] app_addon_sql_mysql.c: aMYSQL_query: Invalid connection identifier 0 passed in aMYSQL_query
[Jul 25 15:27:10] VERBOSE[3161] logger.c: -- Executing [cidlookup_3@cidlookup:3] MYSQL("SIP/xxxxxxx-a0000000", "Fetch fetchid CALLERID(name)") in new stack
[Jul 25 15:27:10] WARNING[3161] app_addon_sql_mysql.c: Identifier 0, identifier_type 2 not found in identifier list
[Jul 25 15:27:10] WARNING[3161] app_addon_sql_mysql.c: aMYSQL_fetch: Invalid result identifier 0 passed
[Jul 25 15:27:10] VERBOSE[3161] logger.c: -- Executing [cidlookup_3@cidlookup:4] MYSQL("SIP/xxxxxxx-a0000000", "Clear ") in new stack
[Jul 25 15:27:10] WARNING[3161] app_addon_sql_mysql.c: Identifier 0, identifier_type 2 not found in identifier list
[Jul 25 15:27:10] WARNING[3161] app_addon_sql_mysql.c: Invalid result identifier 0 passed in aMYSQL_clear
[Jul 25 15:27:10] VERBOSE[3161] logger.c: -- Executing [cidlookup_3@cidlookup:5] MYSQL("SIP/xxxxxxx-a0000000", "Disconnect ") in new stack
[Jul 25 15:27:10] WARNING[3161] app_addon_sql_mysql.c: Identifier 0, identifier_type 1 not found in identifier list
[Jul 25 15:27:10] WARNING[3161] app_addon_sql_mysql.c: Invalid connection identifier 0 passed in aMYSQL_disconnect
 

jroper

Guru
Joined
Oct 20, 2007
Messages
3,832
Reaction score
71
Is there supposed to be a gap in this line, or is it a formatting error: -

[Jul 25 15:27:10] WARNING[3161] app_addon_sql_mysql.c: mysql_real_connect(mysql,localhost,root,dbpass,ast eridex,...) failed

Joe
 

TDF

New Member
Joined
Jul 16, 2008
Messages
206
Reaction score
0
Must have been when I was editing out my phone number, no gap in the logs.

SELECT name FROM callerid WHERE number LIKE '%[NUMBER]%'

I'm not exactly sure on the query or what its saying, I changed the callerid bit to user1 which is the name of the table in the DB, not clear on the number bit so tried changing that to out which is the name of the column that holds the numbers, still the same so wondering if its a user/password thing, is the root user/pass the right one to use ?

Further experimentation, I entered

mysql --user=root --password=My PASS

at the command prompt and it returned this

[trixbox1.localdomain ~]# mysql --user=root --password=MY PASS
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

so is that the expected outcome or is the root user/pass the wrong one to gain access, I thought root got you everywhere.

Ive just had a flash of inspiration, I remember something about the password passw0rd in MySQL, cant remember the user to go with it though.

Someone push me back in the right direction if I'm well off track, lol.

OK making progress, I'm into the database theres just a error in my syntax

SELECT name FROM user1 WHERE out LIKE '%[NUMBER]%'

app_addon_sql_mysql.c: aMYSQL_query: mysql_query failed. Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'out LIKE '%0788123456%'' at line 1
 

TDF

New Member
Joined
Jul 16, 2008
Messages
206
Reaction score
0
I dont know theres something wrong here

SELECT name FROM user1 WHERE out LIKE '%[NUMBER]%'

ive tried adding a ; to the end, removing the [ ] I'm lost.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,205
Reaction score
5,225
Download the latest version of AsteriDex and look at the select line in index.php. I think you have to use the funny single quotes like `this`, but I'm out of town and can't get to the stuff.
 

TDF

New Member
Joined
Jul 16, 2008
Messages
206
Reaction score
0
Heres the line

"SELECT * FROM user1 where name between '$chr' AND '$chr".'zzzz'."' order by name asc";

Ive tried all sorts but still not got it.

edit/ Ah I got you ward, its like this

SELECT name FROM user1 WHERE `out` LIKE '[NUMBER]'

all working now, from what I can tell the ` is something that changed from MySQL 4 to 5, not 100% on that though.

Thanks to you and jroper.
 
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top