I use Asterisk 1.8.5 + FreePBX 1.9 with Voipbuster.
My idea is to automatically forward incoming phone calls to an external number after a certain amount of seconds of by forwaring all incoming calls to that number.
It works great when I forward an incoming external call to an internal extension, or when an internal extension gets forwarded to an external number. Sadly, I can’t get it to work for incoming external calls, and I don’t understand why.
With the single VoipBuster trunk, I can set up and use an incoming and an outgoing external call at the same time, so capacity doesn’t seem te be a problem.
With the dial plans in place, I can call the external number I want to forward to.
The external caller gets a normal calling tone. When the phone is picked up by the external telephone where the forward points to, the external caller still hears the dialing tone. The forwarded to external phone hears nothing aftehr picking up.
When I put the logging on Debug, I can see that the external phone (0351234567) is picked up:
About the transfer: maybe I’ve read the logfile wrong.
Yes, asterisk is behind a NAT router. Opened up the necessary ports and normal inbound and outbound calling works without any problems at all.
When you say that the invite is wrong, because it points to an internal IP (.50 is the Asterisk server), shouldn’t Asterisk reroute the call? So shouldn’t Asterisk answer the incoming external call and then set up a new outgoing external call to connect those two? I don’t think Voipbuster supports reinviting the new party (which isn’s a SIP client, but a ‘normal’ phone number).
Updated canreinvite=no to directmedia=no, but still the same problem.
Asterisk should indeed reroute the call itself, but: To connect the channels (where one comes from the outside) the outside leg (voipbuster) needs to know where to route it’s packets to. And if asterisk advices it’s internal IP this will never work as this private IP is not reachable for Voipbuster.
You may check this when issuing a rtp set debug on at the asterisk console and trying the scenario. I’m relatively sure, that there will me no media data when the calls are connected.
Thus You should check why asterisk is delivering it’s internal IP there instead of the external one.
Tried to make sense of the logfile and give a digest of it here, but halfway I concluded it was better to just supply you guys with the complete logfile. You can find it over here: ebogaard.nl/asteriskdebuglog.txt.
I removed all IP-addresses, usernames and phonenumbers and replaced them with a description between . Hope you guys are willing to read through the thing (it’s 45K) and are able to point me to the problem(s)
I’ve changed one thing since I made this logfile: force the outgoing CID to be my phone number, because this should resolve the 401 in the logfile.
I saw nothing wrong in the log file. The 401 is normal, when authentication is enabled. An attempt is made without authentication. The rejection tells one how to authenticate, and a second attempt is made with authentication.
When forwarding a call, everything seems te work OK: the externa phone rings, and when it’s answered, you can see that reflected in the logfile. When I call with my mobile phone, I even feel it buzzing, indicating that a call has been set up.
Problem is that it keeps ringing and you don’t hear the person answering the phone. When that person disconnects, I do hear the disconnected tone.
Do you know some things to test? Is it maybe a good idea to copy the trunk and u one for incoming and one for outgoing? Is it maybe a good idea to disable the ringing sound when forwarding? Or won’t these do anything to improve the sitiation?
The trace looked normal. At the moment I suspect a bug in your service provider’s system. However, sip show channels and core show channels, and possibly the corresponding individual channel displays, may help to exonerate Asterisk.
You have caused some confusion by talking about dial tone and ringing when I think you always mean ring back tone.
Sorry for the delay, but have been quite busy.
Took a look at sip show channels and core show channels, and saw that information is directly available in freepbx. So I used that to copy the stages. See the following log: ebogaard.nl/logfile-2011-08-25-edited.txt
Again, I edited out all private info and replaced it with easy recognizable text.
Looks okay to me (but what do I know). What do you think?
Finally fixed it by using another SIP-trunk from another supplier.
So now it’s: incoming call on Voipbuster => Asterisk => SIP trunk other supplier
First I tried another Voipbuster clone (smsdiscounter) as a second trunk, buit still didn’t work. Guess Voipbuster and clones just don’t want to forward calls.
This method works for me, however, I’m using a lot of Freepbx stuff.
I created a custom extension, sending the call to LOCAL/8817778889999@from-internal. Then defined a route with the 88 and NX.and 88 and X.[/b] prefix, to use any available trunk but: force to use the trunk CID/ANI. The reason for that is that the incomming calls will come with invalid (for the trunk) CID/ANI and most SIP-Trunk providers will reject the outgoing call.
To make things even better, I created a ‘fake’ group, assigning the previous custom extension and the user physical phone, his external DID points to this group, so, the calls will go to his desk and his cell at the same time with a ‘ring all’.