Originating a call

I have a SIP configured on my ATA. Let’s call this channel SIP/ata

I want to make calls from AMI to a cellphone. Here’s the command I am using:

Action: Originate
Channel: SIP/ata
Callerid: Support
Exten: 9XXXXXXXX4
Context: phones
Variable: ActionID=PlayBack
Variable: WhatToPlay=hello.mp3
Variable: WhoHear=SIP/ata
Priority: 1
Async: yes
ActionID: PlayBack

Now I am bit confused on the dialplan.

This is what I have:

exten => _X.,1,Answer()
same => n,UserEvent(BeforePlayBack,ActionID:${ActionID} & ${UNIQUEID} & ${CHANNEL} & ${WhatToPlay} & ${WhoHear})
same => n,Wait(0.3)
same => n,Playback(${WhatToPlay})
same => n,UserEvent(AfterPlayBack,ActionID:${ActionID} & ${UNIQUEID} & ${CHANNEL} & ${WhatToPlay} & ${WhoHear} & ${PLAYBACKSTATUS})
same => n,DIAL(SIP/ata/${EXTEN},60,rT)
same => n,Log(NOTICE, Call back queue result: ${DIALSTATUS})
same => n,Hangup()

But this simply gives me that the channel is busy, which is kind of obvious given that i just made a call to the channel, and i am then using the same channel to “dial”. I don’t really need to dial again as my ATA will by itself dial the extension. Instead I need to wait for the extension to be answered. Now that’s where the question lies, How!

Thanks for reading!

It doesn’t look like the dialplan you have would ever dial your cell phone, perhaps you are looking at the wrong context?

If I wanted to originate a call in your scenario I’d be using my ‘outgoing’ context that has dialplan that would call out to the PSTN.

[outgoing]
exten => _X.,1,NoOP()
 same => n,Dial(PJSIP/${EXTEN}@MyProvider,60)
 same => n,Playtones(busy)
 same => n,Busy(12)
 same => n,Hangup()


Action: Originate
Channel: SIP/ata
Exten: 5551234
Context: outgoing
Priority: 1

I had this setup, but since SIP/ata is my gateway, and I was dialing Dial(SIP/ata, 60, ${EXTEN}), I was always getting busy.

Correct me if I’m wrong but in your example, you have a sip user ata, and an external provider, no?

Yes my example was to call out from my ATA to the PSTN via my SIP provider.

If you wanted to play a sound to a cell phone you could do this:

Action: Originate
Channel: LOCAL/5551234@outgoing
Exten: s
Context: playback
Priority: 1

[playback]
exten => s,1,Playback(hello)
 same => n,Hangup()

[outgoing]
exten => _X.,1,NoOP()
 same => n,Dial(PJSIP/${EXTEN}@ata,60)
 same => n,Playtones(busy)
 same => n,Busy(12)
 same => n,Hangup()

This still doesn’t seem to have worked… However, it doesn’t fall back to busy. Here’s the full log:

Action: Originate
Channel: LOCAL/9XXXXXXXX5@outgoing
Exten: s
Context: playback
Priority: 1

Response: Success
Message: Originate successfully queued

Event: Newchannel
Privilege: call,all
Channel: Local/9XXXXXXXX5@outgoing-00000003;1
ChannelState: 0
ChannelStateDesc: Down
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: outgoing
Exten: 9XXXXXXXX5
Priority: 1
Uniqueid: 1522263654.17
Linkedid: 1522263654.17

Event: Newchannel
Privilege: call,all
Channel: Local/9XXXXXXXX5@outgoing-00000003;2
ChannelState: 4
ChannelStateDesc: Ring
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: outgoing
Exten: 9XXXXXXXX5
Priority: 1
Uniqueid: 1522263654.18
Linkedid: 1522263654.17

Event: Newexten
Privilege: call,all
Channel: Local/9XXXXXXXX5@outgoing-00000003;1
ChannelState: 0
ChannelStateDesc: Down
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: outgoing
Exten: 9XXXXXXXX5
Priority: 1
Uniqueid: 1522263654.17
Linkedid: 1522263654.17
Extension: 9XXXXXXXX5
Application: AppDial2
AppData: (Outgoing Line)

