[Freeswitch-users] SIP trunking with Nexmo

Aviv Shaham aviv at sent.com
Mon Nov 10 22:17:06 MSK 2014


Hi Manish,

First, no need to set nexmo_forwarded_for for outbound here, if you
re-read my previous email you'll see that it was meant to be used for
Nexmo DIDs you use to direct origination traffic into FS.

As for the error you are getting with this dialplan, you need to remove
"@sip.nexmo.com:5080" from your origination string.

Hope it helps,

Aviv



On Fri, Nov 7, 2014, at 11:10 PM, Manish Talwar wrote:
> Hi,


>


> Thanks for your suggestion, I have make these changes and
> removed the L16
 codec from request now. I have set "absolute_codec_string" and
 "nexmo_forwarded_for" and its not throwing any error message in SIP
 trace now.


>


> But still, I am not able to make a call on my mobile number
> "*1919818753995*". Its show message on FreeSwitch log as
> "[RECOVERY_ON_TIMER_EXPIRE]" and hangup the freeswitch call. Also,
> there is no log created on Nexmo dashboard for this call's.


>


> I am sending my call request to Nexmo from FreeSwitch by dialplan as.


>


> *<extension name="Dial through Nexmo">* * <condition
> field="destination_number" expression="^19(1\d{10})$">* * <action
> application="set" data="absolute_codec_string=PCMU,GSM"/>* * <action
> application="set" data="nexmo_forwarded_for=$1"/>* * <action
> application="bridge"
> data="{origination_caller_id_name='18188535351',ignore_early_media=true}sofia/gateway/nexmo/$1 at sip.nexmo.com:5080"/>
*
> * </condition>* * </extension>*

>


>


> Please find the attached SipTrace file now and let me know what I need
> to update now.


>


> In this log, values passed in "From" and "To" attribute as: **


> **


> *From: "18188535351" <sip:b9c280dd at sip.nexmo.com>;tag=D8g4a5NvH4emF* *
> To: <sip:19818753995 at sip.nexmo.com:5080>*
>


> I feel there might be some wrong data passed in "To" attribute and it
> might expecting mobile number "19818753995" only instead on SIP value.
> Please suggest about these setting also.


>


> Thanks,


>


> Regards,


> Manish Talwar


>


>
> *From:* Aviv Shaham <aviv at sent.com> *Sent:* 07 November 2014 21:48
> *To:* freeswitch-users at lists.freeswitch.org *Subject:* Re:
> [Freeswitch-users] SIP trunking with Nexmo
>
> Hi Manish,
>
> Nexmo doesn't seem to handle it well if your first specified
> codec is L16.
 Try to set absolute_codec_string to PCMU and see if that helps.
>
> Also note that there is no need to
 include custom SIP headers such as api_key, api_secret, and answer_url
 when you make an outbound call.
>
> Since you mentioned also needing inbound
 - keep in mind that when you use Nexmo's built-in "Forward to SIP"
   setting for each number in the dashboard, the dialed number will not
   be passed as a SIP variable and you have no way of knowing it once
   you receive the SIP invite. One way to get around this is to have
   your application buy & update numbers via the Nexmo API and set a
   custom SIP address per Nexmo DID, for example:
> nexmo_12121115555 at your-server.com and then have a dialplan such as:
>
> <extension name="IncomingNexmo"> <condition field="destination_number"
> expression="^nexmo_(\d+)$"> <action application="info"/> <action
> application="set" data="nexmo_forwarded_for=$1"/> <action
> application="lua" data="nexmo_handler.lua"/> </condition> </extension>
>
> The nexmo_forwarded_for session variable
 will now expose to you the dialed Nexmo phone number allowing your
 application or XML dialplan to use it.
>
> Let me know if you are having any
 other issues.
>
> Aviv
>
>
> On Fri, Nov 7, 2014, at 01:05 AM, Manish Talwar wrote:
>> Hi,


>>


>> Thanks for your suggestion, I have tried it and I am able to do a
>> Inbound call via Nexmo now. But still I am not able to make any
>> outbound call from my application.


>>


>> I have checked the FreeSwitch log by siptrace enable and found that
>> my call was terminated with a SIP message as "


>> *IP/2.0 407 Proxy Authentication Required*".


>>


>> Please find the siptrace log for my call as an attachment. and let me
>> know what changes or configuration I need to make for Proxy
>> Authentication Header.


>>


>> Thanks,


>>


>> Regards,


>> Manish Talwar


>>


