Skip to content

Instantly share code, notes, and snippets.

@govind0229
Last active April 3, 2024 18:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save govind0229/96af9a08ac4a3aabf4ad9e3aa53ab325 to your computer and use it in GitHub Desktop.
Save govind0229/96af9a08ac4a3aabf4ad9e3aa53ab325 to your computer and use it in GitHub Desktop.
Free-switch outbound calling through Asterisk setup

Freeswitch outbound calling through Asterisk

[cloud]
type=peer
host=X.X.X.X
port=5080
allow=all
;allow=ulaw
;allow=alaw
trustrpid=yes
sendrpid=yes
encryption=no
context=cloudoutbound

TRUNK=DAHDI/i2/ ;for cloudoutbound

[cloudoutbound]
exten =>  _XXXXXX!,1,NoOp(${EXTEN})
same => n,Dial(${TRUNK}${EXTEN},55,tTo)
same => n,Hangup()

-- ACL Setup for Astrisk on Freeswitch

tcpdump port 5060 and host X.X.X.X -vv -- Tcp traffic debugg

-- Edit external.xml file and add below lines and save & close then restart Freeswitch

vim /etc/freeswitch/sip_profiles/external.xml

    <param name="local-network-acl" value="localnet.auto"/>
    <param name="apply-inbound-acl" value="lan"/> -- for Asterisk use only
    <param name="apply-candidate-acl" value="lan"/> -- for Asterisk use only
    <param name="manage-presence" value="false"/>
Save & close
-- Then test outbound calling from freeswitch with codec
fs_cli -rx 'originate {ignore_early_media,absolute_codec_string='PCMA'}sofia/external/XXXXXXXXXX@X.X.X.X &park()'
-- For Asterisk to Freeswitch inbound calling setup
[cloudinbound]
exten => _X!,1,NoOp(${EXTEN})
 same => n,Dial(SIP/X.X.X.X/${EXTEN},55.tTo)
 same => n,Hangup

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment