Soporte & Consultoria

Soporte Remoto y Consultoria skype : ambiorixg12.
Nota no se brinda ningun tipo de consulta o soporte fuera del blog de forma gratuita

jueves, 19 de enero de 2023

pjsip configuration

extensions.conf

;;;;;;;;;;;


[internal]

exten => _6XXX,1,Dial(PJSIP/${EXTEN})

same=>n,hangup()


exten => _*6XXX,1,Dial(${PJSIP_DIAL_CONTACTS(${EXTEN:1})})

same=>n,hangup()



exten => _x.,1,Dial(PJSIP/${EXTEN}@8001)

same=>n,hangup()


;exten => _9NXXNXXXXXX,1,Dial(PJSIP/mytrunk/sip:${EXTEN:1}@203.0.113.1:5060)

;same=>n,hangup()



[from-freepbx]

exten=>_x.,1,Dial(PJSIP/${EXTEN},45)

same=>n,hangup()



[from-gateway]

exten=>8001,1,NooP( incoming call from ${CALLERID(num)})

same=>n,Set(pseudodid=${PJSIP_HEADER(read,From)})

same=>n,Set(pseudodid=${CUT(pseudodid,@,1)})

same=>n,Set(__pseudodid=${CUT(pseudodid,<,1)})

same=>n,Set(__phone=${pseudodid})

same=>n,Set(CALLERID(num)=${phone})

same=>n,Dial(PJSIP/6000)

same=>n,hangup()



;;;;;;;;pjsip.conf;;;;;;;;;;;;;;;;;;;;


[transport-udp]

type=transport

protocol=udp

bind=0.0.0.0:5060

local_net=10.0.0.0/24


;;;;;;;;;;;;;


[6000]

type=endpoint

context=internal

disallow=all

allow=ulaw

allow=alaw

callerid=6000

direct_media=no

force_rport=yes

ice_support=yes

identify_by=username

mailboxes= 6000

moh_suggest=default

rewrite_contact=yes

rtp_symmetric=yes

send_diversion=yes 

send_pai=yes    ; Send the P Asserted Identity header (default: "no")

send_rpid=yes   ; Send the Remote Party ID header (default: "no")

trust_id_inbound=no

trust_id_outbound=no 

allow_transfer=yes

from_user=6000

mwi_from_user=6000

set_var=id=6001;name=ambiorix

auth=6000

aors=6000

direct_media=no

transport=transport-udp


[6000]

type=auth

auth_type=userpass

password=19111@@!

username=6000


[6000]

type=aor

max_contacts= 5

qualify_frequency=1    ; Interval at which to qualify an AoR (default: "0")

authenticate_qualify=no

remove_existing=yes

maximum_expiration=7200        ; Maximum time to keep an AoR (default: "7200")

minimum_expiration=6000  ; Minimum keep alive time for an AoR (default: "60")

default_expiration=3600

mailboxes=6000

authenticate_qualify=no


;;;;;;;;;;;;

[6001]

type=endpoint

context=internal

disallow=all

allow=ulaw

allow=alaw

callerid=6001

direct_media=no

force_rport=yes

ice_support=yes

identify_by=username

mailboxes= 6001

moh_suggest=default

rewrite_contact=yes

rtp_symmetric=yes

send_diversion=yes 

send_pai=yes    ; Send the P Asserted Identity header (default: "no")

send_rpid=yes   ; Send the Remote Party ID header (default: "no")

trust_id_inbound=no

trust_id_outbound=no 

allow_transfer=yes

from_user=6001

mwi_from_user=6001

set_var=id=6001;name=ambiorix

auth=6001

aors=6001

direct_media=no

transport=transport-udp


[6001]

type=auth

auth_type=userpass

password=19111@@!

username=6001


[6001]

type=aor

max_contacts= 5

qualify_frequency=1    ; Interval at which to qualify an AoR (default: "0")

authenticate_qualify=no

remove_existing=yes

maximum_expiration=7200        ; Maximum time to keep an AoR (default: "7200")

minimum_expiration=6000  ; Minimum keep alive time for an AoR (default: "60")

default_expiration=3600

mailboxes=6001

authenticate_qualify=no

;;;;;;;;;;;;;;;;;;;;;;;;;;;;



[6002]

type=endpoint

context=internal

disallow=all

allow=ulaw

allow=alaw

callerid=6002

direct_media=no

force_rport=yes

ice_support=yes

identify_by=username

mailboxes= 6002

moh_suggest=default

rewrite_contact=yes

rtp_symmetric=yes

send_diversion=yes 

send_pai=yes    ; Send the P Asserted Identity header (default: "no")

send_rpid=yes   ; Send the Remote Party ID header (default: "no")

trust_id_inbound=no

trust_id_outbound=no 

allow_transfer=yes

from_user=6002

mwi_from_user=6002

