Soporte & Consultoria

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

lunes, 17 de diciembre de 2018

sip BYE

BYE sip:172.18.15.132:5060 SIP/2.0
Via: SIP/2.0/UDP 45.77.203.6:5066;rport;branch=z9hG4bKPja4d691b6-4605-459d-bc88-ca811b33084a
From: "Ambiorix" <sip:18095608344@45.77.203.6>;tag=f14b225b-58b4-48de-8254-78d939e6141b
To: <sip:+13052362323@asteriskpjsip.pstn.us1.twilio.com>;tag=18426641_6772d868_e74bb600-520d-46de-ad77-822985dec5dc
Call-ID: 9834c53d-54a3-497f-92d5-f9ae0f94bf2d
CSeq: 15065 BYE
Route: <sip:54.172.60.3:5060;lr;ftag=f14b225b-58b4-48de-8254-78d939e6141b>
Reason: Q.850;cause=16
Max-Forwards: 70
User-Agent: Asterisk PBX 16.0.0
Content-Length:  0


  == Spawn extension (internal, 913052362323, 3) exited non-zero on 'PJSIP/6005-00000034'
  == MixMonitor close filestream (mixed)
  == End MixMonitor Recording PJSIP/6005-00000034
<--- Received SIP response (497 bytes) from UDP:54.172.60.3:5060 --->
SIP/2.0 200 OK
CSeq: 15065 BYE
Call-ID: 9834c53d-54a3-497f-92d5-f9ae0f94bf2d
From: "Ambiorix" <sip:18095608344@45.77.203.6>;tag=f14b225b-58b4-48de-8254-78d939e6141b
To: <sip:+13052362323@asteriskpjsip.pstn.us1.twilio.com>;tag=18426641_6772d868_e74bb600-520d-46de-ad77-822985dec5dc
Via: SIP/2.0/UDP 45.77.203.6:5066;received=45.77.203.6;rport=5066;branch=z9hG4bKPja4d691b6-4605-459d-bc88-ca811b33084a
Server: Twilio
X-Twilio-CallSid: CA877bfb05ce4cdc1ed4f3a0a75b3bc88e
Content-Length: 0
-----------------

---------------------------------------------------------------------------------
BYE sip:400@186.149.22.50:61001 SIP/2.0
Via: SIP/2.0/UDP 45.77.203.6:5065;rport;branch=z9hG4bKPj1a4a1ccf-23d4-4f99-9ffb-d5fc361702b7
From: "Ambiorix" <sip:6005@45.77.203.6>;tag=d3dc3eff-b697-4896-aff6-6be9217181e1
To: <sip:8095445555@186.149.22.50>;tag=2ea088a078906330
Call-ID: 38005182-8b9d-469d-8703-0ec651cf0b30
CSeq: 26006 BYE
Reason: Q.850;cause=16
Max-Forwards: 70
User-Agent: Asterisk PBX 16.0.0
Content-Length:  0


  == Spawn extension (internal, 8095445555, 2) exited non-zero on 'PJSIP/6005-00000036'
  == MixMonitor close filestream (mixed)
  == End MixMonitor Recording PJSIP/6005-00000036
<--- Received SIP response (702 bytes) from UDP:186.149.22.50:61001 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 45.77.203.6:5065;rport;branch=z9hG4bKPj1a4a1ccf-23d4-4f99-9ffb-d5fc361702b7
From: "Ambiorix" <sip:6005@45.77.203.6>;tag=d3dc3eff-b697-4896-aff6-6be9217181e1
To: <sip:8095445555@186.149.22.50>;tag=2ea088a078906330
Call-ID: 38005182-8b9d-469d-8703-0ec651cf0b30
CSeq: 26006 BYE
User-Agent: Grandstream GXW4104 (HW 1.0, Ch:1) 1.4.1.5
Session-Expires: 180;refresher=uac
Min-SE: 180
Require: timer
Warning: 399 186.149.22.50 "detected NAT type is port restricted cone"
Contact: <sip:400@186.149.22.50:61001;transport=udp>
Allow: INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE,UPDATE,PRACK
Supported: replaces, timer, 100rel, pat

viernes, 7 de diciembre de 2018

Asterisk realtime centos 7

sudo yum install epel-release
Install dependencies
yum install unixODBC-devel
yum install unixODBC
yum install python-devel
yum install python-pip
yum install MySQL-python


yum install unixODBC unixODBC-devel libtool-ltdl libtool-ltdl-devel
yum install mysql-connector-odbc

LAMP

https://hostadvice.com/how-to/how-to-install-lamp-stack-on-centos-7/

ODBC

