SlideShare ist ein Scribd-Unternehmen logo
1 von 36
Pwning Your Phone ,[object Object]
Past & Today ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Adhearsion in a Nutshell ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Why VoIP Rocks ,[object Object],[object Object],[object Object],[object Object],[object Object],(why the lucky stiff???)
Fun VoIP Projects ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Dave Troy’s Asterisk-Powered Roomba Dave’s also writing “Telephony with Ruby”. Will be published by The Prags in November
What is  ? What is  ? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Existing Control Grammars Suck At... ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],...to name just a few things!
Old Dialplan Example [macro-dial-iax] exten => s,1,SetGlobalVar(FOUNDME=ANSWER)  exten => s,2,GotoIf($[${LEN(${ARG1})} = 10]?2:4)  exten => s,3,SetVar(NumToDial=1${ARG1})  exten => s,4,Goto(s,6)  exten => s,5,SetVar(NumToDial=${ARG1}) ... From extensions.conf
Why Use Adhearsion? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Before Adhearsion.
Before Adhearsion. After Adhearsion.
Other Aspects of Adhearsion ,[object Object],[object Object],[object Object],[object Object],[object Object]
Getting Started
Asterisk?! Isn’t that hard to install? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Installing Adhearsion gem install adhearsion [asterisk-context] exten => _.,1,AGI(agi://127.0.0.1)
Writing Adhearsion Dialplans internal { }
Writing Adhearsion Dialplans internal { play ‘hello-world’ }
Writing Adhearsion Dialplans internal { loop { play ‘tt-monkeys’ } }
Writing Adhearsion Dialplans internal { +foo } foo { record { dial SIP/:out_trunk/1234 } }
Writing Adhearsion Dialplans internal { play %w”a-connect-charge-of 16 cents-per-minute will-apply” }
Writing Adhearsion Dialplans internal { case  extension when   10 ... 100 dial  SIP /extension when   6000 ... 6020 ,  7000 .. 7030 join extension when  _ ' 21XX ' if   Time .now.hour.between?  2 ,  10 dial  SIP / " berlin-office " /extension[ 2 .. 4 ] else  speak  " It is not business hours now  in Germany. " end ...
Writing Adhearsion Dialplans ... when   US_NUMBER dial  SIP / ' us-trunk-out ' /extension when   / ^  {11,}$ / dial  IAX / ' intl-trunk-out ' /extension else play  %w' sorry invalid extension please-try-again ' end }
Database-Driven Dialplans Dialplans service { customer = Account.find_by_phone_number callerid usage = customer.usage_this_month if usage >= 100.hours then +beyond_limit else customer.usage_this_month += time do dial IAX2/'main-trunk'/extension end end } beyond_limit { play %w"sorry your-limit-of 100 hours has-been-reached" }
How Does Adhearsion Talk to Asterisk? ,[object Object],[object Object],[object Object],[object Object],[object Object]
Things you can do from Rails ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Helpers
What’s a Helper? ,[object Object],[object Object],[object Object],[object Object]
Helpers require "hpricot" require "open-uri" def lookup number hash = {} url = " http://www.whitepages.com/9901/search/ReversePhone?phone=#{number} " doc = Hpricot open(url) # This div contains all the information we need, unless it's an unlisted number if (results = doc.at "#results_single_listing") then # This div's h3 contains the name of the caller hash[:first_name], hash[:last_name] = results.at('h3').inner_html.split(/,*/).reverse # Now we just need the rest of the information contained in p's. meta = results/'p' meta.pop # Discard the useless p element hash[:number] = meta.pop.inner_html city_info = meta.pop.inner_html city_info = city_info.match /(.+), ([A-Za-z]{2}) ({5})/ hash[:city]  = city_info[1] hash[:state] = city_info[2] hash[:zip]  = city_info[3] hash[:address] = meta.map(&:inner_html) * " " elsif (results = doc.at "#results_single_phone_info") then meta = results/'span' hash[:location] = (meta.pop.inner_html.match /Location: (.*)/)[1] end if hash[:first_name] or hash[:last_name] then hash[:composite] = "#{hash[:first_name]} #{hash[:last_name]}" else hash[:composite] = hash[:location] end hash end
Helpers (in C) (in C) int fast_factorial(int input) { int prod = 1, count = 1; while(count <= input) { prod *= count++; } return sum; }
Micromenus
Micromenus ,[object Object],[object Object],[object Object],[object Object],[object Object]
Micromenus item 'Adhearsion Server Statistics' do item 'View Registered SIP Users' do PBX.sip_users.each do |u| item &quot;SIP user '#{u.username}' on IP #{u.ip}&quot; end end item 'View System Uptime' do item `uptime` end item 'Network' do heading 'Network Interface Info' `ifconfig eth1`.each_line do |line| item line end end end
Micromenus item 'Call an Employee' do item 'Select an employee below.' User.find(:all).each do |user| call user.extension, user.name end end call 'Join main conference' do play 'welcome' join 5555 end
Where Adhearsion is Headed is Headed ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Get Involved! ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Weitere ähnliche Inhalte

Andere mochten auch

Adhearsion and Telegraph Framework Presentation
Adhearsion and Telegraph Framework PresentationAdhearsion and Telegraph Framework Presentation
Adhearsion and Telegraph Framework PresentationJustin Grammens
 
Ruby is Awesome
Ruby is AwesomeRuby is Awesome
Ruby is AwesomeAstrails
 
JavaStart - kurs Java Podstawy
JavaStart - kurs Java PodstawyJavaStart - kurs Java Podstawy
JavaStart - kurs Java PodstawyJavaStart
 

Andere mochten auch (6)

8 powodów dla których warto poznać Ruby
8 powodów dla których warto poznać Ruby8 powodów dla których warto poznać Ruby
8 powodów dla których warto poznać Ruby
 
Adhearsion and Telegraph Framework Presentation
Adhearsion and Telegraph Framework PresentationAdhearsion and Telegraph Framework Presentation
Adhearsion and Telegraph Framework Presentation
 
Ruby is Awesome
Ruby is AwesomeRuby is Awesome
Ruby is Awesome
 
IP PBX
IP PBXIP PBX
IP PBX
 
JavaStart - kurs Java Podstawy
JavaStart - kurs Java PodstawyJavaStart - kurs Java Podstawy
JavaStart - kurs Java Podstawy
 
Asterisk, IM and Presence: how?
Asterisk, IM and Presence: how?Asterisk, IM and Presence: how?
Asterisk, IM and Presence: how?
 

Ähnlich wie Pwn Your Phone with Adhearsion and Asterisk

Stuff we noticed while building "Asterisk in the cloud"
Stuff we noticed while building "Asterisk in the cloud"Stuff we noticed while building "Asterisk in the cloud"
Stuff we noticed while building "Asterisk in the cloud"troyd
 
Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007Guillaume Laforge
 
Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Guillaume Laforge
 
Build HA Asterisk on Microsoft Azure using DRBD/Heartbeat
Build HA Asterisk on Microsoft Azure using DRBD/HeartbeatBuild HA Asterisk on Microsoft Azure using DRBD/Heartbeat
Build HA Asterisk on Microsoft Azure using DRBD/HeartbeatSanjay Willie
 
Astricon 2010: Scaling Asterisk installations
Astricon 2010: Scaling Asterisk installationsAstricon 2010: Scaling Asterisk installations
Astricon 2010: Scaling Asterisk installationsOlle E Johansson
 
Enhancing Free PBX with Adhearsion at Fosdem 2012
Enhancing Free PBX with Adhearsion at Fosdem 2012Enhancing Free PBX with Adhearsion at Fosdem 2012
Enhancing Free PBX with Adhearsion at Fosdem 2012Luca Pradovera
 
Visual Studio .NET2010
Visual Studio .NET2010Visual Studio .NET2010
Visual Studio .NET2010Satish Verma
 
Phpconf 2013 - Agile Telephony Applications with PAMI and PAGI
Phpconf 2013 - Agile Telephony Applications with PAMI and PAGIPhpconf 2013 - Agile Telephony Applications with PAMI and PAGI
Phpconf 2013 - Agile Telephony Applications with PAMI and PAGIMarcelo Gornstein
 
node.js: Javascript's in your backend
node.js: Javascript's in your backendnode.js: Javascript's in your backend
node.js: Javascript's in your backendDavid Padbury
 
Your Business. Your Language. Your Code - dpc13
Your Business. Your Language. Your Code - dpc13Your Business. Your Language. Your Code - dpc13
Your Business. Your Language. Your Code - dpc13Stephan Hochdörfer
 
Intro To Spring Python
Intro To Spring PythonIntro To Spring Python
Intro To Spring Pythongturnquist
 
Aspect-oriented programming in Perl
Aspect-oriented programming in PerlAspect-oriented programming in Perl
Aspect-oriented programming in Perlmegakott
 
Aucklug slides - desktop tips and tricks
Aucklug slides - desktop tips and tricksAucklug slides - desktop tips and tricks
Aucklug slides - desktop tips and tricksGlen Ogilvie
 
X-celerate 2019: Iterating fast with the MERN Stack
X-celerate 2019: Iterating fast with the MERN StackX-celerate 2019: Iterating fast with the MERN Stack
X-celerate 2019: Iterating fast with the MERN StackHaufe-Lexware GmbH & Co KG
 
Kamailio with Docker and Kubernetes
Kamailio with Docker and KubernetesKamailio with Docker and Kubernetes
Kamailio with Docker and KubernetesPaolo Visintin
 
The "Holy Grail" of Dev/Ops
The "Holy Grail" of Dev/OpsThe "Holy Grail" of Dev/Ops
The "Holy Grail" of Dev/OpsErik Osterman
 
Combinators, DSLs, HTML and F#
Combinators, DSLs, HTML and F#Combinators, DSLs, HTML and F#
Combinators, DSLs, HTML and F#Robert Pickering
 
Scripting Oracle Develop 2007
Scripting Oracle Develop 2007Scripting Oracle Develop 2007
Scripting Oracle Develop 2007Tugdual Grall
 
Programming Under Linux In Python
Programming Under Linux In PythonProgramming Under Linux In Python
Programming Under Linux In PythonMarwan Osman
 

Ähnlich wie Pwn Your Phone with Adhearsion and Asterisk (20)

Stuff we noticed while building "Asterisk in the cloud"
Stuff we noticed while building "Asterisk in the cloud"Stuff we noticed while building "Asterisk in the cloud"
Stuff we noticed while building "Asterisk in the cloud"
 
Ruby voip
Ruby voipRuby voip
Ruby voip
 
Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007Groovy Update - JavaPolis 2007
Groovy Update - JavaPolis 2007
 
Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008
 
Build HA Asterisk on Microsoft Azure using DRBD/Heartbeat
Build HA Asterisk on Microsoft Azure using DRBD/HeartbeatBuild HA Asterisk on Microsoft Azure using DRBD/Heartbeat
Build HA Asterisk on Microsoft Azure using DRBD/Heartbeat
 
Astricon 2010: Scaling Asterisk installations
Astricon 2010: Scaling Asterisk installationsAstricon 2010: Scaling Asterisk installations
Astricon 2010: Scaling Asterisk installations
 
Enhancing Free PBX with Adhearsion at Fosdem 2012
Enhancing Free PBX with Adhearsion at Fosdem 2012Enhancing Free PBX with Adhearsion at Fosdem 2012
Enhancing Free PBX with Adhearsion at Fosdem 2012
 
Visual Studio .NET2010
Visual Studio .NET2010Visual Studio .NET2010
Visual Studio .NET2010
 
Phpconf 2013 - Agile Telephony Applications with PAMI and PAGI
Phpconf 2013 - Agile Telephony Applications with PAMI and PAGIPhpconf 2013 - Agile Telephony Applications with PAMI and PAGI
Phpconf 2013 - Agile Telephony Applications with PAMI and PAGI
 
node.js: Javascript's in your backend
node.js: Javascript's in your backendnode.js: Javascript's in your backend
node.js: Javascript's in your backend
 
Your Business. Your Language. Your Code - dpc13
Your Business. Your Language. Your Code - dpc13Your Business. Your Language. Your Code - dpc13
Your Business. Your Language. Your Code - dpc13
 
Intro To Spring Python
Intro To Spring PythonIntro To Spring Python
Intro To Spring Python
 
Aspect-oriented programming in Perl
Aspect-oriented programming in PerlAspect-oriented programming in Perl
Aspect-oriented programming in Perl
 
Aucklug slides - desktop tips and tricks
Aucklug slides - desktop tips and tricksAucklug slides - desktop tips and tricks
Aucklug slides - desktop tips and tricks
 
X-celerate 2019: Iterating fast with the MERN Stack
X-celerate 2019: Iterating fast with the MERN StackX-celerate 2019: Iterating fast with the MERN Stack
X-celerate 2019: Iterating fast with the MERN Stack
 
Kamailio with Docker and Kubernetes
Kamailio with Docker and KubernetesKamailio with Docker and Kubernetes
Kamailio with Docker and Kubernetes
 
The "Holy Grail" of Dev/Ops
The "Holy Grail" of Dev/OpsThe "Holy Grail" of Dev/Ops
The "Holy Grail" of Dev/Ops
 
Combinators, DSLs, HTML and F#
Combinators, DSLs, HTML and F#Combinators, DSLs, HTML and F#
Combinators, DSLs, HTML and F#
 
Scripting Oracle Develop 2007
Scripting Oracle Develop 2007Scripting Oracle Develop 2007
Scripting Oracle Develop 2007
 
Programming Under Linux In Python
Programming Under Linux In PythonProgramming Under Linux In Python
Programming Under Linux In Python
 

Kürzlich hochgeladen

05_Annelore Lenoir_Docbyte_MeetupDora&Cybersecurity.pptx
05_Annelore Lenoir_Docbyte_MeetupDora&Cybersecurity.pptx05_Annelore Lenoir_Docbyte_MeetupDora&Cybersecurity.pptx
05_Annelore Lenoir_Docbyte_MeetupDora&Cybersecurity.pptxFinTech Belgium
 
Call Girls Service Nagpur Maya Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Maya Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Maya Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Maya Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
The Economic History of the U.S. Lecture 22.pdf
The Economic History of the U.S. Lecture 22.pdfThe Economic History of the U.S. Lecture 22.pdf
The Economic History of the U.S. Lecture 22.pdfGale Pooley
 
Quarter 4- Module 3 Principles of Marketing
Quarter 4- Module 3 Principles of MarketingQuarter 4- Module 3 Principles of Marketing
Quarter 4- Module 3 Principles of MarketingMaristelaRamos12
 
Call Girls Koregaon Park Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Koregaon Park Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Koregaon Park Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Koregaon Park Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
The Economic History of the U.S. Lecture 21.pdf
The Economic History of the U.S. Lecture 21.pdfThe Economic History of the U.S. Lecture 21.pdf
The Economic History of the U.S. Lecture 21.pdfGale Pooley
 
High Class Call Girls Nashik Maya 7001305949 Independent Escort Service Nashik
High Class Call Girls Nashik Maya 7001305949 Independent Escort Service NashikHigh Class Call Girls Nashik Maya 7001305949 Independent Escort Service Nashik
High Class Call Girls Nashik Maya 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
VIP Kolkata Call Girl Jodhpur Park 👉 8250192130 Available With Room
VIP Kolkata Call Girl Jodhpur Park 👉 8250192130  Available With RoomVIP Kolkata Call Girl Jodhpur Park 👉 8250192130  Available With Room
VIP Kolkata Call Girl Jodhpur Park 👉 8250192130 Available With Roomdivyansh0kumar0
 
Solution Manual for Principles of Corporate Finance 14th Edition by Richard B...
Solution Manual for Principles of Corporate Finance 14th Edition by Richard B...Solution Manual for Principles of Corporate Finance 14th Edition by Richard B...
Solution Manual for Principles of Corporate Finance 14th Edition by Richard B...ssifa0344
 
Booking open Available Pune Call Girls Shivane 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Shivane  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Shivane  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Shivane 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
The Economic History of the U.S. Lecture 20.pdf
The Economic History of the U.S. Lecture 20.pdfThe Economic History of the U.S. Lecture 20.pdf
The Economic History of the U.S. Lecture 20.pdfGale Pooley
 
(DIYA) Bhumkar Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(DIYA) Bhumkar Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(DIYA) Bhumkar Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(DIYA) Bhumkar Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best sexual serviceanilsa9823
 
Russian Call Girls In Gtb Nagar (Delhi) 9711199012 💋✔💕😘 Naughty Call Girls Se...
Russian Call Girls In Gtb Nagar (Delhi) 9711199012 💋✔💕😘 Naughty Call Girls Se...Russian Call Girls In Gtb Nagar (Delhi) 9711199012 💋✔💕😘 Naughty Call Girls Se...
Russian Call Girls In Gtb Nagar (Delhi) 9711199012 💋✔💕😘 Naughty Call Girls Se...shivangimorya083
 
Malad Call Girl in Services 9892124323 | ₹,4500 With Room Free Delivery
Malad Call Girl in Services  9892124323 | ₹,4500 With Room Free DeliveryMalad Call Girl in Services  9892124323 | ₹,4500 With Room Free Delivery
Malad Call Girl in Services 9892124323 | ₹,4500 With Room Free DeliveryPooja Nehwal
 
Vip Call US 📞 7738631006 ✅Call Girls In Sakinaka ( Mumbai )
Vip Call US 📞 7738631006 ✅Call Girls In Sakinaka ( Mumbai )Vip Call US 📞 7738631006 ✅Call Girls In Sakinaka ( Mumbai )
Vip Call US 📞 7738631006 ✅Call Girls In Sakinaka ( Mumbai )Pooja Nehwal
 
Dharavi Russian callg Girls, { 09892124323 } || Call Girl In Mumbai ...
Dharavi Russian callg Girls, { 09892124323 } || Call Girl In Mumbai ...Dharavi Russian callg Girls, { 09892124323 } || Call Girl In Mumbai ...
Dharavi Russian callg Girls, { 09892124323 } || Call Girl In Mumbai ...Pooja Nehwal
 
03_Emmanuel Ndiaye_Degroof Petercam.pptx
03_Emmanuel Ndiaye_Degroof Petercam.pptx03_Emmanuel Ndiaye_Degroof Petercam.pptx
03_Emmanuel Ndiaye_Degroof Petercam.pptxFinTech Belgium
 
Instant Issue Debit Cards - High School Spirit
Instant Issue Debit Cards - High School SpiritInstant Issue Debit Cards - High School Spirit
Instant Issue Debit Cards - High School Spiritegoetzinger
 

Kürzlich hochgeladen (20)

05_Annelore Lenoir_Docbyte_MeetupDora&Cybersecurity.pptx
05_Annelore Lenoir_Docbyte_MeetupDora&Cybersecurity.pptx05_Annelore Lenoir_Docbyte_MeetupDora&Cybersecurity.pptx
05_Annelore Lenoir_Docbyte_MeetupDora&Cybersecurity.pptx
 
Veritas Interim Report 1 January–31 March 2024
Veritas Interim Report 1 January–31 March 2024Veritas Interim Report 1 January–31 March 2024
Veritas Interim Report 1 January–31 March 2024
 
Call Girls Service Nagpur Maya Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Maya Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Maya Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Maya Call 7001035870 Meet With Nagpur Escorts
 
The Economic History of the U.S. Lecture 22.pdf
The Economic History of the U.S. Lecture 22.pdfThe Economic History of the U.S. Lecture 22.pdf
The Economic History of the U.S. Lecture 22.pdf
 
Quarter 4- Module 3 Principles of Marketing
Quarter 4- Module 3 Principles of MarketingQuarter 4- Module 3 Principles of Marketing
Quarter 4- Module 3 Principles of Marketing
 
Call Girls Koregaon Park Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Koregaon Park Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Koregaon Park Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Koregaon Park Call Me 7737669865 Budget Friendly No Advance Booking
 
The Economic History of the U.S. Lecture 21.pdf
The Economic History of the U.S. Lecture 21.pdfThe Economic History of the U.S. Lecture 21.pdf
The Economic History of the U.S. Lecture 21.pdf
 
High Class Call Girls Nashik Maya 7001305949 Independent Escort Service Nashik
High Class Call Girls Nashik Maya 7001305949 Independent Escort Service NashikHigh Class Call Girls Nashik Maya 7001305949 Independent Escort Service Nashik
High Class Call Girls Nashik Maya 7001305949 Independent Escort Service Nashik
 
VIP Kolkata Call Girl Jodhpur Park 👉 8250192130 Available With Room
VIP Kolkata Call Girl Jodhpur Park 👉 8250192130  Available With RoomVIP Kolkata Call Girl Jodhpur Park 👉 8250192130  Available With Room
VIP Kolkata Call Girl Jodhpur Park 👉 8250192130 Available With Room
 
Solution Manual for Principles of Corporate Finance 14th Edition by Richard B...
Solution Manual for Principles of Corporate Finance 14th Edition by Richard B...Solution Manual for Principles of Corporate Finance 14th Edition by Richard B...
Solution Manual for Principles of Corporate Finance 14th Edition by Richard B...
 
Booking open Available Pune Call Girls Shivane 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Shivane  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Shivane  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Shivane 6297143586 Call Hot Indian Gi...
 
The Economic History of the U.S. Lecture 20.pdf
The Economic History of the U.S. Lecture 20.pdfThe Economic History of the U.S. Lecture 20.pdf
The Economic History of the U.S. Lecture 20.pdf
 
(DIYA) Bhumkar Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(DIYA) Bhumkar Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(DIYA) Bhumkar Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(DIYA) Bhumkar Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best sexual service
 
Russian Call Girls In Gtb Nagar (Delhi) 9711199012 💋✔💕😘 Naughty Call Girls Se...
Russian Call Girls In Gtb Nagar (Delhi) 9711199012 💋✔💕😘 Naughty Call Girls Se...Russian Call Girls In Gtb Nagar (Delhi) 9711199012 💋✔💕😘 Naughty Call Girls Se...
Russian Call Girls In Gtb Nagar (Delhi) 9711199012 💋✔💕😘 Naughty Call Girls Se...
 
Malad Call Girl in Services 9892124323 | ₹,4500 With Room Free Delivery
Malad Call Girl in Services  9892124323 | ₹,4500 With Room Free DeliveryMalad Call Girl in Services  9892124323 | ₹,4500 With Room Free Delivery
Malad Call Girl in Services 9892124323 | ₹,4500 With Room Free Delivery
 
Vip Call US 📞 7738631006 ✅Call Girls In Sakinaka ( Mumbai )
Vip Call US 📞 7738631006 ✅Call Girls In Sakinaka ( Mumbai )Vip Call US 📞 7738631006 ✅Call Girls In Sakinaka ( Mumbai )
Vip Call US 📞 7738631006 ✅Call Girls In Sakinaka ( Mumbai )
 
Dharavi Russian callg Girls, { 09892124323 } || Call Girl In Mumbai ...
Dharavi Russian callg Girls, { 09892124323 } || Call Girl In Mumbai ...Dharavi Russian callg Girls, { 09892124323 } || Call Girl In Mumbai ...
Dharavi Russian callg Girls, { 09892124323 } || Call Girl In Mumbai ...
 
03_Emmanuel Ndiaye_Degroof Petercam.pptx
03_Emmanuel Ndiaye_Degroof Petercam.pptx03_Emmanuel Ndiaye_Degroof Petercam.pptx
03_Emmanuel Ndiaye_Degroof Petercam.pptx
 
Instant Issue Debit Cards - High School Spirit
Instant Issue Debit Cards - High School SpiritInstant Issue Debit Cards - High School Spirit
Instant Issue Debit Cards - High School Spirit
 

Pwn Your Phone with Adhearsion and Asterisk

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6. Dave Troy’s Asterisk-Powered Roomba Dave’s also writing “Telephony with Ruby”. Will be published by The Prags in November
  • 7.
  • 8.
  • 9. Old Dialplan Example [macro-dial-iax] exten => s,1,SetGlobalVar(FOUNDME=ANSWER) exten => s,2,GotoIf($[${LEN(${ARG1})} = 10]?2:4) exten => s,3,SetVar(NumToDial=1${ARG1}) exten => s,4,Goto(s,6) exten => s,5,SetVar(NumToDial=${ARG1}) ... From extensions.conf
  • 10.
  • 13.
  • 15.
  • 16. Installing Adhearsion gem install adhearsion [asterisk-context] exten => _.,1,AGI(agi://127.0.0.1)
  • 18. Writing Adhearsion Dialplans internal { play ‘hello-world’ }
  • 19. Writing Adhearsion Dialplans internal { loop { play ‘tt-monkeys’ } }
  • 20. Writing Adhearsion Dialplans internal { +foo } foo { record { dial SIP/:out_trunk/1234 } }
  • 21. Writing Adhearsion Dialplans internal { play %w”a-connect-charge-of 16 cents-per-minute will-apply” }
  • 22. Writing Adhearsion Dialplans internal { case extension when 10 ... 100 dial SIP /extension when 6000 ... 6020 , 7000 .. 7030 join extension when _ ' 21XX ' if Time .now.hour.between? 2 , 10 dial SIP / &quot; berlin-office &quot; /extension[ 2 .. 4 ] else speak &quot; It is not business hours now in Germany. &quot; end ...
  • 23. Writing Adhearsion Dialplans ... when US_NUMBER dial SIP / ' us-trunk-out ' /extension when / ^ {11,}$ / dial IAX / ' intl-trunk-out ' /extension else play %w' sorry invalid extension please-try-again ' end }
  • 24. Database-Driven Dialplans Dialplans service { customer = Account.find_by_phone_number callerid usage = customer.usage_this_month if usage >= 100.hours then +beyond_limit else customer.usage_this_month += time do dial IAX2/'main-trunk'/extension end end } beyond_limit { play %w&quot;sorry your-limit-of 100 hours has-been-reached&quot; }
  • 25.
  • 26.
  • 28.
  • 29. Helpers require &quot;hpricot&quot; require &quot;open-uri&quot; def lookup number hash = {} url = &quot; http://www.whitepages.com/9901/search/ReversePhone?phone=#{number} &quot; doc = Hpricot open(url) # This div contains all the information we need, unless it's an unlisted number if (results = doc.at &quot;#results_single_listing&quot;) then # This div's h3 contains the name of the caller hash[:first_name], hash[:last_name] = results.at('h3').inner_html.split(/,*/).reverse # Now we just need the rest of the information contained in p's. meta = results/'p' meta.pop # Discard the useless p element hash[:number] = meta.pop.inner_html city_info = meta.pop.inner_html city_info = city_info.match /(.+), ([A-Za-z]{2}) ({5})/ hash[:city] = city_info[1] hash[:state] = city_info[2] hash[:zip] = city_info[3] hash[:address] = meta.map(&:inner_html) * &quot; &quot; elsif (results = doc.at &quot;#results_single_phone_info&quot;) then meta = results/'span' hash[:location] = (meta.pop.inner_html.match /Location: (.*)/)[1] end if hash[:first_name] or hash[:last_name] then hash[:composite] = &quot;#{hash[:first_name]} #{hash[:last_name]}&quot; else hash[:composite] = hash[:location] end hash end
  • 30. Helpers (in C) (in C) int fast_factorial(int input) { int prod = 1, count = 1; while(count <= input) { prod *= count++; } return sum; }
  • 32.
  • 33. Micromenus item 'Adhearsion Server Statistics' do item 'View Registered SIP Users' do PBX.sip_users.each do |u| item &quot;SIP user '#{u.username}' on IP #{u.ip}&quot; end end item 'View System Uptime' do item `uptime` end item 'Network' do heading 'Network Interface Info' `ifconfig eth1`.each_line do |line| item line end end end
  • 34. Micromenus item 'Call an Employee' do item 'Select an employee below.' User.find(:all).each do |user| call user.extension, user.name end end call 'Join main conference' do play 'welcome' join 5555 end
  • 35.
  • 36.