Forward call to external numbers

Can i forward calls from asterisk server to mobile numbers?

If you have a VoIP provider, and configure Asterisk dialplan to do so or configure forwarding in a desk phone, then yes.

so do I have to register those mobile numbers in asterisk? like trunking?

You have to be able to reach the numbers through some mechanism, for example a SIP trunk/VoIP provider. It’s up to you to then configure Asterisk to use that provider, and route things accordingly.

Can you please suggest me some ways to reach mobile numbers other than SIP trunk? because it’s other people’s phone numbers and I couldn’t configure them… I’m thinking of using virtual phone number to forward to those mobile numbers ?

ISDN trunk;
analogue trunk (not recommended);
GSM dongle;
SIP to GSM gateway

I don’t understand this reason.

Thank you for your response and please correct me if i’m wrong. By my reason, I mean how can i register people regular mobile numbers to a sip provider?

A SIP provider gives you access to the traditional phone network. This means you can place normal phone calls. The mobile phone doesn’t need to be registered or associated with your system.

Thank you I got the point now… I also realized how dumb I was (thanks for your patience :D)
However I still got this error:

[Mar  2 20:47:35] WARNING[243][C-00000009]: chan_pjsip.c:978 chan_pjsip_write_stream: Channel PJSIP/00000011 asked to send ulaw frame when native formats are (alaw) (rd:ulaw->ulaw; wr:ulaw->ulaw;)
[Mar  2 20:47:35] WARNING[243][C-00000009]: chan_pjsip.c:978 chan_pjsip_write_stream: Channel PJSIP/00000011 asked to send ulaw frame when native formats are (alaw) (rd:ulaw->ulaw; wr:ulaw->ulaw;)
[Mar  2 20:47:35] WARNING[243][C-00000009]: chan_pjsip.c:978 chan_pjsip_write_stream: Channel PJSIP/00000011 asked to send ulaw frame when native formats are (alaw) (rd:ulaw->ulaw; wr:ulaw->ulaw;)
[Mar  2 20:47:35] WARNING[243][C-00000009]: chan_pjsip.c:978 chan_pjsip_write_stream: Channel PJSIP/00000011 asked to send ulaw frame when native formats are (alaw) (rd:ulaw->ulaw; wr:ulaw->ulaw;)
[Mar  2 20:47:35] WARNING[243][C-00000009]: chan_pjsip.c:978 chan_pjsip_write_stream: Channel PJSIP/00000011 asked to send ulaw frame when native formats are (alaw) (rd:ulaw->ulaw; wr:ulaw->ulaw;)
[Mar  2 20:47:35] WARNING[243][C-00000009]: chan_pjsip.c:978 chan_pjsip_write_stream: Channel PJSIP/00000011 asked to send ulaw frame when native formats are (alaw) (rd:ulaw->ulaw; wr:ulaw->ulaw;)

my pjsip.conf

[provider]
type=endpoint
transport=transport-udp
context=outgoing
disallow=all
allow=ulaw,alaw,gsm,g726,g722
aors=provider
language=en
outbound_auth=provider
user_eq_phone=no
t38_udptl=no
t38_udptl_ec=none
fax_detect=no
trust_id_inbound=no
t38_udptl_nat=no
direct_media=no
rtp_symmetric=yes
dtmf_mode=auto
fax_detect=no
trust_id_inbound=no
t38_udptl_nat=no
direct_media=no
rtp_symmetric=yes
dtmf_mode=auto
from_domain=example.com
from_user=alice

I think we’re missing some basic concepts here…

Asterisk is not a ‘magic bullet’ that will let you place calls to endpoints (home, office, mobile – things with ‘real’ PSTN numbers) for free. You need a SIP provider ($$) for that ‘gateway function.’

If the endpoints run a SIP client (Bria, Linphone, Zoiper, etc) you could place a ‘free’ call, but you are using internet bandwidth and the endpoints are using ‘mobile data’ so it is not really free. And, you are not calling their PSTN number, unless that is what the SIP client uses to register with your Asterisk server. (Note ‘they’ register with you, you don’t register with ‘them.’)

I have a sip provider registered already… The thing is I was using the trunk to reach asterisk endpoints… Now I want to forward calls from endpoints to mobile numbers. i didn’t know the sip provider also let me do that.

I guess it’s fair to say that I missed the basics.

I got it working! by changing allow to allow=!all,ulaw. Not sure why though. But thank you so much! really appreciate Asterisk community support.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.