How to use asternet send command to asterisk

  • asternet download site :


  • asterisk server side config  (manager.conf)


deny + permit mean only allow this IP  visit

read = call mean afer connect AMI and asterisk  , asterisk only send call event to AMI ,this can avoid too many event been sent to AMI , since AMI is UDP connection .

  •  modify of asternet program :

a) in





their cresponding function is :


above code will let AMI recv call event include :  dialbegin , dialend , and hangup ,  then write these info in datagridview

add a button , in its click event , write :



this will generate 100 calls to asterisk , especially notice :


without this property , calls will not success . this answer come from my ask queston in :


  • here is full code    AsterNET   ,  pls check  winform project .



2018-6-1 modify 


上述方法是把 cdr 写到 datagridview 里, 但是,当cdr非常多的时候就不适合, 因此, 换一种方法, 只记录打通的电话次数和total duration ,  实现如下:


在 form 类定义



in some buttone ‘s click event , add :


in manager_DialEnd function , add


in call-hangup-events , add



textbox2  and textbox3 use to write calls and durations



in winform class , define


in construct function , write :

add function


start timer




problem to be solved when Migration of TB simple call

  •   当前状态  windows 部分

cctb1 连  TB015103    ,  配置网址在

cctb2 连 TB015104                     

cctb1 & cctb2 要安装的包括 :  TB一系列(mysql ,pcap….), VS2012,  radmin , license 激活, 现有配置(在mysql 数据库)怎么转移?

cctb1 & cctb2 最好把现有的系统做成镜像, 然后装进虚拟机。

cctb1 & cctb2 以及连接的 TB 目前都在 AIMS 机房, 虚拟机将来也放到那里 ? 如果虚拟机在office, 怎么连TB ?


  • linux    ( bridge 193,194,197 )

其中 193 , 194 类似,   需要安装 :   supervisord, java JDK ,

collector 需要让maxis 改那边的IP 白名单,

*** 重要, 确认193 和 194 是不是有直连 tb tsg 的实体线路,  因为 TSG 有

TDM line interface 






  •  要迁移的包括 :

a) 数据库 209 &  210 , and analyzer



  • 有两处调用 maxis :

a)  call maxis webservice  for serviceAuthen

b) telco bridge send SS7 to maxis IN

For point a) ,  there should be a whitelist IP in maxis side ,  this need ask them to change .

For b)


How to use asternet generate calls and monitor event

  • download asternet , set loging usename and pwd as manager.conf define .


  • after success login ,   use this code to make  a pjsip call


crespponding dialplan is :


  • if u  already login your zoiper to server ‘s sip contract 6001 , you will hear the ring .


  • if use this code


will invoke local channel calls on server .  cresponding dialplan is :


  • how to monitor event :



add :


full code of the three delegate functions is :


  • un-finish target : how to continuely  make many calls ?



sloved : can not register contract

  • Problem :


  • solution :

in cli , run


  • PS

some answer said :   in [AOR] section  of pjsip.conf


but after try , find not effect

various dialplans

  •  answer and play a prompt , wait 10 sec then hangup


asterisk *.conf files and their meaning

  • acl.conf    :       acl mean access control list ,

Example :


question :  I  register 2 sip user on my asterisk server , and after I set  deny= , this two number can still make call ,  why ?

  • cel.conf   :   cel mean channel event logging

Channel Event Logging is a mechanism to provide fine-grained event information that can be used to generate billing information. Such event information can be recorded to various backend modules.

question :    a)  channel how to define

b) if set to yes , where will the log file exist

c) how to logging USER_DEFINED event


  •  conbridge.conf   :    features like “MeetMe”  ,  implement call conference

for detail , ref :

  • manager.conf  :       AMI  —     the asterisk manager Interface

after enter cli mode  , type :

can view all manager command


for detail explain , see :


  • phone.conf

  • adsi.conf       :   no need to change

  • ccss.conf


asterisk 13 (compile with pjsip ) all available cli commands



  • sip set debug on/off                


how to use asterisk CLI command to make a call

  • version  :    Asterisk certified/13.18-cert3

  • pre requirement

create user and dial-plan as this page say :

  • enter asterisk cli by type :


  • run this command :

this command mean : use pjsip channel , make outgong call to 6001 , using dialplan 6001@from-internel .


  •  this will make a outgoing call to 6001


  • How to play a prompt and hangup ?

in asterisk 13 , sound files location is :  /var/lib/asterisk/sounds/en 

play prompt function is :

ref article :


so we change our dialplan to :


then run :

in cli ,  the result is :

you can see is playing .

But in actually , I do not hear anything , why ?           this is softphone problem , install zoipper on windows will solve it ans hear the prompt 


Notice :   if any command unknow , you can  use



yes this command can make a outgoing call to 6001 , but on mobile which register as 6001 , it can not see the incoming A number , what was shown is “anonymous”

So , how to let it display anyincoming number ?

One method is create call file  ,  like this :

create it in /tmp ,  and copy to


about detail of call file ,  reference from :



Very import  

if  create such a dialplan :


and in cli ,  type this command :


this call will use asterisk local channel

From article :

but no matter use local channel or not , still  not solve the problem : How to set calledID from cli command line :   channel originate 






How to use to exec above cli command in .net application