Asterisk CDR Report shows "s" in the destination field - asterisk

I have had issue on an platform for quite sometime now, when somebody calls in to ivr system, the cdr report destination field shows an 's' in place of the called number.
The inbound route for the DID is set to the ivr menu.
Here is my dial plan:
"
exten => 800000031,1,Set(__FROM_DID=${EXTEN})
exten => 800000031,n,Gosub(app-blacklist-check,s,1)
exten => 800000031,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 800000031,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 800000031,n,Set(CALLERPRES()=allowed_not_screened)
exten => 800000031,n(dest-ext),Goto(ivr-3,s,1)*
"
I suspect the issue is on the last line but the file is not allowed to be edited directly.
Will appreciate any help.

s is the default extension in asterisk , go through the logs and try to find out on what context that call was executed. It usually happens when you do not create a context for any specific DID in extension.conf. then the call is being routed to asterisk default context

Use ${EXTEN} instead of s in Goto(ivr-3,s,1), Also in ivr-3 context create a dialplan using wildcard symbol. e.g
exten => 800000031,1,Set(__FROM_DID=${EXTEN})
exten => 800000031,n,Gosub(app-blacklist-check,${EXTEN},1)
exten => 800000031,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 800000031,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 800000031,n,Set(CALLERPRES()=allowed_not_screened)
exten => 800000031,n(dest-ext),Goto(ivr-3,${EXTEN},1)
[ivr-3]
exten => _X.,1,NoOp("Hello world")

We have an IVR. When an external caller listens to IVR and decides to hangup before IVR ends talking, in report we see "s" as Destination. Otherwise, in report we see extension dialed after or while IVR is talking. I guess it's normal. If You have been hacked You'd see other various destinations but not "s".

Solved on ours, there was no default destination set for the reception ring group. We pointed it back to the IVR and now no longer see the s destination.

Most likly that mean you have been hacked. Please check that you have no guest calls enabled, contact security expert to find hole and fix it.

Related

How to automatically add users to confbridge asterisk from dialplan?

[play-context]
exten => _X.,1,Answer()
exten => _X.,n,NoOp('Exten:')
exten => _X.,n,NoOp(${EXTEN})
exten => _X.,n,ConfBridge(dconf-${EXTEN}-${STRFTIME(${EPOCH},,%d.%m.%Y-%H:%M:%S)})
exten => _X.,n,Originate(SIP/5678,exten,conferences,100,1)
[conferences]
exten => _X.,1,NoOp(${EXTEN})
exten => _X.,n,ConfBridge(dconf-${EXTEN}-${STRFTIME(${EPOCH},,%d.%m.%Y-%H:%M:%S)})
when i create a new confBridge conference, i want to join some users in it. How i can do it automaticaly? I try this config, but it dont worked. Before this line
exten => _X.,n,Originate(SIP/5678,exten,conferences,100,1)
just does not reach. I do not understand why.
Please, help.
Your channel (your audio when you call the number of the conference) will enter in the conference when it comes to the Confbridge statement in your dialplan. The problem with Confbridge is that once the dialplan has arrived to the Confbridge statement, you will remain there until you exit from it. If you wanted to find there some friends you should have made some previous tasks
Check if the conference is stablished (if there are already other parties in them, see function CONFBRIDGE_INFO) and, if it is, simply add yourself to it
If not, stablish the conference inviting the guys you want to and add yourself to the conference
So, dialplan for conferences is usually not trivial. Let us assume that you do not want to make the first check. So, you are including a guy as you stablish the conference. In order to simplify and to avoid some headaches I am going to use a name for the conference that do not depend on the second at which the dialplan is read (depending on how do you mantain the dialplan your conference could be different from the conference at which you invite your mate), let us suppose that the conference has a name that only depends on the EXTEN dialed. You should do something similar to:
exten => _X,1,Answer()
...
same => n,Originate(SIP/5678,app,ConfBridge,"${EXTEN},rest-of-parameters-for-5678")
... (Check ORIGINATE_STATUS if you do really need your friend)
same => n,ConfBridge(${EXTEN},rest-of-parameters-for-youself)
Here I have used originate with the parameter app. You can, of course, follow the hint of #arheops and use exten with a Local channel. But if you do so, be carefull with the seconds ;).
If you want to stablish automatically the conferences as asterisk starts, consider including some originate statements in cli.conf.
When you do
Confbridge
it now in bridge and not go next extension until you exit bridge.
So you have do Originate BEFORE that or do it in other thread(via Local channel) in parallel.

How to install an application on Elastix?

Does anyone know, how to install an application on Elastix? In my case it is Answering Machine Detection(AMD). I need this application to detect outgoing calls, and if the answering machine is fax, hangup.
I tried to modify config files(modules.conf, extensions.conf, extensions_override_elastix.conf, amd.conf) as it is told in Asterisk documentation and forums, but non of it worked. CLI console doesn't show AMD output, and I think that AMD isn't even enabled there.
I've been looking for the answer for 3 or 4 weeks now and found almost nothing.
There must be something I've overlooked.
Maybe I should change something in the database(asterisk) or Elastix PBX settings?
Here's what I did:
Modified /etc/asterisk/amd.conf file. Appended this to the end:
[general]
initial_silence = 2250
greeting = 1500
after_greeting_silence = 1250
total_analysis_time = 5000
min_word_length = 100
between_words_silence = 50
maximum_number_of_words = 8
silence_threshold = 256
Modified /etc/asterisk/modules.conf. Appended this to the end:
load = > app_amd.so
Modified /etc/asterisk/extensions_override_elastix.conf
[outgoing] ;context
exten => s,1,Answer()
exten => s,n,AMD()
exten => s,n,NoOp(${AMDSTATUS})
exten => s,n,GotoIf($[${AMDSTATUS}=HUMAN]?humn:mach)
exten => s,n(mach),WaitForSilence(3000,1,20)
exten => s,n,Playback(${VOICEFILE})
exten => s,n,Hangup()
exten => s,n(humn),WaitForSilence(500)
exten => s,n,Playback(${VOICEFILE})
exten => s,n,Hangup()
Seeking for settings in database, in case if Elastix works through its database. Elastix writes logs into asterisk.cdr table - that's the only useful thing I've found.
I suppose, the CLI console should "say" something related to AMD application when I am calling, but it works as usual, without AMD enabled.
Thank you in advance!
You should add at options page to dialling param "M(amd)"
After that you should create macro-amd like described in manual.
That macro will be fired on call after call answered and before call bridged to other peer.

Vicidial SIP Trunk with Twilio

