VoIP Mailing List Archives
Mailing list archives for the VoIP community |
|
View previous topic :: View next topic |
Author |
Message |
marc at kasteris.com Guest
|
Posted: Tue Oct 07, 2008 10:47 pm Post subject: [Freeswitch-users] Outbound calls from the CLI in Python Par |
|
|
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 |
|
Back to top |
|
|
brian at freeswitch.org Guest
|
Posted: Wed Oct 08, 2008 12:11 am Post subject: [Freeswitch-users] Outbound calls from the CLI in Python Par |
|
|
Thats why you set origination_caller_id_number inside the {} along side the ingore_early_media=true
You shouldn't use setCallerData and in fact that shouldn't be exposed because it'll wreck havoc with billing if you don't know what you're doing.
/b
On Oct 7, 2008, at 10:44 PM, Marc Orenberg wrote:
Quote: | 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.
|
|
|
Back to top |
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|