Soporte & Consultoria

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

viernes, 30 de octubre de 2015

IAX extensions

nano /etc/asterisk/iax.conf

[general]
    bandwidth=low
    disallow=lpc10
    jitterbuffer=no
    forcejitterbuffer=no
    tos=lowdelay
    autokill=yes




[105]
username=105

secret=101011

host=dynamic

type=friend

context=internal

qualify=yes

qualifyfreqok=25000

transfer=no

trunk=no

forceencryption=no

encryption=yes

auth=md5

jueves, 29 de octubre de 2015

Asterisk how to find who has disconnected call

Re: how to find who has disconnected call

New postby satish4asterisk » 07 Oct 2015 05:27
I normally use something like below to find out who disconnected the call

exten => _X.,1,Set(DisconnectedBy=CALLER)
; g - Proceed with dialplan execution at the next priority in the current extension if the destination channel hangs up.
same => n,Dial(${YOUR_DIAL_TECHNOLOGY}/${NUMBER},,g)
same => n,Set(DisconnectedBy=CALLEE)
same => n,Hangup

exten => h,1,NoOp(DisconnectedBy ${DisconnectedBy})
same => n,Set(CDR(userfield)=${DisconnectedBy})

--Satish Barot

miércoles, 28 de octubre de 2015

Asterisk voice changer

[voicechange]
exten=>100,1,Set(PITCH_SHIFT(both)=1.5) ;
exten=>100,2,Playback(demo-thanks)

exten=>200,1,Set(PITCH_SHIFT(both)=1.5) ;
exten=>200,2,dial(SIP/rapidvox/18292363985)


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

martes, 27 de octubre de 2015

Asterisk Localchannel

I made this small example for you.

This dial plan hangs all the active calls on all the listed devices. And then will dial to them for 90 seconds, If any of them answer the call it will be sent to a conference room.

If I understood your request correctly, this code It is almost what you are requesting. but you need to add some modifications, I don't have time to do it all from scratch for you. So you do the rest
Hope this can help you.


[conference_dial]
exten=>_3412,1,Noop()
same=>n,Dial(Local/100@conference_911&Local/101@conference_911&Local/102@conference_911&Local/103@conference_911)

[conference_911]
exten=>101,1,Wait(1)
same=>n,SoftHangup(SIP/${EXTEN},a)
same=>n,Dial(SIP/${EXTEN},90,G(conference_room^0^1))
same=>n,Hangup()




[conference_room]
exten=>0,1,Hangup()
exten=>0,2(conference),Confbridge(4151)

domingo, 25 de octubre de 2015

Queue Gobsub

[popup]
exten=>_x.,1,Noop( call from ${EXTEN})
same=>n,system(mysql --user=root --password='1232' asterisk -e "INSERT INTO calls (number,extension) values ("${CALLERID(num)}","${EXTEN}")")
same=>n,Playback(/var/lib/asterisk/moh/macroform-cold_day)
exten=>_200,1,Answer()
same=>n,set(__d=${CALLERID(num)})
same=>n,Queue(support,,,,,,,insert,,)

exten=>h,1,System(mysql --user=root --password='123' asterisk -e "delete  from calls where number="${CALLERID(num)}"")

[insert]
exten=>s,1,Noop(var values are ${d} ${CALLERID(num)} ${EXTEN})
same=>n,system(mysql --user=root --password='123' asterisk -e "INSERT INTO calls (number,extension) values ("${CALLERID(num)}","${EXTEN}")")
same=>n,return()

sábado, 24 de octubre de 2015

Inbound SIP Traffic CODEC Selection

exten => 1777XXXXXXX,1,Set(__SIP_CODEC_INBOUND=g729:60)

http://forums.digium.com/viewtopic.php?p=164226

Get callers Caller ID in Queue gosub


Postby mclaborn » Sat Sep 15, 2012 12:33 pm
The inheritable variable works, as does function CONNECTEDLINE. Both are demonstrated in the code below.

CODE: SELECT ALL
[queues]
exten =>sales,1,Verbose(2,${CALLERID(all)} entering the sales queue)
  same =>n,Set(_MMCID=${CALLERID(all)})
  same =>n,Verbose(2,mmcid=${MMCID})
  same =>n,Queue(sales,,,,,,,subQueueConnected)
  same =>n,Hangup()
  
