SIP dialing not working in agi script, but works in ext.conf

Hey all, I have a registered sip extension and when I use this command in extensions.conf it works fine:

exten => 5191233,1,Dial(SIP/2891,20)

the 5191233 being a DID that lands on my pri.

I’m using python and pyst and when i use the command:

sys.stdout.write(“EXEC DIAL DAHDI/G1/[telnum]”)

It works fine and dials out the phone number I want through PSTN.

But when I try the command:
sys.stdout.write(“EXEC DIAL SIP/2891”)
I get crash’s with no sip being dialed, I can’d even identify the return code for the crash,I have tried
Dial(SIP/2891)
and
Dial(sip/$[2891])

and no luck, anyone know what I can do?

What do you mean by a crash?

The script exits and no error codes are displayed in the CLI even with agi debug on. Does anyone have SIP dialing working with python or other agi’s that use the EXEC DIAL command?