Skip to content

Instantly share code, notes, and snippets.

root@medalliance:/usr/local/freeswitch/conf# cdr.sh 2614a28c-fe34-11e4-b96a-d15850de8ec3 | grep sip_call_id
"sip_call_id" : "10299998971952015113341@192.168.88.21",
root@medalliance:/usr/local/freeswitch/conf# grep "State:Inviting(10299998971952015113341@192.168.88.21" /var/log/m2000*
/var/log/m2000b.log:May 19 11:34:25 192.168.88.21 [S=18991254] [SID:596640847] ( lgr_flow)(18917122 ) | |(SIPTU#421)100 State:Inviting(10299998971952015113341@192.168.88.21)
root@medalliance:/usr/local/freeswitch/conf# grep 596640847 /var/log/m2000*
/var/log/m2000b.log:May 19 11:34:03 192.168.88.21 [S=18989700] [SID:596640847] ( lgr_endpoint)(18915579 ) #118:Digit Map Support Enabled
/var/log/m2000b.log:May 19 11:34:25 192.168.88.21 [S=18991144] [SID:596640847] ( lgr_psbrdex)(18917012 ) pstn recv <-- INCOMING_CALL (src:08137361251 dst:887 redirect1: redirect2:) Trunk:3 Conn:235 BChannel:26 OffhookInd:0 MoreDigits:0
/var/log/m2000b.log:May 19 11:34:25 192.168.88.21 [S=18991145] [SID:596640847] ( lgr_flo
miranda-potiguares:~# rasterisk -x 'sip show peer caboloja2'
* Name : caboloja2
Secret : <Set>
MD5Secret : <Not set>
Remote Secret: <Not set>
Context : from-cabo
Subscr.Cont. : blfs
Language : pt_BR
Accountcode : trunk_caboloja2
AMA flags : Unknown
@lucasmcastro
lucasmcastro / desafio.md
Created April 3, 2014 20:40
Desafio - 4º Curso de Python Evolux

Desafio 4º Curso de Python Evolux

Para a inscrição ser válida ela deve respeitar as seguintes regras

  1. Enviada até 12:00 (meio-dia) do dia 10/03 (Quinta-feira)
  2. Conter link para Github ou Bitbucket com o código do projeto (estando completo ou não)
  3. Conter nome completo do candidato
  4. Conter telefone para contato do candidato

Objetivo do Desafio

@lucasmcastro
lucasmcastro / mongoloide
Created March 20, 2014 00:40
mongo + pymongo + mongolab
>>> from pymongo import MongoClient
>>> import datetime
post = {"author": "Mike","text": "My first blog post!","tags": ["mongodb", "python", "pymongo"], "date": datetime.datetime.utcnow()}
>>> uri = "mongodb://pyladies:pyladies@dbh16.mongolab.com:27167/series4ladies"
>>> client = MongoClient(uri)
>>> client
MongoClient('dbh16.mongolab.com', 27167)
>>> client.series4ladies
Database(MongoClient('dbh16.mongolab.com', 27167), u'series4ladies')
>>> db = client.series4ladies
@lucasmcastro
lucasmcastro / gist:9237861
Created February 26, 2014 20:29
Desafio Semana 01 (Parte 2)
Dando continuidade ao exercício que passamos do Cadastro de Bares:
1) Criar objeto Bar no banco de dados, utilizar o banco SQLite (http://flask.pocoo.org/docs/patterns/sqlite3/)
Bar consiste nos seguintes campos:
- Nome
- Descrição
- Imagem (pode ser nulo)
- Endereço
- Telefone
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "debsqueeze64"
config.vm.network :forwarded_port, guest: 8080, host: 3333
config.vm.network :public_network, :bridge => 'en0: Wi-Fi (AirPort)'
@lucasmcastro
lucasmcastro / VAGRANT_LOG=debug vagrant up
Created January 9, 2014 19:08
INFO global: Vagrant version: 1.4.1 INFO subprocess: Starting process: ["/usr/bin/VBoxManage", "--version"] DEBUG subprocess: Command not in installer, not touching env vars. DEBUG subprocess: Selecting on IO DEBUG subprocess: stdout: 4.2.20r90983
~/h/evolux ❯❯❯ VAGRANT_LOG=debug vagrant up
INFO global: Vagrant version: 1.4.1
INFO global: Ruby version: 2.0.0
INFO global: RubyGems version: 2.0.14
INFO global: VAGRANT_LOG="debug"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/Applications/Vagrant/bin/../embedded"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_DETECTED_OS="Darwin"
INFO global: VAGRANT_INSTALLER_ENV="1"
DEBUG global: Loading core plugin: /Applications/Vagrant/embedded/gems/gems/vagrant-1.4.1/plugins/commands/box/plugin.rb
#!/usr/bin/python
#-*- coding: utf8 -*-
import sys
def memoize(f):
cache = {}
def decorated_function(*args):
if args in cache: