Solved

Asterisk AMI making outbound calls

Posted on 2011-02-18
1
1,449 Views
Last Modified: 2012-06-21
Hi,

ok I want to create a way of calling outside numbers from the AMI. I can call internal numbers ok. But External do not work.

Now my extensions_custom.conf is as below:

[test]
exten => _9XXXXXXXXXXX,1,Dial(SIP/Voip Unlimited/${EXTEN:1})

Currently I'm puting in the below into the AMI:

Action: Originate
Channel: SIP/VoipUnlimited/908457203040
Context: test
CallerID: 01613584515
CallerIDName: Jason
Exten: 1001
Priority: 1

I get

Action: Originate
Channel: SIP/VoipUnlimited/908457203040
Context: test
CallerID: 01613584515
CallerIDName: Jason
Exten: 1001
Priority: 1

Response: Success
Message: Originate successfully queued

Event: Newchannel
Privilege: call,all
Channel: SIP/VoipUnlimited-0000001a
ChannelState: 0
ChannelStateDesc: Down
CallerIDNum:
CallerIDName:
AccountCode:
Exten:
Context: from-trunk
Uniqueid: 1297880290.26

Event: VarSet
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Variable: SIPCALLID
Value: 0c245fa46a5a29d213e381a87676b5e8@192.168.1.200
Uniqueid: 1297880290.26

Event: NewAccountCode
Privilege: call,all
Channel: SIP/VoipUnlimited-0000001a
Uniqueid: 1297880290.26
AccountCode:
OldAccountCode:

Event: NewCallerid
Privilege: call,all
Channel: SIP/VoipUnlimited-0000001a
CallerIDNum: 01613584515
CallerIDName:
Uniqueid: 1297880290.26
CID-CallingPres: 0 (Presentation Allowed, Not Screened)

Event: Newstate
Privilege: call,all
Channel: SIP/VoipUnlimited-0000001a
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum: 01613584515
CallerIDName:
Uniqueid: 1297880290.26

Event: Newexten
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Context: default
Extension: s
Priority: 1
Application: Playback
AppData: you-seem-impatient
Uniqueid: 1297880290.26

Event: VarSet
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Variable: PLAYBACKSTATUS
Value: SUCCESS
Uniqueid: 1297880290.26

Event: Newexten
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Context: default
Extension: s
Priority: 2
Application: Macro
AppData: hangupcall
Uniqueid: 1297880290.26

Event: VarSet
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Variable: MACRO_DEPTH
Value: 1
Uniqueid: 1297880290.26

Event: VarSet
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Variable: MACRO_EXTEN
Value: s
Uniqueid: 1297880290.26

Event: VarSet
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Variable: MACRO_CONTEXT
Value: default
Uniqueid: 1297880290.26

Event: VarSet
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Variable: MACRO_PRIORITY
Value: 2
Uniqueid: 1297880290.26

Event: VarSet
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Variable: MACRO_DEPTH
Value: 1
Uniqueid: 1297880290.26

Event: Newexten
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Context: macro-hangupcall
Extension: s
Priority: 1
Application: GotoIf
AppData: 1?skiprg
Uniqueid: 1297880290.26

Event: VarSet
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Variable: MACRO_DEPTH
Value: 1
Uniqueid: 1297880290.26

Event: Newexten
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Context: macro-hangupcall
Extension: s
Priority: 4
Application: GotoIf
AppData: 1?skipblkvm
Uniqueid: 1297880290.26

Event: VarSet
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Variable: MACRO_DEPTH
Value: 1
Uniqueid: 1297880290.26

Event: Newexten
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Context: macro-hangupcall
Extension: s
Priority: 7
Application: GotoIf
AppData: 1?theend
Uniqueid: 1297880290.26

Event: VarSet
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Variable: MACRO_DEPTH
Value: 1
Uniqueid: 1297880290.26

Event: Newexten
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Context: macro-hangupcall
Extension: s
Priority: 9
Application: Hangup
AppData:
Uniqueid: 1297880290.26

Event: VarSet
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Variable: MACRO_DEPTH
Value: 0
Uniqueid: 1297880290.26

Event: Newexten
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Context: default
Extension: h
Priority: 1
Application: Macro
AppData: hangupcall,
Uniqueid: 1297880290.26

Event: VarSet
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Variable: MACRO_IN_HANGUP
Value: 1
Uniqueid: 1297880290.26

Event: VarSet
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Variable: MACRO_DEPTH
Value: 1
Uniqueid: 1297880290.26

