Skip to content

Instantly share code, notes, and snippets.

Received messages payload in <class 'voip_gateway.views.ReceiveVoipMessagesView'> is {'data': {'site': {'product_id': '70002044'}, 'users': {'63': {'product_id': 63, 'platform_id': '438987201342869631', 'number': None, 'extension': 200, 'email_address': 'whui202106161519@bonline.com', 'photo_url': '/restletrouter/FilesService/avatar/TFJZNGNOUm85c0V4dGVuc2lvbi00Mzg5ODcyMDEzNDI4Njk2MzE=', 'name': 'Wyatt Wyatt', 'mobile_number': '07906161519', 'service_plan': "VoIP 'Entry' user", 'add_ons': []}}}}
{
"_key": "b87a993e-30de-407b-8e8e-d3cee1eb3b5d",
"args": {
"public_numbers": {
"type": "numbers",
"value": [
"01300358976"
]
}
},
{
"name": "Main Number",
"children": [
{
"name": "business_hours",
"type": "business_hours",
"children": [
{
"name": "TRANSFER_TO_GROUP",
"type": "call_queuing_group",
@conglin
conglin / my.js
Last active March 5, 2021 07:16 — forked from 1242035/nuxt.config.js
require("dotenv").config();
module.exports = {
mode: "universal",
/*
** Headers of the page
*/
head: {
titleTemplate: "",
title: "MYbOnline | Customer Portal",
// https://serversideup.net/uploading-files-vuejs-axios/
// PUT https://mybonline-dev.appspot.com/portal/api/v1/voip/70000414/call-flows/current/audio-files/upload/
submitFile(){
/*
Initialize the form data
*/
let formData = new FormData();
/*
Add the form data we need to submit
# run in remote shell 70000938 developers@bonline.com
# export HTTPS_PROXY=http://127.0.0.1:8123
# export HTTP_PROXY=http://127.0.0.1:8123
# sudo /usr/bin/pythonw /Users/user/Downloads/google-cloud-sdk/platform/google_appengine/remote_api_shell.py --secure -s ctst-testing.appspot.com
import orm
from products.models import Product
import products.models
import voip.services
import requests
url='http://localhost:8000/voip-provisioning/v1/enterprises/4757724199815007735/welcome-attendant/958281871615315435/audio/upload/'
files={'file': ("Took_my_love_away.mp3", open('Took_my_love_away.mp3','rb'), 'audio/mpeg')}
r=requests.post(url, files=files)
@conglin
conglin / delete_site.py
Last active February 11, 2020 14:08 — forked from crizCraig/gist:2816250
Deleting all entities in a namespace on Google App Engine with Python.
DEV = os.environ['SERVER_SOFTWARE'].startswith('Dev')
APP_ID = os.environ['APPLICATION_ID']
TESTSPACE = 'test.site3.bonlineapp.com' #change this to the namespace to delete
def deleteDBandMemcache():
"""Delete all entities in a namespace."""
from google.appengine.api import namespace_manager
######################################
namespace_manager.set_namespace(TESTSPACE)
######################################
import orm
from common.models import Lead, Kinds
import sqlalchemy as sa
from sqlalchemy import or_
with orm.session_scope() as session:
lead = session.query(Lead).filter(
Lead.source == 'Partner',
or_(
@conglin
conglin / my-first-module.md
Created November 22, 2018 10:00 — forked from tmpvar/my-first-module.md
how to create your very first node.js module and publish it to the npm registry

building your first node module

This is pretty simple, lets dive in!

choose a name

Find a name that isn't taken and clearly describes what your module is doing

$ npm view your-first-node-module