Help Forwarding incoming DID TO SIP URI

Hi
Need some guidence
I want to forward incoming DID to a sip uri
Eg , Sip/[email protected]
It’s on a brand new clean install 32 bit
I can see the notice in asterisk from the inbound calls but that’s as far I have got

Create an extension of type custom, and in the dial field use the URI noted above in the format:
SIP/[email protected]:5060
Then direct calls to this extension with an inbound route.

Thanks for the info I will try that and let you know how i get on

hi tried this and did not work the pbx plays a message number dialed has not been recognized

== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Executing [435667887@from-sip-external:1] NoOp(“SIP/99.66.77.88-00000007”, “Received incoming SIP connection from unknown peer to 435667887”) in new stack
– Executing [435667887@from-sip-external:2] Set(“SIP/99.66.77.88-00000007”, “DID=675646456”) in new stack
– Executing [435667887@from-sip-external:3] Goto(“SIP/99.66.77.88-00000007”, “s,1”) in new stack
– Goto (from-sip-external,s,1)
– Executing [s@from-sip-external:1] GotoIf(“SIP/99.66.77.88-00000007”, “0?checklang:noanonymous”) in new stack
– Goto (from-sip-external,s,5)
– Executing [s@from-sip-external:5] Set(“SIP/99.66.77.88-00000007”, “TIMEOUT(absolute)=15”) in new stack
– Channel will hangup at 2015-06-12 09:20:54.788 CEST.
– Executing [s@from-sip-external:6] Log(“SIP/99.66.77.88-00000007”, "WARNING,“Rejecting unknown SIP connection from 99.66.77.88"”) in new stack
[2015-06-12 09:20:39] WARNING[4194][C-00000007]: Ext. s:6 @ from-sip-external: “Rejecting unknown SIP connection from 99.66.77.88”
– Executing [s@from-sip-external:7] Answer(“SIP/99.66.77.88-00000007”, “”) in new stack
– Executing [s@from-sip-external:8] Wait(“SIP/99.66.77.88-00000007”, “2”) in new stack
[2015-06-12 09:20:39] NOTICE[4194][C-00000007]: channel.c:4301 __ast_read: Dropping incompatible voice frame on SIP/99.66.77.88-00000007 of format ulaw since our native format has changed to (alaw)
– Executing [s@from-sip-external:9] Playback(“SIP/99.66.77.88-00000007”, “ss-noservice”) in new stack
– <SIP/99.66.77.88-00000007> Playing ‘ss-noservice.alaw’ (language ‘en’)
== Spawn extension (from-sip-external, s, 9) exited non-zero on ‘SIP/99.66.77.88-00000007’
– Executing [h@from-sip-external:1] Hangup(“SIP/99.66.77.88-00000007”, “”) in new stack
== Spawn extension (from-sip-external, h, 1) exited non-zero on 'SIP/99.66.77.88-00000007’
localhost*CLI>

Surprised at the lack of answers on this subject as it has massive opertunities for pbx servers
It opens the doors and possibilities to any pbx system
I know it can be done because I know some one that’s done it , but he’s not available to help at this moment
I’ve been doing some research and it seems that it’s not just a case of making changes via the web interface
But also editing some of the files
This can only be done from the root login but I will be looking into FTP also
FTP would then let me down load the file make a copy and then upload it back

I will be working on this extensively and post results

Me too as I have customers who want to divert their DIDs to SIP URI [email protected]

It sounds to me that what you really want here is a private trunk to that address. Although SIP allows such direct calling, most people consider it a security risk and also want a system that work with telephone numbers, rather than arbitrary user names.

If you want to forward all DIDs, unconditionally, Asterisk is the wrong tool.

Hi David, not really! We just have a customer who wants their DID forwarding SIP URI rather than using SIP auth. I have looked up lots of community posts and it seems you can do this by creating a custom extension and put the SIP URI in the “Dial” entry, eg SIP/[email protected]

These older posts are about chan_sip; if you want to reroute calls to a SIP URI using PJSIP with a Custom Extension, the steps are a little different.

In Asterisk SIP Settings, set “Allow SIP Guests” to Yes to enable the “anonymous” endpoint. You do not need (or probably want) to enable “Allow Anonymous Inbound SIP Calls.”

The format for your Custom Extension then would be:

PJSIP/anonymous/sip:[email protected]

These are not alternatives.

Please don’t use chan_sip. You can do it with chan_pjsip, but the syntax is different, and you must have an endpoint and AOR, even though you completely override the contents of the AOR. However, you have to use some level of customisation when it looks to me that you just want to forward calls to a trunk, which, I believe, can be done within the GUI.

(Actually, I’m not sure you need an AOR, you may be able to override a null one.)

Thinking more about it, FreePBX may constrain your ability to ignore the DID information on the outgoing side, but you are sill logically creating a trunk, so I believe you should define a trunk for the domain part, even if you need to use custom destinations to get the user part, rather than using the anonymous option.

But isn’t that a security risk to “allow sip guests”, this would open the PBX to a hacker freeforall, as they won’t need SIP auth to access the PBX. Is this the only way? Have you tried this, and do you have a successful user with this working configuration?

If you are going to send to SIP URIs of various domains then it is the way to do it.

If you are only sending to SIP URIs of one or a few domains, setting up trunks (without auth, since you don’t want it) for those domains would be a better choice.

Yes I have used the anonymous endpoint for this purpose. It is not a “hacker free for all.” Inbound traffic that hits the anonymous endpoint is rejected because Allow Anonymous Inbound SIP Calls is turned off. This is not great because you’ll see the invalid traffic in your CDR. But if you don’t have a predetermined list of domains you want to call, this is the way you would have to do it.

OK thank you very much for you help. I will try this.