set_var=id=6001;name=ambiorix

auth=6002

aors=6002

direct_media=no

transport=transport-udp


[6002]

type=auth

auth_type=userpass

password=19111@@!

username=6002


[6002]

type=aor

max_contacts= 5

qualify_frequency=1    ; Interval at which to qualify an AoR (default: "0")

authenticate_qualify=no

remove_existing=yes

maximum_expiration=7200        ; Maximum time to keep an AoR (default: "7200")

minimum_expiration=6000  ; Minimum keep alive time for an AoR (default: "60")

default_expiration=3600

mailboxes=6000

authenticate_qualify=no


;;;;;;;;;;;;trunks ;;;;;;;;;;;;;;;;;;;;;;


[twilio]

type=aor

contact=sip:ambiorixg12.pstn.us1.twilio.com:5060

qualify_frequency=100

authenticate_qualify=no

remove_existing=yes

maximum_expiration=7200        ; Maximum time to keep an AoR (default: "7200")

minimum_expiration=6000  ; Minimum keep alive time for an AoR (default: "60")

default_expiration=3600 

authenticate_qualify=no



[twilio]

type=endpoint

context=from-trunk

disallow=all

allow=ulaw

allow=alaw

direct_media=no

force_rport=yes

ice_support=yes

moh_suggest=default

rewrite_contact=yes

rtp_symmetric=yes

send_diversion=yes

send_pai=yes    ; Send the P Asserted Identity header (default: "no")

send_rpid=yes   ; Send the Remote Party ID header (default: "no")

trust_id_inbound=yes

trust_id_outbound=yes

allow_transfer=yes

from_user=twilio

set_var=id=twilio;name=twilio_trunk

aors=twilio

direct_media=no

transport=transport-udp



[twilio]

type=identify

endpoint=twilio

match=54.172.60.0/8

match=68.183.142.204






[8001]

type=endpoint

context=from-gateway

disallow=all

allow=ulaw

allow=alaw

direct_media=no

force_rport=yes

ice_support=yes

identify_by=username

moh_suggest=default

rewrite_contact=yes

rtp_symmetric=yes

send_diversion=yes 

send_pai=yes    ; Send the P Asserted Identity header (default: "no")

send_rpid=yes   ; Send the Remote Party ID header (default: "no")

trust_id_inbound=yes

trust_id_outbound=yes 

allow_transfer=yes

auth=8001

aors=8001

direct_media=no

transport=transport-udp


[8001]

type=auth

auth_type=userpass

password=19111139z733

username=8001


[8001]

type=aor

max_contacts= 5

qualify_frequency=1    ; Interval at which to qualify an AoR (default: "0")

authenticate_qualify=no

remove_existing=yes

maximum_expiration=7200        ; Maximum time to keep an AoR (default: "7200")

minimum_expiration=6000  ; Minimum keep alive time for an AoR (default: "60")

default_expiration=3600

mailboxes=8001

authenticate_qualify=no


;;;;;;;;;;registration;;;;;;;;;;;;


[FreePBX]

type=auth

auth_type=userpass

password=rz#6c2a6aa9e3f52e

username=311



[FreePBX]

type = registration

server_uri = sip:155.138.223.92:28641;udp

client_uri = sip:311@155.138.223.92:28641;udp

outbound_auth=FreePBX

contact_user=6002  ;send incoming calls to this extension

expiration=120

line=yes

endpoint=FreePBX

max_retries=10


[FreePBX]

type=endpoint

context=from-freepbx ; context for incomings

disallow=all

allow=ulaw

allow=alaw

direct_media=no

force_rport=yes

ice_support=ye

identify_by=ip ; this will  aut incoming callsh base on  the ip on the identify section

moh_suggest=default

rewrite_contact=yes

rtp_symmetric=yes

send_diversion=yes

send_pai=yes    ; Send the P Asserted Identity header (default: "no")

send_rpid=yes   ; Send the Remote Party ID header (default: "no")

trust_id_inbound=yes

trust_id_outbound=yes

allow_transfer=yes

direct_media=no

transport=transport-udp


[FreePBX]

type=identify

endpoint=FreePBX

match=155.138.223.92 ;carrier source ip


https://wiki.asterisk.org/wiki/display/AST/Asterisk+20+Configuration_res_pjsip_outbound_registration#Asterisk20Configuration_res_pjsip_outbound_registration-registration_max_retries

https://wiki.asterisk.org/wiki/display/AST/Asterisk+20+Configuration_res_pjsip

https://wiki.asterisk.org/wiki/display/AST/res_pjsip+Configuration+Examples

lunes, 5 de diciembre de 2022

Asterisk Project… Conferencing Applications ConfBridge


Overview