http://asteriskdocs.org/en/3rd_Edition/asterisk-book-html-chunk/installing_configuring_odbc.html


Install php 7.2

https://www.tecmint.com/install-php-7-in-centos-7/



Real time

https://wiki.asterisk.org/wiki/display/AST/Setting+up+PJSIP+Realtime#SettingupPJSIPRealtime-InstallingDependencies

miércoles, 5 de diciembre de 2018

Asterisk 16 installation on Centos 7

   1 MAKE SURE SELINUX IS DISABLED
   2  sestatus
   3   yum -y update

    4   yum -y groupinstall core base "Development Tools"

    5  yum install -y make wget openssl-devel ncurses-devel  newt-devel libxml2-devel kernel-devel gcc gcc-c++ sqlite-devel

    6  cd /usr/src/
    7  wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-16-current.tar.gz
   8  tar zxvf asterisk*
   9   cd /usr/src/asterisk*

   contrib/scripts/install_prereq install

   10  ./configure --libdir=/usr/lib64 --with-pjproject-bundled --with-jansson-bundled && make menuselect && make && make install

   11  make samples
   12  make config
   13  ldconfig
   14  service asterisk start
   15  asterisk -rvvvvvvvvvvvvv

viernes, 23 de noviembre de 2018

SIP INVITE header fields

Understanding common header fields in a SIP INVITE

The SIP INVITE is the foundation for every SIP phone call. It is simple and flexible, but often poorly understood by users. The purpose of this article is to provide a quick and easy reference to the critical headers in a SIP INVITE.
The SIP INVITE request is the message sent by the calling party, inviting the recipient for a session. The SIP headers included in this SIP INVITE request provide information about the message.
Consider the following SIP message, with the common SIP headers highlighted:
INVITE sip:bob@biloxi.example.com SIP/2.0
Via: SIP/2.0/TCP client.atlanta.example.com:5060;branch=z9hG4bK74bf9
Max-Forwards: 70
From: Alice <sip:alice@atlanta.example.com>;tag=9fxced76sl
To: Bob <sip:bob@biloxi.example.com>
Call-ID: 3848276298220188511@atlanta.example.com
CSeq: 2 INVITE
Contact: <sip:alice@client.atlanta.example.com;transport=tcp>
Diversion: Carol <sip:carol@atlanta.example.com>;privacy=off;reason=no-answer;counter=1;screen=no
Remote-Party-ID: Alice <sip:alice@atlanta.example.com>
P-Asserted-Identity: Alice <sip:alice@atlanta.example.com>
P-Charge-Info: <sip:eve@atlanta.example.com>
P-Source-Device: 216.3.128.12
Content-Type: application/sdp
Content-Length: 151
X-BroadWorks-DNC: network-address=sip:+9876543210@127.0.0.101;user=phone
User-Agent: X-Lite release 1104o stamp 56125 v=0 o=alice 2890844526 2890844526 IN IP4 client.atlanta.example.com s=- c=IN IP4 192.0.2.101 t=0 0 m=audio 49172 RTP/AVP 0 a=rtpmap:0 PCMU/8000
The following sections explain these header fields.

Request URI

INVITE sip:bob@biloxi.example.com SIP/2.0
The Request URI is the contact information of the next hop in the call route. In the above example, the username of the next hop is bob, who is hosted by biloxi.example.com.

Via

Via: SIP/2.0/TCP client.atlanta.example.com:5060;branch=z9hG4bK74bf9
Max-Forwards: 70
The Via header field indicates the path taken by the request so far and helps in routing the responses back along the same path. If the SIP INVITE passed through multiple SIP proxies, there will be multiple VIA headers. In the given example, the responses will be sent back to client.atlanta.example.com at the port 5060.

From

From: Alice <sip:alice@atlanta.example.com>;tag=9fxced76sl
The From header field indicates contact information of the initiator of the SIP INVITE request, Alice in this case.

To

To: Bob <sip:bob@biloxi.example.com>
The To header field contains the information about the called party or the recipient of the request, Bob in this example.

Call-ID

Call-ID: 3848276298220188511@atlanta.example.com
The Call-ID header field is a unique ID identifying the SIP call. All messages containing this call-id will be assigned to the same SIP call.

Contact

Contact: <sip:alice@client.atlanta.example.com;transport=tcp>
The Contact header field provides a SIP or SIPS URI that should be used to contact the sender of the INVITE, Alice.

Diversion

Diversion: Carol <sip:carol@atlanta.example.com>;privacy=off;reason=no-answer;counter=1;screen=no
The diversion header contains the redirection information of the call. It includes the contact information of the device that forwards the INVITE, and also the reason for diversion.

