How to set destination_number_ton when originating a call with bgapi
We are running freeswitch connected with a sangoma A101 card to the PSTN. We have an application that is connected to the event socket to control incoming calls. When bridging a call to an external number, I set the profile variable "destination_number_ton" and put it also as option to the bridge command to have the variable filled in all channel events. sendmsg call-command: execute execute-app-name: set_profile_var execute-app-arg: destination_number_ton=1 event-lock: true sendmsg call-command: execute execute-app-name: bridge execute-app-arg: {calltype=FORWARD,destination_number_ton=1}freetdm/1/a/XXXXXX event-lock: true In this scenario everything works fine, the type for the Called Party Number is set correctly to "international". Prot Disc:Q.931/I.451 (0x08) Call Ref:007C (Originating side) Type:SETUP (0x5) Sending complete: Bearer Capability:Coding:ITU-T(0) TransferCap:Speech(0) TransferRate:64 Kbit/s(16) L1Prot:G.711 A-Law(3) Channel Id:No:1 Type:B-chans(3) Exclusive/Implicit Calling Party Number:XXXXX(l:11) plan:isdn(1) type:national(2)scr:user, passed(1) pres:allowed(0) Called Party Number:XXXX(l:15) plan:isdn(1) type:international(1) <<<----------------- OK [ 08 02 00 7c 05 a1 04 03 80 90 a3 18 03 a9 83 81 6c 0d 21 81 32 32 31 35 35 34 30 30 33 31 38 70 10 91 34 39 32 32 31 34 30 30 36 37 38 33 31 30 33 ] For another scenario I need to originate calls with bgapi function like: bgapi originate {origination_caller_id_number=XXXX,originate_timeout=20,origination_uuid=7a1093b5-4225-4a99-b3dc-bb4254217e4,destination_number_ton=1}freetdm/1/a/XXXX &park event if I set the profile_var destination_number_ton, it's not "transported" to the ISDN layer. In the ISDN trace I can see that the number type of the Called Party Number is always "unknown". Prot Disc:Q.931/I.451 (0x08) Call Ref:007A (Originating side) Type:SETUP (0x5) Sending complete: Bearer Capability:Coding:ITU-T(0) TransferCap:Speech(0) TransferRate:64 Kbit/s(16) L1Prot:G.711 A-Law(3) Channel Id:No:1 Type:B-chans(3) Exclusive/Implicit Calling Party Number:XXXXX(l:12) plan:isdn(1) type:national(2)scr:user, passed(1) pres:allowed(0) Called Party Number:XXXXX(l:15) plan:isdn(1) type:unknown(0) <<<----------------- NOT OK [ 08 02 00 7a 05 a1 04 03 80 90 a3 18 03 a9 83 81 6c 0e 21 81 30 32 32 31 35 35 34 30 30 33 31 38 70 10 81 34 39 32 32 31 34 30 30 36 37 38 33 31 30 31 ] How to can the destination_number_ton be set when originating a call via bgapi? Thanks Markus
After some research in the code, I found out that instead of setting destination_number_ton the variable "freetdm_outbound_ton" has to be set on originate. Valid values are "national", "international", "local" and "unknown". So in my case the following command will work: bgapi originate {origination_caller_id_number=XXXX,originate_timeout=20,origination_uuid=7a1093b5-4225-4a99-b3dc-bb4254217e4,freetdm_outbound_ton=international}freetdm/1/a/XXXX &park -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/How-to-set-destination-number-... Sent from the freeswitch-users mailing list archive at Nabble.com.
Thank you for doing the research here. Any chance you could add this to the FreeTDM page on the wiki? -MC On Tue, Oct 16, 2012 at 2:28 AM, mbo <mbodbg@gmx.net> wrote:
After some research in the code, I found out that instead of setting destination_number_ton the variable "freetdm_outbound_ton" has to be set on originate. Valid values are "national", "international", "local" and "unknown". So in my case the following command will work:
bgapi originate
{origination_caller_id_number=XXXX,originate_timeout=20,origination_uuid=7a1093b5-4225-4a99-b3dc-bb4254217e4,freetdm_outbound_ton=international}freetdm/1/a/XXXX &park
-- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/How-to-set-destination-number-... Sent from the freeswitch-users mailing list archive at Nabble.com.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Michael S Collins Twitter: @mercutioviz http://www.FreeSWITCH.org http://www.ClueCon.com http://www.OSTAG.org
participants (2)
-
mbo
-
Michael Collins