Event: LocalBridge
Privilege: call,all
LocalOneChannel: Local/9XXXXXXXX5@outgoing-00000003;1
LocalOneChannelState: 0
LocalOneChannelStateDesc: Down
LocalOneCallerIDNum:
LocalOneCallerIDName:
LocalOneConnectedLineNum:
LocalOneConnectedLineName:
LocalOneLanguage: en
LocalOneAccountCode:
LocalOneContext: outgoing
LocalOneExten: 9XXXXXXXX5
LocalOnePriority: 1
LocalOneUniqueid: 1522263654.17
LocalOneLinkedid: 1522263654.17
LocalTwoChannel: Local/9XXXXXXXX5@outgoing-00000003;2
LocalTwoChannelState: 4
LocalTwoChannelStateDesc: Ring
LocalTwoCallerIDNum:
LocalTwoCallerIDName:
LocalTwoConnectedLineNum:
LocalTwoConnectedLineName:
LocalTwoLanguage: en
LocalTwoAccountCode:
LocalTwoContext: outgoing
LocalTwoExten: 9XXXXXXXX5
LocalTwoPriority: 1
LocalTwoUniqueid: 1522263654.18
LocalTwoLinkedid: 1522263654.17
Context: outgoing
Exten: 9XXXXXXXX5
LocalOptimization: Yes

Event: DialBegin
Privilege: call,all
DestChannel: Local/9XXXXXXXX5@outgoing-00000003;1
DestChannelState: 0
DestChannelStateDesc: Down
DestCallerIDNum:
DestCallerIDName:
DestConnectedLineNum:
DestConnectedLineName:
DestLanguage: en
DestAccountCode:
DestContext: outgoing
DestExten: 9XXXXXXXX5
DestPriority: 1
DestUniqueid: 1522263654.17
DestLinkedid: 1522263654.17
DialString: 9XXXXXXXX5@outgoing

Event: TestEvent
Privilege: reporting,all
Type: StateChange
State: CallIDChange
AppFile: channel_internal_api.c
AppFunction: ast_channel_callid_set
AppLine: 949
State: CallIDChange
Channel: Local/9XXXXXXXX5@outgoing-00000003;2
CallID: [C-00000007]
PriorCallID:

Event: Newexten
Privilege: call,all
Channel: Local/9XXXXXXXX5@outgoing-00000003;2
ChannelState: 4
ChannelStateDesc: Ring
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: outgoing
Exten: 9XXXXXXXX5
Priority: 1
Uniqueid: 1522263654.18
Linkedid: 1522263654.17
Extension: 9XXXXXXXX5
Application: NoOp
AppData:

Event: Newexten
Privilege: call,all
Channel: Local/9XXXXXXXX5@outgoing-00000003;2
ChannelState: 4
ChannelStateDesc: Ring
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: outgoing
Exten: 9XXXXXXXX5
Priority: 2
Uniqueid: 1522263654.18
Linkedid: 1522263654.17
Extension: 9XXXXXXXX5
Application: Dial
AppData: SIP/9XXXXXXXX5@ata,60

Event: VarSet
Privilege: dialplan,all
Channel: Local/9XXXXXXXX5@outgoing-00000003;2
ChannelState: 4
ChannelStateDesc: Ring
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: outgoing
Exten: 9XXXXXXXX5
Priority: 2
Uniqueid: 1522263654.18
Linkedid: 1522263654.17
Variable: DIALSTATUS
Value:

Event: VarSet
Privilege: dialplan,all
Channel: Local/9XXXXXXXX5@outgoing-00000003;2
ChannelState: 4
ChannelStateDesc: Ring
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: outgoing
Exten: 9XXXXXXXX5
Priority: 2
Uniqueid: 1522263654.18
Linkedid: 1522263654.17
Variable: DIALEDPEERNUMBER
Value:

Event: VarSet
Privilege: dialplan,all
Channel: Local/9XXXXXXXX5@outgoing-00000003;2
ChannelState: 4
ChannelStateDesc: Ring
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: outgoing
Exten: 9XXXXXXXX5
Priority: 2
Uniqueid: 1522263654.18
Linkedid: 1522263654.17
Variable: DIALEDPEERNAME
Value:

Event: VarSet
Privilege: dialplan,all
Channel: Local/9XXXXXXXX5@outgoing-00000003;2
ChannelState: 4
ChannelStateDesc: Ring
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: outgoing
Exten: 9XXXXXXXX5
Priority: 2
Uniqueid: 1522263654.18
Linkedid: 1522263654.17
Variable: ANSWEREDTIME
Value:

Event: VarSet
Privilege: dialplan,all
Channel: Local/9XXXXXXXX5@outgoing-00000003;2
ChannelState: 4
ChannelStateDesc: Ring
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: outgoing
Exten: 9XXXXXXXX5
Priority: 2
Uniqueid: 1522263654.18
Linkedid: 1522263654.17
Variable: DIALEDTIME
Value:

Event: Newchannel
Privilege: call,all
Channel: SIP/ata-00000004
ChannelState: 0
ChannelStateDesc: Down
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: phones
Exten: s
Priority: 1
Uniqueid: 1522263654.19
Linkedid: 1522263654.17

Event: TestEvent
Privilege: reporting,all
Type: StateChange
State: CallIDChange
AppFile: channel_internal_api.c
AppFunction: ast_channel_callid_set
AppLine: 949
State: CallIDChange
Channel: SIP/ata-00000004
CallID: [C-00000007]
PriorCallID:

Event: VarSet
Privilege: dialplan,all
Channel: SIP/ata-00000004
ChannelState: 0
ChannelStateDesc: Down
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: phones
Exten: s
Priority: 1
Uniqueid: 1522263654.19
Linkedid: 1522263654.17
Variable: SIPCALLID
Value: 4eb3f235762cde6740c1085e7a689a95@192.168.1.13:5060

Event: TestEvent
Privilege: reporting,all
Type: StateChange
State: CallIDChange
AppFile: channel_internal_api.c
AppFunction: ast_channel_callid_set
AppLine: 949
State: CallIDChange
Channel: SIP/ata-00000004
CallID: [C-00000007]
PriorCallID: [C-00000007]

Event: VarSet
Privilege: dialplan,all
Channel: SIP/ata-00000004
ChannelState: 0
ChannelStateDesc: Down
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: phones
Exten:
Priority: 1
Uniqueid: 1522263654.19
Linkedid: 1522263654.17
Variable: DIALEDPEERNUMBER
Value: 9XXXXXXXX5@ata

Event: Newexten
Privilege: call,all
Channel: SIP/ata-00000004
ChannelState: 0
ChannelStateDesc: Down
CallerIDNum: 9XXXXXXXX5
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: phones
Exten: 9XXXXXXXX5
Priority: 1
Uniqueid: 1522263654.19
Linkedid: 1522263654.17
Extension: 9XXXXXXXX5
Application: AppDial
AppData: (Outgoing Line)

Event: NewCallerid
Privilege: call,all
Channel: SIP/ata-00000004
ChannelState: 0
ChannelStateDesc: Down
CallerIDNum: 9XXXXXXXX5
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: phones
Exten: 9XXXXXXXX5
Priority: 1
Uniqueid: 1522263654.19
Linkedid: 1522263654.17
CID-CallingPres: 0 (Presentation Allowed, Not Screened)

Event: DialBegin
Privilege: call,all
Channel: Local/9XXXXXXXX5@outgoing-00000003;2
ChannelState: 4
ChannelStateDesc: Ring
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: outgoing
Exten: 9XXXXXXXX5
Priority: 2
Uniqueid: 1522263654.18
Linkedid: 1522263654.17
DestChannel: SIP/ata-00000004
DestChannelState: 0
DestChannelStateDesc: Down
DestCallerIDNum: 9XXXXXXXX5
DestCallerIDName:
DestConnectedLineNum:
DestConnectedLineName:
DestLanguage: en
DestAccountCode:
DestContext: phones
DestExten: 9XXXXXXXX5
DestPriority: 1
DestUniqueid: 1522263654.19
DestLinkedid: 1522263654.17
DialString: 9XXXXXXXX5@ata