Asterisk, since its early days, has offered a conferencing application called MeetMe (app_meetme.so). MeetMe provides DAHDI-mixed software-based bridges for multi-party audio conferencing. MeetMe is used by nearly all Asterisk implementations - small office, call center, large office, feature-server, third-party application, etc. It has been extremely successful as an audio bridge.
Over time, several significant limitations of MeetMe have been encountered by its users. Among these are two of distinction: MeetMe requires DAHDI for mixing, and is thus limited to 8kHz (PSTN) audio sampling rates; and MeetMe is delivered in a fairly static form, it does not provide extensive configuration options.
To address these limitations, a new conferencing application, based upon the ConfBridge application introduced in Asterisk 1.6.0, is now available with Asterisk 10. This new ConfBridge application replaces the older ConfBridge application. It is not intended to be a direct replacement for MeetMe, it will not provide feature parity with the MeetMe application. Instead, the new ConfBridge application delivers a completely redesigned set of functionality that most users will find more than sufficient, and in many ways better, for their conferencing needs. 

martes, 14 de junio de 2022

Only PCM encoded, 16 bit, mono, 8kHz/16kHz files are supported with a lowercase ‘.wav’ extension

 Only PCM encoded, 16 bit, mono, 8kHz/16kHz files are supported with a lowercase ‘.wav’ extension

The file extension “wav16” can be used for 16kHz wav files.

https://community.asterisk.org/t/question-about-playback-audio-formats/83928

martes, 7 de junio de 2022

Ubuntu 18 ODBC installation

 


 wget http://ftp.iij.ad.jp/pub/db/mysql/Downloads/Connector-ODBC/8.0/mysql-connector-odbc-8.0.15-linux-ubuntu18.04-x86-64bit.tar.gz


 cp *.so /usr/lib/x86_64-linux-gnu/odbc/




nano /etc/odbc.ini


[MySQL-asteriskcdrdb]

Description=MySQL connection to 'asteriskcdrdb' database

driver=MySQL

server=localhost

database=asteriskcdrdb

Port=3306

;Socket=/var/lib/mysql/mysql.sock

option=3

Charset=utf8





 nano /etc/odbcinst.ini


# Driver from the mysql-connector-odbc package

# Setup from the unixODBC package

[MySQL]

Description     = ODBC for MySQL

Driver          = /usr/lib/x86_64-linux-gnu/odbc/libmyodbc8w.so

Setup           =/usr/lib/x86_64-linux-gnu/odbc/libmyodbc8w.so

Driver64        = /usr/lib/x86_64-linux-gnu/odbc/libmyodbc8w.so

Setup64         = /usr/lib/x86_64-linux-gnu/odbc/libmyodbc8w.so


FileUsage       = 1

----------------------------------


Module 'res_odbc.so' reloaded successfully.

    -- Reloading module 'res_odbc.so' (ODBC resource)

[2022-06-07 22:28:10] NOTICE[1044]: res_odbc.c:706 load_odbc_config: Registered ODBC class 'asteriskcdrdb' dsn->[MySQL-asteriskcdrdb]



-------------------------------
 odbc show

ODBC DSN Settings
-----------------

  Name:   asteriskcdrdb
  DSN:    MySQL-asteriskcdrdb
    Number of active connections: 1 (out of 5)
    Logging: Disabled

miércoles, 6 de abril de 2022

How to run a packet capture in an Asterisk system (tcpdump)

Explore other articles and discussions on this topic.

How to run a packet capture in an Asterisk system (tcpdump)

commands requires to collect a packet capture from a system that is running open source Asterisk

Apr 30, 2015Knowledge

Answer

How to run a packet capture in Asterisk system

In order to collect a packet capture, you need to make sure that tcpump is installed on your system, most Linux implementation already have this tools installed by default, if you need to install it, please contact your system administrator. 

Steps 

  1. Please log into your system using SSH and use admin credentials (usually root)

  2. Execute  #tcpdump -i eth0 -s0 -w /tmp/pcap.pcap 

Note: Make sure that traffic from asterisk is going in and out from the correct interface, you can check the interfaces on your system by running the command ifconfig -a and then checking route to confirm how your operating system is routing the packets going out from your server. 

  1. Press Control + C to stop the capture

Other Examples

  • Run a packet capture on port 5060 only 
# tcpdump -i eth0 -s0 -w /tmp/pcap.pcap port 5060
  • Run a packet capture on a particular host
# tcpdump -i eth0 -s0 -w /tmp/pcap.pcap host 192.168.1.156

miércoles, 9 de marzo de 2022

Fixing FreePBX fail2ban issue

 [root@freepbx ~]# fwconsole ma downloadinstall sysadmin --tag 15.0.21.66 -f


fwconsole reload

lunes, 7 de marzo de 2022

call file

nano call_file.php chmod 777 /var/spool/asterisk/outgoing/ http://15.138.223.92/call_file.php?callingno=100&audiopath=demo-thanks&trunk=401&retry=2&retry_duration=10