>>
>> *From:* freeswitch-users-bounces at lists.freeswitch.org
>> <freeswitch-users-bounces at lists.freeswitch.org>
 on behalf of Aviv Shaham <aviv at sent.com>
>> *Sent:* 06 November 2014 14:39 *To:*
>> freeswitch-users at lists.freeswitch.org *Subject:* Re:
>> [Freeswitch-users] SIP trunking with Nexmo
>>
>> Hi Manish,
>>
>> Nexmo expects your API KEY to be in the From header. To set the
>> caller ID you will need to use "caller-id-name". Good timing btw, I
>> just posted a reply to a similar question on Quora. Have a look:
>> http://qr.ae/DEbk2 - also
 covers Plivo.
>>
>> Aviv
>>
>>
>> On Thu, Nov 6, 2014, at 12:07 AM, Manish Talwar wrote:
>>> Hi,
>>>
>>> I have make a SIP Trunking (gateway) in FreeSwitch for connecting
>>> Nexmo via bridge. I have added this Nexmo file under
>>> "*\FreeSWITCH\conf\sip_profiles\external*" folder. Its successfully
 registering "sip.nexmo.com" Gateway as mentioned below:
>>>
>>>
>>> Name Type Data State
>>> ================================================================================================

>>> external-ipv6 profile
>>> sip:mod_sofia@[2001:0:9d38:90d7:102f:3fc4:3f57:fe73]:5080 RUNNING
>>> (0) 192.168.1.140 alias internal ALIASED external profile
>>> sip:mod_sofia at 192.168.1.140:5080 RUNNING (0) external::example.com
>>> gateway sip:joeuser at example.com NOREG external::sip.nexmo.com
>>> gateway sip:b9c280dd:7678b8c4 at sip.nexmo.com
 REGED
>>> internal-ipv6 profile
>>> sip:mod_sofia@[2001:0:9d38:90d7:102f:3fc4:3f57:fe73]:5060 RUNNING
>>> (0) internal profile sip:mod_sofia at 192.168.1.140:5060 RUNNING (0)
>>> ================================================================================================

>>> 4 profiles 1 alias
>>>
>>> But when I send the request to FreeSwitch by Dial command as:
>>> *<document
>>> type="xml/freeswitch-httapi"><params></params><work><execute
>>> application="set" data="sip_h_api_key=b9c280dd" /><execute
>>> application="set" data="sip_h_api_secret=7678b8c4" /><execute
>>> application="set" data="sip_h_to=919818753995"
 /><execute application="set" data="sip_h_from=18188535351
 <sip:b9c280dd at sip.nexmo.com>" /><execute application="set"
 data="sip_h_answer_url=http://services.qpayi.com:8080/ivr/assets/NexmoTransfer.vxml"
 /><dial name="exten"
 action="http://localhost:8080/ivr/fsdialmenu/dialendresponse/"
 caller-id-name="HTTAPI Test" *
>>> *caller-id-number="18188535351" context="default" Dialplan="XML"
>>> >919818753995</dial></work></document>*
>>>
>>>
>>> here, *18188535351* = Nexmo virtual number for connecting call.
>>> *919818753995* = mobile number where I am looking for making a call.
>>>
>>> It will not connected to Nexmo and call will be terminated with
>>> message as: 2014-11-06 11:05:18.088340 [INFO] mod_dptools.c:3234
>>> Originate Failed. Cause: NORMAL_UNSPECIFIED
>>>
>>> Please find the FreeSwitch call Log and Nexmo Gateway (which I have
>>> added in freeswitch conf external
 folder) as an attachment.
>>>
>>> Please let me know whether I am doing SIP trunking in correct way or
>>> need to change something.
>>>
>>> Also, Please suggest me what will be my next step for making a call
>>> on mobile by this ways.
>>>
>>> Thanks,
>>>
>>> Regards, Manish Talwar
>>>


>>> ___________________________________________________________________________
>>> Professional FreeSWITCH Consulting Services:
>>> consulting at 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 at lists.freeswitch.org
>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>>> http://www.freeswitch.org Email had 2 attachments:


>>>  * FsCall.txt
>>>
15k (text/plain)
>>>  * Nexmo.xml
>>>
3k (text/xml)
>>
>> ___________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:
>> consulting at 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 at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org Email had 1 attachment:


>>  * SipTrace.txt
>>
9k (text/plain)
>
> ___________________________________________________________________________
> Professional FreeSWITCH Consulting Services: consulting at 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 at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org Email had 1 attachment:


>  * SipTrace.txt 16k (text/plain)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20141110/d05513c7/attachment-0001.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list