Event: Newstate
Privilege: call,all
Channel: SIP/ata-00000004
ChannelState: 5
ChannelStateDesc: Ringing
CallerIDNum: 9XXXXXXXX5
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: phones
Exten: 9XXXXXXXX5
Priority: 1
Uniqueid: 1522263654.19
Linkedid: 1522263654.17

Event: Newstate
Privilege: call,all
Channel: Local/9XXXXXXXX5@outgoing-00000003;1
ChannelState: 5
ChannelStateDesc: Ringing
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: outgoing
Exten: 9XXXXXXXX5
Priority: 1
Uniqueid: 1522263654.17
Linkedid: 1522263654.17

Event: DeviceStateChange
Privilege: call,all
Device: Local/9XXXXXXXX5@outgoing
State: INUSE

Event: Newstate
Privilege: call,all
Channel: SIP/ata-00000004
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum: 9XXXXXXXX5
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: phones
Exten: 9XXXXXXXX5
Priority: 1
Uniqueid: 1522263654.19
Linkedid: 1522263654.17

Event: VarSet
Privilege: dialplan,all
Channel: Local/9XXXXXXXX5@outgoing-00000003;2
ChannelState: 4
ChannelStateDesc: Ring
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: outgoing
Exten: 9XXXXXXXX5
Priority: 2
Uniqueid: 1522263654.18
Linkedid: 1522263654.17
Variable: DIALSTATUS
Value: ANSWER

Event: VarSet
Privilege: dialplan,all
Channel: Local/9XXXXXXXX5@outgoing-00000003;2
ChannelState: 4
ChannelStateDesc: Ring
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: outgoing
Exten: 9XXXXXXXX5
Priority: 2
Uniqueid: 1522263654.18
Linkedid: 1522263654.17
Variable: DIALEDPEERNAME
Value: SIP/ata-00000004

Event: VarSet
Privilege: dialplan,all
Channel: Local/9XXXXXXXX5@outgoing-00000003;2
ChannelState: 4
ChannelStateDesc: Ring
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: outgoing
Exten: 9XXXXXXXX5
Priority: 2
Uniqueid: 1522263654.18
Linkedid: 1522263654.17
Variable: DIALEDPEERNUMBER
Value: 9XXXXXXXX5@ata

Event: DialEnd
Privilege: call,all
Channel: Local/9XXXXXXXX5@outgoing-00000003;2
ChannelState: 4
ChannelStateDesc: Ring
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: outgoing
Exten: 9XXXXXXXX5
Priority: 2
Uniqueid: 1522263654.18
Linkedid: 1522263654.17
DestChannel: SIP/ata-00000004
DestChannelState: 6
DestChannelStateDesc: Up
DestCallerIDNum: 9XXXXXXXX5
DestCallerIDName:
DestConnectedLineNum:
DestConnectedLineName:
DestLanguage: en
DestAccountCode:
DestContext: phones
DestExten:
DestPriority: 1
DestUniqueid: 1522263654.19
DestLinkedid: 1522263654.17
DialStatus: ANSWER

Event: Newstate
Privilege: call,all
Channel: Local/9XXXXXXXX5@outgoing-00000003;2
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: outgoing
Exten: 9XXXXXXXX5
Priority: 2
Uniqueid: 1522263654.18
Linkedid: 1522263654.17

Event: Newstate
Privilege: call,all
Channel: Local/9XXXXXXXX5@outgoing-00000003;1
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: outgoing
Exten: 9XXXXXXXX5
Priority: 1
Uniqueid: 1522263654.17
Linkedid: 1522263654.17

Event: DeviceStateChange
Privilege: call,all
Device: Local/9XXXXXXXX5@outgoing
State: INUSE

Event: DialEnd
Privilege: call,all
DestChannel: Local/9XXXXXXXX5@outgoing-00000003;1
DestChannelState: 6
DestChannelStateDesc: Up
DestCallerIDNum:
DestCallerIDName:
DestConnectedLineNum:
DestConnectedLineName:
DestLanguage: en
DestAccountCode:
DestContext: outgoing
DestExten: 9XXXXXXXX5
DestPriority: 1
DestUniqueid: 1522263654.17
DestLinkedid: 1522263654.17
DialStatus: ANSWER