Remote Party ID

Remote-Party-ID: Alice <sip:alice@atlanta.example.com>
This SIP header is considered obsolete, but is still used to convey the calling telephone number and source IP address.

P-Asserted-Identity

P-Asserted-Identity: Alice <sip:alice@atlanta.example.com>
The P-Asserted-Identity header field is an important SIP header used among trusted SIP entities (typically intermediaries) to carry the identity of the user sending a SIP message as it was verified by authentication. This header is commonly used in call centers who need to present the calling number of its customer, rather than it actual telephone number.

P-Charge-Info

P-Charge-Info: <sip:eve@atlanta.example.com>
The P-Charge-Info header is used to convey billing information about the party to be charged.

P-Source-Device

>P-Source-Device: 216.3.128.12
Content-Type: application/sdp
Content-Length: 151
This is a special header and includes the IP address of the source device through a Back to Back User Agent

X-Header

X-BroadWorks-DNC: network-address=sip:+9876543210@127.0.0.101;user=phone
A SIP header that begins with X can be used to convey any information. For example, An X-Header in a SIP INVITE is often used to convey a subscriber account number for billing.

User-Agent

User-Agent: X-Lite release 1104o stamp 56125
The User-Agent header field contains information about the UAC originating the request. It describes the source device that generated the SIP INVITE.

Connection Information

c= IN IP4 192.0.2.101
This is the source IP address and connection type for the audio stream.
This was one of the simpler SIP INVITE requests, and it could be more complex depending on the call flow.
The SIP INVITE is an important request method, and the information it contains could be used not just for session initiation, but also for such crucial applications as fraud detection. A SIP Analytics-driven Fraud Detection allows for real-time call blocking or call diversion.

viernes, 16 de noviembre de 2018

pjsip realtime

https://wiki.asterisk.org/wiki/display/AST/Setting+up+PJSIP+Realtime#SettingupPJSIPRealtime-InstallingDependencies


https://wiki.asterisk.org/wiki/display/AST/Setting+up+PJSIP+Realtime

https://wiki.asterisk.org/wiki/display/AST/Sorcery



sudo apt-get install python-setuptools
For Python 3.x
sudo apt-get install python3-setuptools

martes, 13 de noviembre de 2018

Admin GUI Dashboard Error after module update today

fwconsole ma upgrade dashboard --edge

https://community.freepbx.org/t/admin-gui-dashboard-error-after-module-update-today/53703

lunes, 22 de octubre de 2018

Ubuntu 18 Asterisk CDR ODBC

https://community.asterisk.org/t/call-detail-records-are-not-saving-in-cdr/76743/6


Install packages
apt-get install unixodbc-dev unixodbc-bin unixodbc
/etc/odbc.ini
[asterisk-mysql]
Description = MySQL connection to ‘asterisk’ database
Driver = MySQL
Database = asterisk
Server = localhost
UserName = root
Password = ‘’
Port = 3306
Socket = /var/run/mysqld/mysqld.sock

This lib need to be downloaded from MYSQL SITE
/etc/odbcinst.ini
[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib/x86_64-linux-gnu/odbc/libmyodbc8a.so
Setup = /usr/lib/x86_64-linux-gnu/odbc/libmyodbc8S.so
FileUsage = 1

/etc/asterisk/cdr_adaptive_odbc.conf
[asterisk-mysql]
connection=asterisk-mysql
table=cdr
alias start => calldate

/etc/asterisk/res_odbc.conf
[asterisk-mysql]
enabled => yes
dsn => asterisk-mysql
username => root
password => ‘’
pre-connect => yes

assuming asterisk db exist create the table
CREATE TABLE cdr (
calldate datetime NULL ,
clid varchar(80) NOT NULL default ‘’,
src varchar(80) NOT NULL default ‘’,
dst varchar(80) NOT NULL default ‘’,
dcontext varchar(80) NOT NULL default ‘’,
channel varchar(80) NOT NULL default ‘’,
dstchannel varchar(80) NOT NULL default ‘’,
lastapp varchar(80) NOT NULL default ‘’,
lastdata varchar(80) NOT NULL default ‘’,
duration int(11) NOT NULL default ‘0’,
billsec int(11) NOT NULL default ‘0’,
disposition varchar(45) NOT NULL default ‘’,
amaflags int(11) NOT NULL default ‘0’,
accountcode varchar(20) NOT NULL default ‘’,
uniqueid varchar(32) NOT NULL default ‘’,
userfield varchar(255) NOT NULL default ‘’
);
restart asterisk
service asterisk restart