[subQueueConnected]
exten =>s,1,NoOp()
  same =>n,Verbose(2, connected to queue gosub interface ${MEMBERINTERFACE} name ${MEMBERNAME} caller ${MMCID} )
  same =>n,Verbose(2, CONNECTEDLINE(name)=${CONNECTEDLINE(name)} )
  same =>n,Verbose(2, CONNECTEDLINE(num)=${CONNECTEDLINE(num)} )
  ;same =>n,DumpChan()
  same =>n,Return()

http://forums.digium.com/viewtopic.php?f=1&t=84149

Trigger shell script on queue answer

You can add to /etc/asterisk/globals_custom.conf 
QGOSUB=context,extension,priority
Working codeon  /etc/asterisk/globals_custom.conf QGOSUB=subCreateTicket,start,1

on  /etc/asterisk/extensions_custom.conf
[subCreateTicket]
exten => s,1,System(/usr/scripts/createsupportticket.sh CALLID=${FROMEXTEN} EXT=${CALLERID(num)})
same => n,Return()
http://community.freepbx.org/t/trigger-shell-script-on-queue-answer/22919

viernes, 23 de octubre de 2015

Asterisk 11 ManagerAction_Hangup

Saltar al final de los metadatos
Ir al inicio de los metadatos

Hangup

Synopsis

Hangup channel.

Description

Hangup a channel.

Syntax

Action: Hangup
ActionID: <value>
Channel: <value>
Cause: <value>
Arguments
  • ActionID - ActionID for this transaction. Will be returned.
  • Channel - The exact channel name to be hungup, or to use a regular expression, set this parameter to: /regex/
    Example exact channel: SIP/provider-0000012a
    Example regular expression: /^SIP/provider-.*$/
  • Cause - Numeric hangup cause.

See Also

Import Version

This documentation was imported from Asterisk Version SVN-branch-11-r404457

 hangup all calls on extension  140
<?php
//http://65.181.118.232/php-project/chanredirect.php?exten=1010&context=internal&channel=SIP/102-00000004
$pbx="localhost";
$timeout=45;
$chan=$_GET['chan'];
echo "<br><center>Action completed on channel $chan</center><br>";
$socket = fsockopen($pbx,"5038", $errno, $errstr, $timeout);
 fputs($socket, "Action: Login\r\n");
 fputs($socket, "UserName: admin\r\n");     //
 fputs($socket, "Secret: xxx3tss4\r\n\r\n");  //
                                            //

     $wrets=fgets($socket,128);
              echo "<center>$wrets</center>";
                fputs($socket, "Action: Hangup\r\n" );
                fputs($socket, "Channel:/^SIP/140-.*$/\r\n" );
            fputs($socket, "Async: yes\r\n\r\n" );
              fputs($socket, "Action: Logoff\r\n\r\n");
 sleep (1);
 $wrets=fgets($socket,128);

?>

miércoles, 21 de octubre de 2015

Web Dialer dial plan