Event: DeviceStateChange
Privilege: call,all
Device: Local/9XXXXXXXX5@outgoing
State: INUSE

Event: BridgeCreate
Privilege: call,all
BridgeUniqueid: afcaeee6-7b18-4e14-a4a0-0a413fe33916
BridgeType: basic
BridgeTechnology: simple_bridge
BridgeCreator:
BridgeName:
BridgeNumChannels: 0
BridgeVideoSourceMode: none

Event: Newexten
Privilege: call,all
Channel: SIP/ata-00000004
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum: 9XXXXXXXX5
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: phones
Exten:
Priority: 1
Uniqueid: 1522263654.19
Linkedid: 1522263654.17
Extension:
Application: AppDial
AppData: (Outgoing Line)

Event: BridgeEnter
Privilege: call,all
BridgeUniqueid: afcaeee6-7b18-4e14-a4a0-0a413fe33916
BridgeType: basic
BridgeTechnology: simple_bridge
BridgeCreator:
BridgeName:
BridgeNumChannels: 1
BridgeVideoSourceMode: none
Channel: SIP/ata-00000004
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum: 9XXXXXXXX5
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: phones
Exten:
Priority: 1
Uniqueid: 1522263654.19
Linkedid: 1522263654.17

Event: BridgeEnter
Privilege: call,all
BridgeUniqueid: afcaeee6-7b18-4e14-a4a0-0a413fe33916
BridgeType: basic
BridgeTechnology: simple_bridge
BridgeCreator:
BridgeName:
BridgeNumChannels: 2
BridgeVideoSourceMode: none
Channel: Local/9XXXXXXXX5@outgoing-00000003;2
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: outgoing
Exten: 9XXXXXXXX5
Priority: 2
Uniqueid: 1522263654.18
Linkedid: 1522263654.17

Event: VarSet
Privilege: dialplan,all
Channel: SIP/ata-00000004
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum: 9XXXXXXXX5
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: phones
Exten:
Priority: 1
Uniqueid: 1522263654.19
Linkedid: 1522263654.17
Variable: BRIDGEPEER
Value: Local/9XXXXXXXX5@outgoing-00000003;2

Event: VarSet
Privilege: dialplan,all
Channel: Local/9XXXXXXXX5@outgoing-00000003;2
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: outgoing
Exten: 9XXXXXXXX5
Priority: 2
Uniqueid: 1522263654.18
Linkedid: 1522263654.17
Variable: BRIDGEPEER
Value: SIP/ata-00000004

Event: VarSet
Privilege: dialplan,all
Channel: Local/9XXXXXXXX5@outgoing-00000003;2
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: outgoing
Exten: 9XXXXXXXX5
Priority: 2
Uniqueid: 1522263654.18
Linkedid: 1522263654.17
Variable: BRIDGEPVTCALLID
Value: 4eb3f235762cde6740c1085e7a689a95@192.168.1.13:5060

Event: TestEvent
Privilege: reporting,all
Type: StateChange
State: CallIDChange
AppFile: channel_internal_api.c
AppFunction: ast_channel_callid_set
AppLine: 949
State: CallIDChange
Channel: Local/9XXXXXXXX5@outgoing-00000003;1
CallID: [C-00000008]
PriorCallID:

Event: Newexten
Privilege: call,all
Channel: Local/9XXXXXXXX5@outgoing-00000003;1
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: playback
Exten: s
Priority: 1
Uniqueid: 1522263654.17
Linkedid: 1522263654.17
Extension: s
Application: Playback
AppData: hello

Event: VarSet
Privilege: dialplan,all
Channel: Local/9XXXXXXXX5@outgoing-00000003;1
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: playback
Exten: s
Priority: 1
Uniqueid: 1522263654.17
Linkedid: 1522263654.17
Variable: PLAYBACKSTATUS
Value: FAILED

Event: Newexten
Privilege: call,all
Channel: Local/9XXXXXXXX5@outgoing-00000003;1
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: playback
Exten: s
Priority: 2
Uniqueid: 1522263654.17
Linkedid: 1522263654.17
Extension: s
Application: Hangup
AppData:

