Skip to content

Instantly share code, notes, and snippets.

//
// Part of 2Chat.co
// Learn more about how to use this code at: https://blog.2chat.co/send-a-whatsapp-message-for-each-google-form-response/
//
//
// Paste the URL you copied from the flow you created on 2Chat
//
// ❗ Replace everything inside the quotation marks with the URL generated by 2Chat ❗
//
API_KEY=UAK123123...
@caruizdiaz
caruizdiaz / google-forms-to-whatsapp.js
Last active August 9, 2023 21:36
Send WhatsApp message to each Google Forms submitter
//
// Part of 2Chat.co
// Learn more about how to use this code at: https://blog.2chat.co/send-a-whatsapp-message-for-each-google-form-response/
//
//
// Paste the URL you copied from the flow you created on 2Chat
//
// ❗ Replace everything inside the quotation marks with the URL generated by 2Chat ❗
//
@caruizdiaz
caruizdiaz / whatsapp-for-google-sheets.js
Created December 26, 2022 14:38
App Script to send WhatsApp messages using 2Chat and Google Sheets
//
// App Script to send WhatsApp messages using 2Chat and Google Sheets
//
const _2CHAT_API_KEY = '<PASTE YOUR API KEY HERE>';
const _2CHAT_SOURCE_PHONE_NUMBER = '<PASTE YOUR WHATSAPP PHONE NUMBER HERE>';
const STATUS_PENDING = 'Pending';
const STATUS_QUEUED = 'Queued';
const STATUS_SENDING = 'Sending';
const STATUS_FAILED = 'Failed';
@caruizdiaz
caruizdiaz / cnxcc-check.cfg
Created April 28, 2014 00:45
uses cnxcc module to monitor the call. It does not allow more than 1 call per customer, simultaneously.
#!KAMAILIO
#
# Kamailio (OpenSER) SIP Server v3.2 - default configuration script
# - web: http://www.kamailio.org
# - git: http://sip-router.org
#
# Direct your questions about this file to: <sr-users@lists.sip-router.org>
#
# Refer to the Core CookBook at http://www.kamailio.org/dokuwiki/doku.php
#!KAMAILIO
#
# Kamailio (OpenSER) SIP Server v3.2 - default configuration script
# - web: http://www.kamailio.org
# - git: http://sip-router.org
#
# Direct your questions about this file to: <sr-users@lists.sip-router.org>
#
# Refer to the Core CookBook at http://www.kamailio.org/dokuwiki/doku.php
@caruizdiaz
caruizdiaz / presidentes.pl
Created December 18, 2013 01:00
Lista del presidentes del Paraguay desde la Guerra del Chaco, con sus periodos y partidos
% Lista de presidentes de Paraguay luego de la guerra del chaco
presidente('Eusebio Ayala', 1932, 1936, 'Liberal').
presidente('Rafael Franco', 1936, 1937, 'Militar').
presidente('Félix Paiva', 1937, 1939, 'Liberal').
presidente('José Félix Estigarribia', 1939, 1940, 'Liberal').
presidente('Higinio Morínigo', 1940, 1948, 'Liberal').
presidente('Juan Manuel Frutos', 1948, 1948, 'Militar').
presidente('Juan Natalicio González', 1948, 1949, 'Colorado').
presidente('Raimundo Rolón', 1949, 1949, 'Colorado').
@caruizdiaz
caruizdiaz / ims_ro.c
Created December 17, 2013 17:27
return code as alphanumeric AVP
static int create_cca_return_code(int result) {
int rc;
int_str avp_val, avp_name;
avp_name.s.s = RO_AVP_CCA_RETURN_CODE;
avp_name.s.len = RO_AVP_CCA_RETURN_CODE_LENGTH;
avp_val.n = result;
avp_val.s.s = RO_RETURN_TRUE_STR; //assume true
avp_val.s.len = 1;
@caruizdiaz
caruizdiaz / sample-windows.cs
Last active December 22, 2015 03:09
Main form of the sample application for Windows
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using dwgsms.API;
using dwgsms.DWG;
@caruizdiaz
caruizdiaz / send-sms.cs
Last active December 22, 2015 03:09
sending a message using a random port
string number = "+595981146623";
string text = "Hello World";
int sendingPort = 0;
for(;;)
{
Console.ReadLine();
if (!Gateway.IsGwConnected)
{