[ivr]
exten=>s,1,Answer()
same=>n,Wait(1)
same=>n,Read(CONFIRM,${audio},1)
same=>n,System(mysql --user=root --password='1112' dialer -e 'UPDATE `list` SET `keypressed`="${CONFIRM}" WHERE phone="${telephone}" and list_cp="${cp}"')
same=> n,ExecIf($["${CONFIRM}"= "${cp_dnc_key}"&&"${CONFIRM}"!=""]?system(mysql --user=root --password='1112' dialer -e "INSERT INTO dnc (dnc_phone) values ("${telephone}")"))
same=> n,ExecIf($["${CONFIRM}"= "${key1}"]?Dial(SIP/${transf_dest}@${carrier},25))
same=> n,ExecIf($["${CONFIRM}"= "${key2}"]?Dial(SIP/${transf_dest2}@${carrier},25))
exten=>h,1,System(mysql --user=root --password='1112' dialer -e 'UPDATE `list` SET `call_dispo`="${CDR(disposition)}" WHERE phone="${telephone}" and list_cp="${cp}"')
exten=>h,2,System(mysql --user=root --password='1112' dialer -e 'UPDATE `list` SET `calldate`="${STRFTIME(${EPOCH},,%d-%m-%Y-%H:%M:%S)}" WHERE phone="${telephone}" and list_cp="${cp}"')
;;query reserved future use
;;;exten=>h,3,ExecIf($["${CONFIRM}"= "9"]?System(mysql --user=root --password='1112' dialer -e "delete  from dnc where dnc_phone=100")


domingo, 18 de octubre de 2015

FreepBX cdr pass issue

/etc/amport*
/etc/freepbx.conf

mysql -p

use asterisk

update freepbx_settings set value ='';



Module: "FreePBX Framework", File: "/usr/sbin/amportal missing"


fix

     cp /usr/local/sbin/amportal /var/lib/asterisk/bin/amportal

 All you need to do is 'amportal a reload' (or click on the 'reload now' button) and that error will go away.

sábado, 17 de octubre de 2015

Asterisk node.js event

EVENT ASTERISK MANAGER

 
 
 
 
 
 
Rate This

npm install asterisk-manager
/home/node_modules/asterisk-manager/lib/test.js
test.js
var ami = new require(‘asterisk-manager’)(‘5038′,’192.168.0.105′,’username’,’password’, true);
// Listen for any/all AMI events.
ami.on(‘managerevent’, function(evt) {
console.log(‘EVENT ::’, evt);
});
// Listen for specific AMI events. A list of event names can be found at
// https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+AMI+Events
ami.on(‘hangup’, function(evt) {
console.log(‘HANGUP ::’, evt);
});
ami.on(‘confbridgejoin’, function(evt) {
console.log(‘CONFBRIDGEJOIN ::’, evt);
});
ami.on(‘close’, function(e) {
console.log(‘CLOSE ::’, e);
});
ami.on(‘disconnect’, function(e) {
console.log(‘DISCONNECT ::’, e);
});
ami.on(‘connect’, function(e) {
console.log(‘CONNECT ::’, e);
});
ami.action({
‘action’:’originate’,
‘channel’:’SIP/4001′,
‘context’:’default’,
‘exten’:1234,
‘priority’:1,
‘variables’:{
‘name1′:’value1’,
‘name2′:’value2’
}
}, function(err, res) {});


////////////////////

/**
 * port:  port server
 * host: host server
 * username: username for authentication
 * password: username's password for authentication
 * events: this parameter determines whether events are emited.
 **/
var ami = new require('asterisk-manager')('5038','localhost','admin','mypass456', true);

// In case of any connectiviy problems we got you coverd.
ami.keepConnected();


// Listen for any/all AMI events.
ami.on('managerevent', function(evt) {

});

// Listen for specific AMI events. A list of event names can be found at
// https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+AMI+Events
ami.on('hangup', function(evt) {

console.log('hangup ::', evt);
});
ami.on('confbridgejoin', function(evt) {});

// Listen for Action responses.
ami.on('response', function(evt) {});

// Perform an AMI Action. A list of actions can be found at
// https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+AMI+Actions
ami.action({
  'action':'originate',
  'channel':'SIP/102',
  'context':'internal',
  'exten':0,
  'priority':1,
  'variable':{
    'name1':'value1',
    'name2':'value2'
  }
}, function(err, res) {});


event ouput on hangup

hangup :: { event: 'Hangup',
  privilege: 'call,all',
  channel: 'SIP/102-00000003',
  channelstate: '6',
  channelstatedesc: 'Up',
  calleridnum: '102',
  calleridname: '<unknown>',
  connectedlinenum: '<unknown>',
  connectedlinename: '<unknown>',
  accountcode: '',
  context: 'internal',
  exten: 'h',
  priority: '2',
  uniqueid: '1445151668.6',
  cause: '16',
  'cause-txt': 'Normal Clearing' }

Asterisk Node.js

    apt-get install npm
    npm install asterisk-manager
    apt-get install node
    apt-get install nodejs-legacy

  echo  > console.log('Hello World');
root@asterisk-dominicana:~# node hello.js
Hello World

Doing the call script


/**
 * port:  port server
 * host: host server
 * username: username for authentication
 * password: username's password for authentication
 * events: this parameter determines whether events are emited.
 **/
var ami = new require('asterisk-manager')('5038','localhost','admin','mypass456', true);

// In case of any connectiviy problems we got you coverd.
ami.keepConnected();

// Listen for any/all AMI events.
ami.on('managerevent', function(evt) {});

// Listen for specific AMI events. A list of event names can be found at
// https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+AMI+Events
ami.on('hangup', function(evt) {});
ami.on('confbridgejoin', function(evt) {});

// Listen for Action responses.
ami.on('response', function(evt) {});

// Perform an AMI Action. A list of actions can be found at
// https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+AMI+Actions
ami.action({
  'action':'originate',
  'channel':'SIP/102',
  'context':'internal',
  'exten':0,
  'priority':1,
  'variable':{
    'name1':'value1',
    'name2':'value2'
  }
}, function(err, res) {});




running the script node call.js


http://www.igorescobar.com/blog/2014/08/13/working-with-asterisk-and-node-js/
https://github.com/pipobscure/NodeJS-AsteriskManager
https://www.sinologic.net/blog/2015-03/como-hacer-aplicaciones-node-js-y-asterisk.html

jueves, 15 de octubre de 2015

asterisk manager.conf

[general]
enabled = yes
webenabled = yes

port = 5038
bindaddr = 0.0.0.0

; authtimeout specifies the maximum number of seconds a client has to
; authenticate.  If the client does not authenticate beofre this timeout
; expires, the client will be disconnected. (default: 30 seconds)

authtimeout = 30

; authlimit specifies the maximum number of unauthenticated sessions that will
; be allowed to connect at any given time.



authlimit = 50


; If the device connected via this user accepts input slowly,
; the timeout for writes to it can be increased to keep it
; from being disconnected (value is in milliseconds)
;
writetimeout = 100


[admin]
secret=14564
deny = 0.0.0.0/0.0.0.0
permit= 0.0.0.0/0.0.0.0
;permit = 127.0.0.1/255.255.255.255
read = all,system,call,log,verbose,command,agent,user,config
write = all,system,call,log,verbose,command,agent,user,config

jueves, 8 de octubre de 2015

PRI Dialplan and Local Dialplan

PRI Dialplan and Local Dialplan

« Go Back

Information

Product FamilySwitchvox
Answer
The PRI Dialplan and the PRI Local Dialplan in the channel group section of a PRI have to do with caller ID and the TON or Type of Number. The Type Of Number is the dial plan or format that is used when setting or receiving caller ID.  What these settings do is set the called (number dialed) and calling number's (the Switchvox on an outbound call) caller ID Type of Number format. Depending on what the provider requires you may, on very rare occasions, need to set either or both of these settings to Unknown from the default of National ISDN. These settings should only be changed on very rare occasions and usually only to get outbound calls to work.   
Usually the symptoms are that long distance calls will work and local will not or vice versa. If you see this it is always best to try the Unknown TON as most providers who do not use the default National ISDN will allow the unknown.  

pridialplan=unknown
prilocaldialplan=unknown

ISDN hangup cause codes


 ISDN hangup cause codes
Solution
ISDN hangup cause codes provide information as to why a call has been terminated.  The list of hangup cause codes below provides detailed information as to the underlying cause behind a call hangup:
Code No. 0
This is usually given by the router when none of the other codes apply. This cause usually occurs in the same type of situations as cause 1, cause 88, and cause 100.
Code No. l - Unallocated (unassigned) number.
This cause indicates that the destination requested by the calling user cannot be reached because, although the number is in a valid format, it is not currently assigned (allocated).
What it usually means:
1.      The SPIDS may be incorrectly entered in the router or the Telco switch, giving a SPID failure in the router logs.
2.      The ISDN phone number being dialed by the router is invalid and the telco switch cannot locate the number to complete the call, as it is invalid.
3.      On long distance calls, the call cannot be properly routed to its destination.

Asterisk T1

Asterisk provides an open source solution for those who want to deploy VoIP in an organization, but don't want to invest a lot of money in a proprietary solution. After you get the software installed on a server, you have some more work to do. You have to connect your server to an outside voice line.
In this article, I'm going to show you how to set up the Asterisk Soft PBX system interface with a T1 PRI connection. Afterwards, you should be able to install a Zaptel-compatible PRI card, configure it for your needs, and modify your Asterisk dial plan to begin making outgoing phone calls from your internal SIP phones, as well as receive phone calls over your PRI line to your SIP clients.

Author's note

There are many different options for configuring your outgoing trunk, and it's impossible to cover all of the options in the scope of this article. What will be covered is the most common configuration in the United States, which is for a T1 PRI. I recommend that you become friendly with your sales/support representative and tech support, as you should ask questions about what the channel stepping method is, encodings, and D-Channel.

Zaptel device preparation

Before you can worry about making a connection, you should have Asterisk installed on your server, as well as have inserted and installed your PRI card into your server. To start the install process, you'll need libpri and the Zaptel package of drivers; you can download the sources to these packages from theAsterisk Web site. Since we are using the Gentoo distribution for our examples, you&'ll need to log in as root to install these (or su over the command shell). From here, you need to run emerge -pv libpri zaptel, as shown in Figure A.

Figure A


Run the emerge command to install Zaptel packages.
If you've installed Asterisk with all the USE flags, then you can probably skip this step, as these packages are already installed.
When installing these packages using emerge, you can view the available options with the -pv argument if you're using a BRI connection or require any additional settings for the Zaptel package. You can also add the appropriate USE flag in the /etc/portage/package.use file. For example, if you were using a BRI line, your package.use file may have these following entries.
net-libs/libpri bri
net-misc/zaptel bri

Zaptel device configuration

Now that you've installed the drivers needed by your PRI card, you'll need to load the appropriate module's using modprobe <module>. In this case, the command is modprobe wct1xxp.
Whatever your kernel module is, you'll probably want to have it automatically loaded when your server boots. To do this in Gentoo, just append the module name to /etc/modules.autoload.d/kernel-2.6 (if you're using the Linux kernel 2.4 series, this file is kernel-2.4).
Next, you'll need to configure the /etc/zaptel.conf with the options for Zaptel to understand how your PRI will behave. This is where you need to contact your support representative from your provider and find out a few configuration options, such as the required framing and coding (typically ESF framing and B8ZS coding). You'll also need to know what channels are your B (data) channels and which channel is your D (control) channel. Unless you're using a partial/split T1, your card will most likely be configured with 1-23 for your B channels and 24 for your control channel. For our T100P PRI card, this configuration in /etc/zaptel.conf looks like:
[/etc/zaptel.conf]
span=1,0,0,esf,b8zs
bchan=1-23
dchan=24
This defines one trunk group exists using ESF signaling and B8ZS coding. The trunk spans across B (data) channels 1-23, using channel 24 as the control (D) channel.
After setting the configuration and loading the Zaptel kernel modules, you can start the Zaptel service. The first time you start the service, you should begin with a verbose debug run to make sure everything is working. To do this, use the ztcfg -vv command. The results should list each of the channels and the status of the channel, as shown in Figure B.

