VoipJet IAX outbound with Manager API

Hello all,

Most of my work has been with inbound SIP, although recently I’ve moved to a new project requiring outbound calls. I registered an account with VoipJet for testing throughout the development process but I’m having issues getting the ball rolling…

I have a script which connects to Asterisk via the Manager API and places a call with Action Originate. From my script, I want to set the caller ID to 8005551212 and call 18883333333. When I run it, I get the following:

  == Parsing '/etc/asterisk/manager.conf': Found
  == Manager 'test' logged on from 127.0.0.1
    -- Executing SetCallerID("Local/18883333333@default-5e22,2", "8005551212") in new stack
    -- Executing Dial("Local/18883333333@default-5e22,2", "IAX2/9999@voipjet/18883333333|30") in new stack
    -- Called 9999@voipjet/18883333333
    -- Call accepted by 64.34.45.100 (format ulaw)
    -- Format for call is ulaw
    -- IAX2/voipjet-1 is making progress passing it to Local/18883333333@default-5e22,2
  == Manager 'test' logged off from 127.0.0.1
    -- Hungup 'IAX2/voipjet-1'
  == Spawn extension (default, 18883333333, 2) exited non-zero on 'Local/18883333333@default-5e22,2'

(my phone rings for a split second then the call terminates)

My configuration is as follows:

iax.conf

[voipjet]
type=peer
host=64.34.45.100
secret=***************
notransfer=yes
auth=md5
context=default
disallow=all
allow=ulaw
jitterbuffer=yes
dropcount=1

extensions.conf

[general]

static=yes
writeprotect=yes
autofallthrough=no

[globals]

; none

[dialout]
exten => outbound,1,Answer
exten => outbound,2,Playback(hello-world)
exten => outbound,3,Hangup

[default]
exten => _1NXXNXXXXXX,1,SetCallerID(8005551212)
exten => _1NXXNXXXXXX,2,Dial(IAX2/9999@voipjet/${EXTEN},30)

and my script is sending this to Asterisk:

Action: Originate
Channel: Local/18883333333@default
Extension: outbound
Context: default
Priority: 1
Timeout: 5000

I have tried many combinations of configurations in my script and dial plan and cannot get past the 1 sec ring, to execution of my answer and playback of sound. Please let me know if you see anything that stands out… hopefully Im not too far off

Well, after more tinkering it turns out everything was pretty much set up correctly… turns out my PHP socket code was bad…

Found StarAstAPI for PHP at starutilities.com/

Great stuff, works perfectly. Sorry about the useless post!