Newbie -- Help Needed Transferring Inbound Caller ID to external SIP Gateway URI
Hi! I am very very new to Freeswitch. I am running FreeSWITCH Version 1.5.15b+git~20141120T035109Z~79de78a0fb~64bit (git 79de78a 2014-11-20 03:51:09Z 64bit) on a CentOS 6.6 64-bit Virtual Machine. I am trying to setup freeswitch such that once it gets a call through a sip gateway, it sends the caller ID to another SIP gateway (A URI) to be processed. I am having a lot of difficulty and I am not sure if I am doing the right things correctly, and the logs give so much information it is difficult to see what is happening. Please help me verify if I am correctly configured. I've setup the gateways I expect inbound calls from and freeswitch registers correctly. example: <gateway name="sipgw081"> <param name="username" value="012345081"/> <param name="password" value="xxxxx"/> <param name="register" value="true"/> <param name="realm" value="sip.sipgwtelecoms.com"/> <param name="proxy" value="sip.sipgwtelecoms.com"/> <param name="outbound-proxy" value="sip.sipgwtelecoms.com"/> <param name="caller-id-in-from" value="true"/> </gateway> Sofia returns: external::sipgw081 gateway sip:012345081@sip.sipgwtelecoms.com REGED The gateway I expect to route caller_id_numbers to is defined, but as I was not given a password or asked to register I set it up like so (is this OK?): <gateway name="othersipgw"> <param name="username" value="user.name"/> <param name="password" value="none"/> <param name="register" value="false"/> <param name="realm" value="sip.othersipgw.in"/> <param name="proxy" value="sip.othersipgw.in"/> <param name="outbound-proxy" value="sip.othersipgw.in"/> <param name="expire-seconds" value="3600"/> <!-- <param name="caller-id-in-from" value="true"/> --> </gateway> Sofia returns: external::othersipgw gateway sip:user.name@sip.othersipgw.in NOREG
From what I can see in the documentation I've read, in order to route inbound calls anywhere in freeswitch, Calls that initially come in to the public context and are treated as untrusted—if they are not specifically routed to an extension in the default context, then they are simply disconnected.
So I created a file in conf/dailplan/public with the following to dail an extension 1212 in default( I want to route caller IDs with 11 digits, all beginning with number 0): <include> <extension name="sipgw-inbound"> <condition field="caller_id_number" expression="^0(\d+)$"> <!-- <action application="set" data="domain_name=$${domain}"/> --> <action application="transfer" data="1212 XML default"/> </condition> </extension> </include> This is where my confusion starts. I both created a file in conf/dialplan/default and edited the conf/dialplan/default.xml to route calls sent to 1212 through to the external gateway URI. I also want the caller_id prefixed with a +234 default.xml: <extension name="1212"> <condition field="destination_number" expression="^1212$"> <action application="set"data="absolute_codec_string=G729"/> <action application="set" data="hangup_after_bridge=true"/> <action application="bridge" data="sofia/gateway/othersipgw/+234$1"/> </condition> </extension> outbound.xml file in conf/dialplan/default: <include> <extension name="othersipgwoutbound"> <condition field="destination number" expression="1212"> <action application="set"data="absolute_codec_string=G729"/> <action application="bridge" data="[leg_timeout=5]sofia/gateway/othersipgw/$1"/> </condition> </extension> </include> Any assistance gratefully accepted.
Hi - did you figure this out yet? One comment: <action application="bridge" data="sofia/gateway/othersipgw/+234$1"/> -- I don't know if $1 is available anymore. You might want to just set that as part of the actual number to route, e.g. add a 1212 prefix and match it again or set it as a channel variable. You can see in the logs if the $1 is resolving correctly. -Avi
Hi Avi! Thanks for the reply, I did figure it out, thanks! This is what I did, <include> <extension name="firstsipgw-inbound"> <condition field="destination_number" expression="^0123450(\d{2})$"/> <condition field="caller_id_number" expression="^0(\d{10})$" require-nested="true"> <action application="set" data="effective_caller_id_number=+234$1"/> <action application="set" data="caller_id_number=+234${effective_caller_id_number}"/> <action application="set" data="transfer_ringback=$${us-ring}"/> <action application="set" data="transfer_ringback=file_string://$${hold_music}"/> <action application="set" data="transfer_ringback=local_stream://connecting"/> <action application="bridge" data="sofia/external/sip:user.name@sip.othersipgw.com;${effective_caller_id_number}"/> </condition> </extension> </include> I can see from the logs that dials the othersipgw.com URI, and I can see tcpdumps that corresponds to the traffic being sent, and the other side gets it. The other side immediately drops the call and does some processing that returns an SMS to the dialler. I dont know if I can trouble you for more help.. there is no ringing when the transaction happens, and the dialler is unsure what is happening, if the call actually connected. As you might have guessed from the above I am trying to make it ring for a few seconds before the call drops. Is this possible? I would like for the dialler to be able to hear it ring a few times before the call is cut. Any help gratefully accepted. On Tue, Dec 2, 2014 at 2:22 PM, Avi Marcus <avi@avimarcus.net> wrote:
Hi - did you figure this out yet?
One comment: <action application="bridge" data="sofia/gateway/othersipgw/+234$1"/> -- I don't know if $1 is available anymore. You might want to just set that as part of the actual number to route, e.g. add a 1212 prefix and match it again or set it as a channel variable. You can see in the logs if the $1 is resolving correctly.
-Avi
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.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
participants (2)
-
Avi Marcus
-
Notify Me