Record ANSWERED Call



I am using this dialplan to record incoming calls:

..... exten => 3331122,n,Set(MONITOR_FILE=${RECDIR}/${UNIQUEID}) exten => 3331122,n,MixMonitor(${MONITOR_FILE}.wav,b) exten => 3331122,n,GoSub(stdexten(${Ext1007})) exten => 3331122,n,Voicemail(1007@default,) exten => 3331122,n,Hangup()

The problem is it records all incoming calls include those with the disposition of "NO ANSWER, FAILED, BUSY, UNKNOWN.". For example the "NO ANSWER" call will leave a 44byte wav file in my ${RECDIR}

How can I record only the calls with the disposition of "ANSWERED"?

May be I should run a cronjob to clean up the 44byte file after it's been created? Is there a better way?



Asterisk Users 1.1 years ago 3 Answers

Pattern Extension Not Working In Dialplan



I created a dummy dialplan where I ask the user to enter the age.

[macro-age] exten => s,1,Background(my/age) ;;Play recorded message to enter age exten => s,n,WaitExten(10) exten => _XX,1,Set(AGE=${EXTEN}) ;; this line is not executing, instead dialplan is terminating with error given below. exten => s,n,NoOp(${AGE}) exten => s,n,GotoIf($[${LEN(${AGE})} > 0]?notEmpty) exten => s,n,Goto(s,1) exten => s(notEmpty),n,Background(my/thank-you) exten => s,n,Wait(1)

When I receive call and tries to enter the digits (86 lets say), it only accept just first digit and terminates even before considering second digit. Error message : WARNING[5726][C-0000000a]: pbx.c:6696 __ast_pbx_run: Invalid extension '8', but no rule 'i' or…

Asterisk Users 1.1 years ago 9 Answers

Rejecting A Call As If The Extension Does Not Exist.


I'm trying to address a problem with users transferring to invalid destinations.

In my sip peer I'm setting both __FORWARD_CONTEXT and __TRANSFER_CONTEXT to a context with a extension defined below to set some CDR variables before the call is transferred.

[customer-forward] exten => _X.,1,Progress() exten => _X.,n,Gosub(do-billing,s,1${EXTEN})) exten => _X,n,Goto(customer-internal,${EXTEN},1)

Now if my user Dials an invalid extension, Say '9595' from their sip phone they get back an 'Address Incomplete' message from their phone because it's not a valid extension defined in my dialplan.

If my user Transfers a call to '9595' the call gets transferred and then hung up on as there's no…

Asterisk Users 1.7 years ago 3 Answers

Callerid Overwrite


Hi all, I'm having issues with overwrite caller id, when I call someone my caller id should be "mycompanyinc" but instead my id shows up as my extension number 101.

this is what i have in sip.conf [101] type=friend context=sipphones call-limit

Asterisk Users 1.7 years ago 5 Answers

Problem With Call Transfer From One Server To Another Server


Dear All,

I have pri with E1 facility that have 30 line and 100 pri number which is provided by service provider.Number started like 23568561,23568562,23568563 and so on. Service provider provide last four digit number for did mapping like 4561,4562,4563.

exten => 8561,1,Dial(SIP/4001@,120,tT) exten => 8561,n,hangup()

exten => 8562,1,Dial(SIP/4001@,120,tT) exten => 8562,n,hangup()

Call comes into first server successful.But problem with second server when call came into second server i got following error:

* chan_sip.c:20063 handle_request_invite: Call from '' to extension '4001' rejected because extension not found.*

In one more scenario:

when i create one extension and call forwarding with this extension that time I'm able to…

Asterisk Users 2 years ago 3 Answers

Checking Messages From Outside The Network


Hello Everyone,

I am using the following dialplan to allow users to check their messages from PSTN world:

; Internal Routing exten => _1XX,1,Dial(SIP/${EXTEN}, 10) exten => _1XX,n,Wait(1) exten => _1XX,n,Answer exten => _1XX,n,Wait(1) exten => _1XX,n,Voicemail(${EXTEN},us) exten => _1XX,n,Hangup

The problem is that when the user presses `*#` to check his/her messages, it adds an additional message, even if there were no messages to begin with. I hope I am explaining this correctly. Can the dialplan be improved so that there is no additional message added when the owner is trying to check their mail box.

Kind Regards,


Asterisk Users 2.1 years ago 5 Answers

Dedicated Hangup Extension H



We have a Kamailio SIP Proxy in front of our Asterisk cluster for incoming calls from our carrier.

The sip.conf looks like this:

[kamailio1] type=friend host= context=incoming disallow=all allow=alaw

All calls hit the incoming extension. In the extensions.conf we have multiple extensions configured, but now I have to add one which uses the special h extension to perform a CURL action whenever the user hangs up. The problem is that once I've registered a h extension, it is executed for all extensions in the incoming context.

exten => _X.,1,Playback(invalid) exten => _X.,n,Hangup

exten => 1000,1,Playback(welcome) exten => 1000,n,Read(dtmfinput,,,,,15) exten => 1000,n,Hangup

exten => h,1,Set(response=${CURL(,var1=${dtmfinput}&var2=1000)})

Is it possible…

Asterisk Users 2.1 years ago 5 Answers

Blocking Spammer By CallerID "name"


I have a subroutine to block spammer by CALLERID(number)

exten => 4,1,GotoIf(${BLACKLIST()}?blacklisted,s,1) exten => 4,n,Set(goaway=${CALLERID(number):0:2}) exten => 4,n,GotoIf($["${goaway}" = "V4" ]?blacklisted,s,1) exten => 4,n,GotoIf($["${goaway}" = "V3" ]?blacklisted,s,1)

but I just got another spammer (automated calls) who rotates his callerID number that starts with valid area code so blocking by prefix is not practical but it seems to me he uses the same (or few same) caller name like:

"Brit. Columbia "" <16047726633>" "KHAN SHARON "" <16042984429>" "Brit. Columbia "" <16042231781>"

So I was thinking the same subroutine can be used to block by CALLERID(name), isn't it:

exten => 4,n,Set(goaway2=${CALLERID(name):0:11}) exten => 4,n,GotoIf($["${goaway2}" = "Brit. Colum"…

Asterisk Users 2.3 years ago 8 Answers

Asterisk 11 Dtmf Not Recognised



I have a dialplan as per the following,

extensions.conf [avgtest] exten = 100,n,Playback(avgtest/message1) exten = 100,n,Set(rightPIN=1) exten = 100,n,Read(inPIN,,1,,5,3) ; Attempts for 5 times with 3 seconds of timeout exten = 100,n,GotoIf($["${inPIN}" = "${rightPIN}"]?pin-accepted,1) exten = 100,n,Hangup() ; Didn't go to pin-accepted, so play badPIN and hangup exten=pinaccepted,1,Playback(avgtest/message2) ; correct pin, play

sipconf [1001] uername01 secret01 context=avgtest disallow=all allow=ulaw allow=alaw dtmfmode=auto type=friend host=dynamic canreinvite=yes relaxdtmf=yes

This looks very simple but dtmf is not recognised.

Am using asterisk 11.

Any suggestions is much appreciated.


Asterisk Users 2.4 years ago 5 Answers