Unable to receive calls from external sources.
I'm having trouble getting FreeSWITCH to work properly and was hoping someone would be able to give me a few pointers. I've looked through all the documentation, examples and large chunks of the mailing list but i just can't make heads or tails of things. First i should give a bit of information on what i want to do. I'm going to be running FreeSWITCH on Xen virtual server with a public IPv4 IP. The OS is Debian Etch and lets call the machine "server1.example.org". It will be serving calls for the example.org domain and the relevant SRV records have been set up in the DNS. What i want to set up FreeSWITCH to do is have two users (we'll call them Bert and Fred). I want the two users to be able to call between themselves using either their relevant <USER>@example.org SIP URI or an extension number (2378 for Bert and 3733 for Fred). I also want users outside the domain to be able to call either user using their SIP URI and extension (and also via SipBroker). In addition Bert has two XMPP accounts. One is a Google Talk account and the other is a local account on an OpenFire server (also running on server1.example.org). I would like FreeSWITCH to listen on these accounts for incoming Jingle calls and then pass them through to Bert's registered SIP device. If the user is not currently registered i would like FreeSWITCH to take a voicemail. I would also like users to be able to dial out using SIP URIs and SipBroker prefixes. I don't currently need for it to dial out to the PSTN using a gateway. What i have done so far: Following the instructions in the Wiki i have created some Debian packages of FreeSWITCH 1.0.1. These are installed and the server is running fine. Other than the three changes outlined below the server is completely stock config. I have edited conf/vars.xml and changed the following line to: <X-PRE-PROCESS cmd="set" data="domain=example.org"/> I have deleted the local extensions from conf/directory/default and created two users called bert and fred using files such as this: conf/directory/default/bert.xml: <include> <user id="2378" mailbox="2378"> <params> <param name="password" value="password"/> <param name="vm-password" value="1000"/> </params> <variables> <variable name="accountcode" value="2378"/> <variable name="user_context" value="default"/> <variable name="effective_caller_id_name" value="Bert"/> <variable name="effective_caller_id_number" value="2378"/> </variables> </user> </include> By default FreeSWITCH comes enabled to talk between internal users out of the box, so that works, although i need some way of aliasing the username "bert" to the extension 2378. I understand that FreeSWITCH uses something called contexts and the default context is not available to the public and i need to bridge to it, but i can't seem to figure out how to do it properly. I created a file conf/dialplan/extensions/bert.xml containing the following that i pieced together from the documention, but it doesn't seem to work: <include> <extension name="bert"> <condition field="destination_number" expression="^(bert|2378)$"> <!--action application="transfer" data="$1 XML default" /--> <!--action application="bridge" data="sofia/sip/2378%${server-domain-name}"/--> <action application="bridge" data="sofia/internal/2378%example.org" /> </condition> </extension> </include> (the commented out lines are previous lines i tried (one at a time) which also failed). I also tried adding the above (excluding the <include> tags) to the conf/dialplan/public.xml with no success. I then fire up my Gizmo softphone and attempt to connect from my Gizmo account using my SIP URI (bert@example.org). The FreeSWITCH logs indicate that it is hitting my server but is rejected: 2008-08-10 17:20:23 [DEBUG] mod_event_socket.c:1396 mod_event_socket_runtime() Socket up listening on 127.0.0.1:8021 2008-08-10 17:21:23 [DEBUG] sofia.c:3134 sofia_handle_sip_i_invite() IP 198.65.166.131 Rejected by acl domains. Falling back to Digest auth. 2008-08-10 17:21:23 [DEBUG] sofia.c:3134 sofia_handle_sip_i_invite() IP 198.65.166.131 Rejected by acl domains. Falling back to Digest auth. 2008-08-10 17:21:23 [WARNING] sofia_reg.c:1247 sofia_reg_parse_auth() can't find user [1747xxxxxxx@example.org] You must define a domain called 'example.org' in your directory and add a user with the id="1747xxxxxxx" attribute and you must configure your device to use the proper domain in it's authentication credentials. I'm unsure why FreeSWITCH believes that my Gizmo account is meant to be a local user, and am unable to find any documention on adding a domain to the directory. If anyone could just tell me how to allow external SIP calls to be passed through to local users i would be content to leave the voicemail, Jingle and outbound calls until a later time when i have a better understanding of FreeSWITCH. Hope someone can help. Thanks.
Shortly after posting my original message it suddenly dawned on me that my soft-client might be attempting to dial into my server using port 5060 which i recalled was used, by default, for users in the default context, not the public. Tacking :5080 onto the end of the SIP URI i was dialing gave me a whole different set of errors. After reading through the log messages and trying out some different configuration i managed to get the basics working (accepting a call from an external domain and passing it through to an internal user or directing to voicemail if user isn't online). I'll post my config here incase anyone else ever has this particular problem. conf/directory/default/bert.xml: <include> <user id="bert" mailbox="2378"> <params> <param name="password" value="password"/> <param name="vm-password" value="1000"/> </params> <variables> <variable name="accountcode" value="2378"/> <variable name="user_context" value="default"/> <variable name="effective_caller_id_name" value="Bert"/> <variable name="effective_caller_id_number" value="2378"/> </variables> </user> </include> Added to conf/dialplan/public.xml: <extension name="bert"> <condition field="destination_number" expression="^(bert|2378)$"> <action application="transfer" data="bert XML default"/> </condition> </extension> Create the file conf/dialplan/extensions/bert.xml: <include> <extension name="bert"> <condition field="destination_number" expression="^(bert|2378)$"> <action application="set" data="dialed_ext=$1"/> <action application="export" data="dialed_ext=$1"/> </condition> <condition field="destination_number" expression="^${caller_id_number}$"> <action application="set" data="voicemail_authorized=${sip_authorized}"/> <action application="answer"/> <action application="sleep" data="1000"/> <action application="voicemail" data="check default $${domain} ${dialed_ext}"/> <!-- bind_meta_app can have these args <key> [a|b|ab] [a|b|o|s] <app> --> <anti-action application="bind_meta_app" data="1 b s execute_extension::dx XML features"/> <anti-action application="bind_meta_app" data="2 b s record_session::$${base_dir}/recordings/${caller_id_number}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/> <anti-action application="bind_meta_app" data="3 b s execute_extension::cf XML features"/> <anti-action application="set" data="transfer_ringback=${uk-ring}"/> <anti-action application="set" data="call_timeout=30"/> <!-- <anti-action application="set" data="sip_exclude_contact=${network_addr}"/> --> <anti-action application="set" data="hangup_after_bridge=true"/> <!--<anti-action application="set" data="continue_on_fail=NORMAL_TEMPORARY_FAILURE,USER_BUSY,NO_ANSWER,TIMEOUT,NO_ROUTE_DESTINATION"/> --> <anti-action application="set" data="continue_on_fail=true"/> <anti-action application="db" data="insert/call_return/${dialed_ext}/${caller_id_number}"/> <anti-action application="db" data="insert/last_dial_ext/${dialed_ext}/${uuid}"/> <anti-action application="bridge" data="user/${dialed_ext}@$${domain}"/> <anti-action application="answer"/> <!--<anti-action application="send_display" data="Voicemail for ${dialed_ext}"/>--> <anti-action application="sleep" data="1000"/> <anti-action application="voicemail" data="default $${domain} ${dialed_ext}"/> </condition> </extension> </include> This seems to work well, although the IVR before leaving a vm seems a bit choppy (perhaps due to being on a Xen VPS?). The only question i still have regarding this bit is whether it would be better to switch the ports around so that FreeSWITCH accepts calls from external domains on port 5060 and registrations within the default context on port 5080 or do the majority of SIP servers look up and adhere to what's specified in a domain's SRV records?
participants (1)
-
Rocky Hetherington