I need a step by step guide on configuring Twilio Elastic SIP Trunk on my Vicidial Server. I've been working it out for days now. Still can't make an outbound call. My account on twilio is still a trial account. thank you guys. :(
From vicidial admin panel, go to Admin >> Carriers
Add a new carrier named "myname"
**Replace "myname" with whatever you like but keep it consistent throughout the config. Anywhere you see "myname" replace it with the same value.
In the account entry section use this template:
Account Entry:
[myname]
type=peer
secret=mypassword ;if you created a Credentials list in Twilio the password goes here
username=myuser ;the Credentials username goes here
host=mytrunkname.pstn.twilio.com ;in Twilio this is your Termination SIP URI that you created under Elastic SIP Trunk settings
dtmfmode=rfc2833
canreinvite=no
disallow=all
allow=ulaw
insecure=port,invite
fromuser=+18005551234 ;the phone number associated with your trunk goes here
fromdomain=mytrunkname.pstn.twilio.com
Global String: DIAL9TRUNK = SIP/myname
Dialplan Entry:
exten => _91NXXNXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _91NXXNXXXXXX,n,Dial(${DIAL9TRUNK}/+1${EXTEN:2},,To)
exten => _91NXXNXXXXXX,n,Hangup
exten => _9NXXNXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _9NXXNXXXXXX,n,Dial(${DIAL9TRUNK}/+1${EXTEN:1},,tTo)
exten => _9NXXNXXXXXX,n,Hangup
That should activate outbound calling prefixed with the number 9. Meaning, dial 9 and then the number you want to dial as usual. You might want to remove all of my comments in the settings just to be safe. If you need any more help post back with your current config and I'll try to respond quickly.
Cheers!
The above answer is several years old, and I get emails asking how to add Twilio to Vicidial quite frequently. The problem is almost always with how you configure your Twilio account. I have to admit I have found the process fairly painful.
You going to need a unique trunk name for Twilio. I recommend you head to random.org and just use a random string. Copy one and paste it into a note.
You need to use a Twilio product called "Elastic SIP Trunking". Here's what you fill in when you create your new Twilio trunk:
Trunk Name: Vicidial
Call Recording: No
Secure Trunking: Disabled
Termination URI: [that random string from random.org].pstn.twilio.com
IP Access Control Lists: (add every public IP address of your Vicidial cluster that needs to dial)
Credential Lists: (here's what people tend to mess up in my experience; make sure these are set with both username and password - I'd copy and past them into a note for reference when trunking Vicidial)
Origination SIP URI: (add the public IP address of one server of your Vicidial cluster; I tend you pick the server that's set as the voicemail server)
Priority: 10
Weight: 10
Log into your Administration interface of your Vicidial system and head to Carriers (Administration → Admin → Carriers)
Click "Add A New Carrier". It's in the grey bar across the top.
Carrier ID: Twilio
Carrier Name: Elastic SIP Trunk
Carrier Description: (I leave that blank)
Registration String: (leave that blank)
Account Entry:
[twilio]
disallow=all
allow=ulaw
type=friend
secret=(password you created in "Credential Lists")
username=(user name you created in "Credential Lists")
host=(the value used in "Termination URI", e.g. wkR9PaMPvk9h.pstn.twilio.com)
dtmfmode=rfc2833
context=trunk-inbound
Globals String:
TWILIO = SIP/twilio
Dialplan Entry:
exten => _91XXXNXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _91XXXNXXXXXX,2,Dial(${TWILIO}/${EXTEN:1},,To)
exten => _91XXXNXXXXXX,3,Hangup
exten => _9XXXNXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _9XXXNXXXXXX,2,Dial(${TWILIO}/1${EXTEN:1},,To)
exten => _9XXXNXXXXXX,3,Hangup
exten => _1XXXNXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _1XXXNXXXXXX,2,Dial(${TWILIO}/${EXTEN},,To)
exten => _1XXXNXXXXXX,3,Hangup
exten => _XXXNXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _XXXNXXXXXX,2,Dial(${TWILIO}/1${EXTEN},,To)
exten => _XXXNXXXXXX,3,Hangup
Submit and ensure the carrier is saved as Active "Y" (you'll have to submit a second time). Wait a minute or two and you should be able to send calls to Twilio. If there's a problem, double and triple check your outbound Caller ID setting as Twilio will block calls if that's not set up perfectly.

Execute dialplan context from command line

I'm trying to execute an extension from the command line (via asterisk -rx "command") on a context that makes a AGI based query to determine which extension needs to be dialed (these extensions are updated on the DB).
It's something like this:
[autodialer]
exten => 2,1,Answer()
exten => 2,n,AGI(database_query.php); Makes a database query and generates vars
exten => 2,n,Set(CALLERID(name)=${db_customer_name}); Sets callerid from DB data
exten => 2,n,Dial(SIP/${db_customer_extension}); Also, extensions are stored on DB
exten => 2,n,Playback(custom/important_message)
exten => 2,n,SayDigits(${important_numbers}); The message, stored on DB too.
exten => h,1,Hangup()
Here, I need that context executed from command line, without having to dial it from any extension (it is supposed to be executed with a crontab every X time).
I tried with originate command, but I think I misunderstood the command syntax and didn't work.
I think that it should be something like: asterisk -rx "channel originate 2#autodialer" and then Asterisk executes that context and we're all happy with our important numbers.
I know that's not the right syntax, just trying to explain how I imagine it could work.
Thanks for your help.
There are no way do originate only one leg. You have supply second argument(other channel dest)
if you not need other channel, create context like this
[wait]
exten =>s,1,Wait(10000)
and use
asterisk -rx "channel originate 2#autodialer s#wait"
Read this article:
http://www.voip-info.org/wiki/view/Asterisk+auto-dial+out
NOTE: it is not recommended do diallout apps for people with less then 5 years dedicated asterisk experience. If you want one, use vicidial.org or other dialler.

Asterisk incoming call DID question (number dialed)

I am setting up a new Asterisk system at a hosted Asterisk provider using 1.4.38, moving from a self-hosted version 1.2. Whereas before I could do:
[incoming]
exten => _1NXXNXXXXXX,1,DoSomething
Now, it appears the incoming context will only get properly called if it is:
[incoming]
exten => s,1,DoSomething
How do I determine what number was dialed in this scenario? We have dozens of numbers and I need to be able to know which was called to route correctly...
Thanks,
Ben
You can use a pattern. I have this line in a running asterisk instance:
exten => 5858876463,1,Set(__FROM_DID=${EXTEN})
However, to answer your question, you can use the ${EXTEN} variable to decide what number was called. E.g.
exten => s,1,SomeScript(${EXTEN})

Resources