Event: SoftHangupRequest
Privilege: call,all
Channel: Local/9XXXXXXXX5@outgoing-00000003;1
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: playback
Exten: s
Priority: 2
Uniqueid: 1522263654.17
Linkedid: 1522263654.17
Cause: 16

Event: HangupRequest
Privilege: call,all
Channel: Local/9XXXXXXXX5@outgoing-00000003;2
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: outgoing
Exten: 9XXXXXXXX5
Priority: 2
Uniqueid: 1522263654.18
Linkedid: 1522263654.17
Cause: 16

Event: Hangup
Privilege: call,all
Channel: Local/9XXXXXXXX5@outgoing-00000003;1
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: playback
Exten: s
Priority: 2
Uniqueid: 1522263654.17
Linkedid: 1522263654.17
Cause: 16
Cause-txt: Normal Clearing

Event: DeviceStateChange
Privilege: call,all
Device: Local/9XXXXXXXX5@outgoing
State: NOT_INUSE

Event: VarSet
Privilege: dialplan,all
Channel: Local/9XXXXXXXX5@outgoing-00000003;2
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: outgoing
Exten: 9XXXXXXXX5
Priority: 2
Uniqueid: 1522263654.18
Linkedid: 1522263654.17
Variable: BRIDGEPEER
Value:

Event: VarSet
Privilege: dialplan,all
Channel: Local/9XXXXXXXX5@outgoing-00000003;2
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: outgoing
Exten: 9XXXXXXXX5
Priority: 2
Uniqueid: 1522263654.18
Linkedid: 1522263654.17
Variable: BRIDGEPVTCALLID
Value:

Event: VarSet
Privilege: dialplan,all
Channel: SIP/ata-00000004
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum: 9XXXXXXXX5
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: phones
Exten:
Priority: 1
Uniqueid: 1522263654.19
Linkedid: 1522263654.17
Variable: BRIDGEPEER
Value:

Event: BridgeLeave
Privilege: call,all
BridgeUniqueid: afcaeee6-7b18-4e14-a4a0-0a413fe33916
BridgeType: basic
BridgeTechnology: simple_bridge
BridgeCreator:
BridgeName:
BridgeNumChannels: 1
BridgeVideoSourceMode: none
Channel: Local/9XXXXXXXX5@outgoing-00000003;2
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: outgoing
Exten: 9XXXXXXXX5
Priority: 2
Uniqueid: 1522263654.18
Linkedid: 1522263654.17

Event: VarSet
Privilege: dialplan,all
Channel: Local/9XXXXXXXX5@outgoing-00000003;2
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: outgoing
Exten: 9XXXXXXXX5
Priority: 2
Uniqueid: 1522263654.18
Linkedid: 1522263654.17
Variable: ANSWEREDTIME
Value: 0

Event: VarSet
Privilege: dialplan,all
Channel: Local/9XXXXXXXX5@outgoing-00000003;2
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: outgoing
Exten: 9XXXXXXXX5
Priority: 2
Uniqueid: 1522263654.18
Linkedid: 1522263654.17
Variable: DIALEDTIME
Value: 3

Event: VarSet
Privilege: dialplan,all
Channel: Local/9XXXXXXXX5@outgoing-00000003;2
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: outgoing
Exten: 9XXXXXXXX5
Priority: 2
Uniqueid: 1522263654.18
Linkedid: 1522263654.17
Variable: DIALSTATUS
Value: ANSWER

Event: SoftHangupRequest
Privilege: call,all
Channel: Local/9XXXXXXXX5@outgoing-00000003;2
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: outgoing
Exten: 9XXXXXXXX5
Priority: 2
Uniqueid: 1522263654.18
Linkedid: 1522263654.17
Cause: 16

Event: Hangup
Privilege: call,all
Channel: Local/9XXXXXXXX5@outgoing-00000003;2
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum:
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: outgoing
Exten: 9XXXXXXXX5
Priority: 2
Uniqueid: 1522263654.18
Linkedid: 1522263654.17
Cause: 16
Cause-txt: Normal Clearing

Event: DeviceStateChange
Privilege: call,all
Device: Local/9XXXXXXXX5@outgoing
State: NOT_INUSE