miércoles, 7 de octubre de 2015

Conecting 2 asterisk boxes with IAX2

;;IP of the remote peer  in this case  5.181.118.23
[1005]
username=1005

secret=1010

host=5.181.118.23

type=friend

context=internal

qualify=yes

qualifyfreqok=25000

transfer=no

trunk=yes

forceencryption=no

encryption=yes

auth=md5

requirecalltoken=no

exten=>_9056,1,Dial(IAX2/1005/${EXTEN},25,tTkK)








;;IP of the remote peer  in this case  5.181.121.12

[1005]
username=1005

secret=1010

host=5.181.121.12

type=friend

context=internal

qualify=yes

qualifyfreqok=25000

transfer=no

trunk=yes

forceencryption=no

encryption=yes

auth=md5

requirecalltoken=no



[internal]
exten=>_9056,1,Answer()
same=>n,playback(demo-thanks).

lunes, 5 de octubre de 2015

Asterisk WebRTC Support Notes

Saltar al final de los metadatos
Ir al inicio de los metadatos
Icon
If you would like to test Asterisk with WebRTC you can now use the latest shipping Chrome. Audio should work great, but Asterisk 11 does not support the VP8 video codec used by Chrome at the time of this writing.
Passthrough support for the video codec VP8 (and Opus for audio) was added in Asterisk 12.

