I figured out I can make an outbound call from the CLI in Python as follows:
 
        def fsapi(session, stream, env, args):
          session = Session("{ignore_early_media=true}sofia/gateway/" + SIP_CARRIER + "/" + phone_number)
Unfortunately, I need to be able to set the caller id before making the call, and I don't think I can do that when I start dialing the call at the same time that I create the new session.
 
But if I try to originate the call separately from the creation of the session:
 
        def fsapi(session, stream, env, args):
          session = Session()
          session.setCallerData("caller_id_name", CALLER_NAME)
          session.setCallerData("caller_id_number", CALLER_NUMBER)
          session.execute("originate","{ignore_early_media=true}sofia/gateway/" + SIP_CARRIER + "/" + phone_number)
       
I run into what I think may be a bug; after creating the session I get errors like:
 
          setCallerData() session is not initalized
          setCallerData() session is not initalized
          execute() session is not initalized
As far as I know, there is no initialization routine to call.
       
Any advice would be appreciated!
 
Thanks,
Marc