Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save karthicraghupathi/20e43b9589b4437b39f679d76fccee8e to your computer and use it in GitHub Desktop.
Save karthicraghupathi/20e43b9589b4437b39f679d76fccee8e 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/[email protected] &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