Event: VarSet
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Variable: MACRO_EXTEN
Value: h
Uniqueid: 1297880290.26

Event: VarSet
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Variable: MACRO_CONTEXT
Value: default
Uniqueid: 1297880290.26

Event: VarSet
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Variable: MACRO_PRIORITY
Value: 1
Uniqueid: 1297880290.26

Event: VarSet
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Variable: ARG1
Value:
Uniqueid: 1297880290.26

Event: VarSet
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Variable: MACRO_DEPTH
Value: 1
Uniqueid: 1297880290.26

Event: Newexten
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Context: macro-hangupcall
Extension: s
Priority: 1
Application: GotoIf
AppData: 1?skiprg
Uniqueid: 1297880290.26

Event: VarSet
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Variable: MACRO_DEPTH
Value: 1
Uniqueid: 1297880290.26

Event: Newexten
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Context: macro-hangupcall
Extension: s
Priority: 4
Application: GotoIf
AppData: 1?skipblkvm
Uniqueid: 1297880290.26

Event: VarSet
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Variable: MACRO_DEPTH
Value: 1
Uniqueid: 1297880290.26

Event: Newexten
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Context: macro-hangupcall
Extension: s
Priority: 7
Application: GotoIf
AppData: 1?theend
Uniqueid: 1297880290.26

Event: VarSet
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Variable: MACRO_DEPTH
Value: 1
Uniqueid: 1297880290.26

Event: Newexten
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Context: macro-hangupcall
Extension: s
Priority: 9
Application: Hangup
AppData:
Uniqueid: 1297880290.26

Event: VarSet
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Variable: MACRO_DEPTH
Value: 0
Uniqueid: 1297880290.26

Event: VarSet
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Variable: RTPAUDIOQOS
Value: ssrc=1446301995;themssrc=141353769;rxjitter=0.000946;rxcount=74;txcount=76;
Uniqueid: 1297880290.26

Event: VarSet
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Variable: RTPAUDIOQOSJITTER
Value: rxjitter=0.000946;
Uniqueid: 1297880290.26

Event: VarSet
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Variable: RTPAUDIOQOSLOSS
Value: lost=0;expected=74;
Uniqueid: 1297880290.26

Event: VarSet
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Variable: RTPAUDIOQOSRTT
Value: Not available
Uniqueid: 1297880290.26

Event: VarSet
Privilege: dialplan,all
Channel: SIP/VoipUnlimited-0000001a
Variable: RTPAUDIOQOS
Value:
Uniqueid: 1297880290.26

Event: Hangup
Privilege: call,all
Channel: SIP/VoipUnlimited-0000001a
Uniqueid: 1297880290.26
CallerIDNum: 01613584515
CallerIDName: <unknown>
Cause: 16
Cause-txt: Normal Clearing

Event: RTPReceiverStat
Privilege: reporting,all
SSRC: 141353769
ReceivedPackets: 74
LostPackets: 0
Jitter: 0.0009
Transit: -0.0050
RRCount: 0

Event: RTPSenderStat
Privilege: reporting,all
SSRC: 1446301995
SentPackets: 76
LostPackets: 0
Jitter: 0
SRCount: 0
RTT: 0.000000

Open in new window

0
Comment
Question by:andybrooke
1 Comment
 
LVL 25

Accepted Solution

by:
kode99 earned 500 total points
ID: 34929393
I think you will find that if you reverse this you it will work for you.

Action: Originate
Channel: <whatever the channel is you want to dial out from>
Context: test
CallerID: 01613584515
CallerIDName: Jason
Exten: 908457203040
Priority: 1

What will happen is the channel you set will ring and when you pick it up it will dial the extension/context/priority set.  So in this case dial 908... which will place the call through the dialplan to the external 908 number.

For internal calls it sort of works both ways because it rings one party then dials through to the other party when the first one picks up.  Who was first probably does not matter so much.

By trying to originate the voip unlimited channel with the context/exten you are essentially  trying to place a call on a channel to itself.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Article by: user_n
How Sip Phone (User Agent) works and communicates with sip servers 1.  There is a sip server and a sip registrar.  The sip server and sip registrar can be one server or two different servers. The sip registrar is the server on which it is record…
I recently purchased a Bluetooth headset called the Music Jogger (model BSH10). The control buttons on it look like this: One of my goals is to use it as the microphone and speakers for Skype calls. In that respect, it works well. However, I …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now