domingo, 4 de octubre de 2015

Solving One-way audio Problem on SPA962




Introduction

This article is one in a series to assist in the setup, troubleshooting, and maintenance of Cisco Small Business products (formerly Linksys Business Series).


Q. What can I do to resolve one-way audio problem?

A. One-way audio is usually caused by NAT firewall in the network. On your router, you need to unblock UDP ports 5060, 5061 and port range 16384-16482 by doing Port Forwarding. You might also need to disable "SPI firewall" if there is such function in your router.
In the event that Port Forwarding did not fix the problem you can follow the additional troubleshooting steps below on the SPA962.


sábado, 3 de octubre de 2015

FreePBX custom conferrence System

nano /etc/asterisk/extensions_custom.conf

[from-internal-custom]

exten =>_0280900374,1,Set(GLOBAL(LOOPCOUNT)=1)
same=>n,Read(conf,entering-conf-number)
same=>n,Set(LOOPCOUNT=$[${LOOPCOUNT} + 1])
same=>n,verbose(value of ${LOOPCOUNT})
same=>n,GotoIf($[${LOOPCOUNT} > 3]?hangup)
same=>n,goto(ext-meetme,${conf},1)
same=>n(hangup),Playback(im-sorry&goodbye)
same=>n,Hangup()
exten=>i,1,Goto(from-internal-custom,_0280900374,2)


nano /etc/asterisk/extensions_override_freepbx.conf

[ext-meetme]
exten=>i,1,Playback(im-sorry)
exten=>i,2,goto(from-internal-custom,0280900374,2)




then we can do  misc destination mapping to the 0280900374 and point our inbound route to that misc desc