Author Topic: Query from asterisk dialplan to contact table  (Read 5140 times)

newtek

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
Query from asterisk dialplan to contact table
« on: October 20, 2010, 02:05:08 pm »
Extensions.conf
Code: [Select]
[incomming]

exten => 10000,1,Answer()
exten => 10000,n,Set(CDR(accountcode)=Incomming)
exten => 10000,n,MYSQL(Connect connid 192.168.10.13 invite invite feng)
exten => 10000,n,MYSQL(Query resultid ${connid} SELECT \firstname\, \lastname\ FROM og_contacts WHERE \w_phone_number\='${CALLERID(name)}' OR \w_phone_number2\='${CALLERID(name)}' LIMIT 1)
exten => 10000,n,MYSQL(Fetch fetchid ${resultid} name lastname)
exten => 10000,n,Set(CALLERID(num)=${CALLERID(name)})
exten => 10000,n,Set(CALLERID(name)=${name} ${lastname})
exten => 10000,n,Set(CDR(accountcode)=Incomming)
exten => 10000,n,Playback(silence/3)
exten => 10000,n,Playback(nwtkbienvenue)
exten => 10000,n,Dial(SIP/101&SIP/100,15,tT)
exten => 10000,n,Hangup()

Reza Faghihi

  • Freshman
  • *
  • Posts: 48
    • View Profile
    • Email
Re: Query from asterisk dialplan to contact table
« Reply #1 on: December 25, 2010, 07:27:05 pm »
Hi could you provide more info about it and if u working o. Integrating fen with asterisk tell more about the process .