Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1851
  • Last Modified:

Asterisk AMI making outbound calls

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
andybrooke
Asked:
andybrooke
1 Solution
 
kode99Commented:
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now