L
L
L_V_S2013-12-04 17:53:04
Asterisk
L_V_S, 2013-12-04 17:53:04

How to match a phone number to a name using asterisk?

Connected to a multiphone (3 numbers), put all numbers on asterisk
register => [email protected]:password:[email protected]:5060/number
in extensions.conf
; Incoming calls
[incomming]
exten=> s,1,Set(DID=${EXTEN}) ;define the number that received the call
exten=> s,n,Goto(ext-did-catchall); transfer the incoming to exten = to which we received the incoming
;yyyyyyyyyyy
exten=> yyyyyyyyyyy,n,Dial(SIP/100/${CALLERID(NUM)},60,r)
;wwwwwwww
exten=> wwwwwwww,n,Dial(SIP/ 100/${CALLERID(NUM)},60,r)
For incoming calls, everything is directed to internal number 100.
We wrote a js script that displays the caller's number and the number they are calling in a pop-up window.
it is necessary to assign a NAME to the number to which they call, and pull out these data through ami
Is it possible to bind the name to the number in the asteriska configs or not?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alex, 2013-12-05
@L_V_S

"notebook" in ael format , using mysql and realtime :
===extensions.ael===
context input-pbx
{
_X. =>
{
Set(tempvar=${REALTIME_FIELD(notebook,number,${CALLERID(number)},cid)});
if ( !${ISNULL(${tempvar})} )
{
Set(CALLERID(name)=${tempvar});
} ;
verbose(1,KIR> ${CALLERID(num)} called ${EXTEN}.);
Set(CDR(accountcode)=${EXTEN});
jump ${EXTEN}@input-pbc;
};
};//input-pbx end
====
===extconfig.conf=== ( realtime configuration )
notebook => mysql,general,notebook
======
mysql has two columns: number and cid.
everything is checked and working.

S
Soslan Aldatov, 2013-12-05
@supporteam

If there are not so many numbers to call, wouldn't it be easier to create an array of name-number mappings right in the script?
Or, in extreme cases, create a table of correspondences in AstDB/MySQL/whatever and check for a match in the dilplan.
Regarding your question - any external line has a name, it is indicated in square brackets at the beginning of the line config.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question