Event: BridgeLeave
Privilege: call,all
BridgeUniqueid: afcaeee6-7b18-4e14-a4a0-0a413fe33916
BridgeType: basic
BridgeTechnology: simple_bridge
BridgeCreator:
BridgeName:
BridgeNumChannels: 0
BridgeVideoSourceMode: none
Channel: SIP/ata-00000004
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum: 9XXXXXXXX5
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: phones
Exten:
Priority: 1
Uniqueid: 1522263654.19
Linkedid: 1522263654.17

Event: BridgeDestroy
Privilege: call,all
BridgeUniqueid: afcaeee6-7b18-4e14-a4a0-0a413fe33916
BridgeType: basic
BridgeTechnology: simple_bridge
BridgeCreator:
BridgeName:
BridgeNumChannels: 0
BridgeVideoSourceMode: none

Event: VarSet
Privilege: dialplan,all
Channel: SIP/ata-00000004
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum: 9XXXXXXXX5
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: phones
Exten:
Priority: 1
Uniqueid: 1522263654.19
Linkedid: 1522263654.17
Variable: RTPAUDIOQOS
Value: ssrc=646401849;themssrc=0;lp=0;rxjitter=0.000000;rxcount=0;txjitter=0.000000;txcount=0;rlp=0;rtt=0.000000

Event: VarSet
Privilege: dialplan,all
Channel: SIP/ata-00000004
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum: 9XXXXXXXX5
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: phones
Exten:
Priority: 1
Uniqueid: 1522263654.19
Linkedid: 1522263654.17
Variable: RTPAUDIOQOSJITTER
Value: minrxjitter=0.000000;maxrxjitter=0.000000;avgrxjitter=0.000000;stdevrxjitter=0.000000;reported_minjitter=0.000000;reported_maxjitter=0.000000;reported_avgjitter=0.000000;reported_stdevjitter=0.000000;

Event: VarSet
Privilege: dialplan,all
Channel: SIP/ata-00000004
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum: 9XXXXXXXX5
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: phones
Exten:
Priority: 1
Uniqueid: 1522263654.19
Linkedid: 1522263654.17
Variable: RTPAUDIOQOSLOSS
Value: minrxlost=0.000000;maxrxlost=0.000000;avgrxlost=0.000000;stdevrxlost=0.000000;reported_minlost=0.000000;reported_maxlost=0.000000;reported_avglost=0.000000;reported_stdevlost=0.000000;

Event: VarSet
Privilege: dialplan,all
Channel: SIP/ata-00000004
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum: 9XXXXXXXX5
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: phones
Exten:
Priority: 1
Uniqueid: 1522263654.19
Linkedid: 1522263654.17
Variable: RTPAUDIOQOSRTT
Value: minrtt=0.000000;maxrtt=0.000000;avgrtt=0.000000;stdevrtt=0.000000;

Event: VarSet
Privilege: dialplan,all
Channel: SIP/ata-00000004
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum: 9XXXXXXXX5
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: phones
Exten:
Priority: 1
Uniqueid: 1522263654.19
Linkedid: 1522263654.17
Variable: RTPAUDIOQOS
Value: ssrc=646401849;themssrc=0;lp=0;rxjitter=0.000000;rxcount=0;txjitter=0.000000;txcount=0;rlp=0;rtt=0.000000

Event: Hangup
Privilege: call,all
Channel: SIP/ata-00000004
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum: 9XXXXXXXX5
CallerIDName:
ConnectedLineNum:
ConnectedLineName:
Language: en
AccountCode:
Context: phones
Exten:
Priority: 1
Uniqueid: 1522263654.19
Linkedid: 1522263654.17
Cause: 16
Cause-txt: Normal Clearing

Sorry for being such a bum!

Console log would be a lot more useful here.

Also I’m writing PJSIP syntax and you appear to be using chan_sip so your Dial will be different than mine, Dial(SIP/ata/${EXTEN}) vs Dial(PJSIP/${EXTEN}@ata)

Changed the format. Here’s the console

– Executing [9XXXXXXXX4@outgoing:1] NoOp(“Local/9XXXXXXXX4@outgoing-00000005;2”, “”) in new stack
– Called 9XXXXXXXX4@outgoing
– Executing [9XXXXXXXX4@outgoing:2] Dial(“Local/9XXXXXXXX4@outgoing-00000005;2”, “SIP/ata/9XXXXXXXX4,60”) in new stack
== Using SIP RTP CoS mark 5
– Called SIP/ata/9XXXXXXXX4
– SIP/ata-00000006 is ringing
– Local/9XXXXXXXX4@outgoing-00000005;1 is ringing
> 0x7f6620016650 – Strict RTP learning after remote address set to: 192.168.1.3:35590
– SIP/ata-00000006 answered Local/9XXXXXXXX4@outgoing-00000005;2
– Local/9XXXXXXXX4@outgoing-00000005;1 answered
– Executing [s@playback:1] SayPhonetic(“Local/9XXXXXXXX4@outgoing-00000005;1”, “hello”) in new stack
– Channel SIP/ata-00000006 joined ‘simple_bridge’ basic-bridge <83a53f7f-6d1a-4c96-9623-818949b5211f>
– Channel Local/9XXXXXXXX4@outgoing-00000005;2 joined ‘simple_bridge’ basic-bridge <83a53f7f-6d1a-4c96-9623-818949b5211f>
– <Local/9XXXXXXXX4@outgoing-00000005;1> Playing ‘phonetic/h_p.gsm’ (language ‘en’)
> 0x7f6620016650 – Strict RTP switching to RTP target address 192.168.1.3:35590 as source
– <Local/9XXXXXXXX4@outgoing-00000005;1> Playing ‘phonetic/e_p.gsm’ (language ‘en’)
> 0x7f6620016650 – Strict RTP learning complete - Locking on source address 192.168.1.3:35590
– <Local/9XXXXXXXX4@outgoing-00000005;1> Playing ‘phonetic/l_p.gsm’ (language ‘en’)
– <Local/9XXXXXXXX4@outgoing-00000005;1> Playing ‘phonetic/l_p.gsm’ (language ‘en’)
– <Local/9XXXXXXXX4@outgoing-00000005;1> Playing ‘phonetic/o_p.gsm’ (language ‘en’)
– Executing [s@playback:2] Hangup(“Local/9XXXXXXXX4@outgoing-00000005;1”, “”) in new stack
== Spawn extension (playback, s, 2) exited non-zero on ‘Local/9XXXXXXXX4@outgoing-00000005;1’
– Channel Local/9XXXXXXXX4@outgoing-00000005;2 left ‘simple_bridge’ basic-bridge <83a53f7f-6d1a-4c96-9623-818949b5211f>
– Channel SIP/ata-00000006 left ‘simple_bridge’ basic-bridge <83a53f7f-6d1a-4c96-9623-818949b5211f>
== Spawn extension (outgoing, 9XXXXXXXX4, 2) exited non-zero on ‘Local/9XXXXXXXX4@outgoing-00000005;2’

That to me looks like a successful test call,

I see where you dialed, something on the far end answered and you played back media once the channels were bridged.

But my cellphone never rang.

It is possible you got an error back from the PSTN.

Can you attach another phone to the same line the ATA is connected to and supervise the call and listen for errors?

In the FXS port? Let me try

Meanwhile, one thing that seem odd is that as soon as I send the originate command, in just seconds I can see the hangup event. It’s kind of impossible for the call to have been dialled and connected in this small time

It’s been a long time since I used an ATA to talk to the PSTN but I believe there isn’t any answer supervision so the call will be immediately answered.

so there’s no way I can make it dial and wait for an answer before the playback happens to the cellphone?

When you originate a call the dialplan will execute as soon as the call is answered.

You could add in a WAIT() statement or use something like AMD to tell when a human answers.

https://wiki.asterisk.org/wiki/display/AST/Application_AMD

Otherwise I’d suggest trying a pure SIP solution and get rid of the ATA. Your limited to a single channel with the ATA anyway.

If the network operator can or does provide polarity reversal supervision for answer, you can use Digium analogue cards, with that enabled. I’m not sure that cheap VoIP gateways support supervision, even if the network does.

If answer and disconnect matter to you, you should use ISDN, or go through an ITSP that, in turn, uses ISDN.