wdoekes / asterisk-chan-dongle

chan_dongle channel driver for Huawei UMTS cards, works with Asterisk 14+
Other
300 stars 105 forks source link

Help needed receiving incoming calls #52

Closed essenemari closed 6 years ago

essenemari commented 6 years ago

Hi, @wdoekes, first of all thanks a lot for your work on this asterisk-chan-dongle distribution.

Anyone, I am looking for some help, so probably the best label will "help wanted". So, if someone would able to give me some hints (really basic level - just to get up), i would really appreciate it.

Current conf (test environment): Ubuntu 17.10 Asterisk 15.2.2 E173u-2, 11.126.85.02.52, voice enabled, unlocked.

I believe, I have correctly configured asterisk with chan_dongle because I can send and receive SMS through dongle.

Issue: But I have no idea, how manage (or just test!) incoming call. I have always "busy signal" when trying to call to my dongle... Tried many ways with extension.conf. I did copy the file to /etc/asterisk/ folder and put there many testing data to see what happen. Nothing worked. Let's take this (example):

/etc/asterisk/extensions.conf

[general]
[default] //as default context defined in /etc/astersk/dognle.conf
exten => s,n,DongleSendSMS(dongle0,+00123456789,"Hello how are you, Danila?",1440,yes)
;exten => s,1,Wait(6)

My understanding is that dongle should recognize any call and send the SMS to +00123456789. But when calling then always I hear "User busy". Tried also to play with Wait() function but still "User busy". Tested a lot of other variants but no progress :| Tried even to remove extensions.conf from everywhere to see if maybe i will see some useful EM while asterisk reloading, but no... all seems to be working normally and then if calling to dongle ... dongle is busy... /var/log/asterisk empty...

Please help me understand how to move it forward, for example how send SMS to +00123456789 if someone is calling to dongle or anything else that could help me to see if I can play with incoming calls.

Any advise will be helpful.

Thanks! .................................. My long term goal: by having MSISDN + HUAWEI E173u-2 + RPI + asterisk + asterisk-chan-dongle trying to simple create IVR to perform two actions e.g. if someone will call to +ccxxxxxxxxx,2;1 then action#1 (CURL smth to server), if +ccxxxxxxxxx,2;2 then action#2 CURL smth else to server).

standardgbg commented 6 years ago

Hi

I had this problem as well. There is most certainly something wrong with you config. Start by logging in to asteriskCLI with "asterisk -r" and up the logging lever with "core set verbose 3" Call the number and start scratching your head :) Another tip is to not alter the extensions.conf, use extensions_custom.conf instead. Here is my rows on handling the incoming calls:

exten => .,1,Set(CALLERID(name)=${CALLERID(num)}) exten => .,n,Goto(from-trunk,${EXTEN},1)

You need to create a trunk and incoming route in FreePBX. (From http://www.raspberry-asterisk.org/documentation/gsm-voip-gateway-with-chan_dongle/)

Then log into FreePBX, in Connectivity – Trunks click Add Custom Trunk. 
Provide a trunk name, set Outbound CallerID to the number of your SIM, 
and enter in the field Custom Dial String:
dongle/dongle0/$OUTNUM$
Add an outbound route to use this trunk, as well as an incoming route. 
On the incoming route set DID Number to your SIM number, 
precisely matching the number you entered when running the install-dongle script.

Don't forget to update your changes in FreePBX with the button in upper right corner. And all changes in asterisk config files need to be reloaded with
fwconsole restart (not in asterskCLI)

Good luck.

essenemari commented 6 years ago

@standardgbg MANY thanks for your response. You've helped me a lot because I realized that FreePBX installation seems to be obligatory. In fact tried avoid FreePBX installation because it will run on RPI - you know, less things on RPI equals SD card longer life. I thought that it asterisk is able to handle that on its own but based on my research and also your confirmation seems it will not work or is too hard for me to set up. once again - thank you! I will work on this upcoming weeknights :)

//edit few minutes later Something strange is also that core set verbose 3 does not bring anything into my screen while trying to call nor after the call. Nothing, even this is verbose 3, 1, or 99. The same for debugging level.

standardgbg commented 6 years ago

No problem.

Regarding your problem with no loggs. I think your dongle.conf must be wrong.

The only thing you need to change is exten=+46XXXXX (Your phone number)

and check in dmesg that your modem has switched to the following ports and is now in modem-mode and not storage mode (and can handle voice, best checked in the PC program "DC unlocker") audio=/dev/ttyUSB1 ; tty port for audio connection; no default value data=/dev/ttyUSB2 ; tty port for AT commands; no default value

And I take it that you've installed FreePBX and setup a trunk and incoming route.

wdoekes commented 6 years ago

(1) You don't need FreePBX for functionality ever. You can use FreePBX for convenience, but it will not do things that you cannot do without it. (2) You do need logging. See /etc/asterisk/logger.conf and specifically the console=> line if you're not seeing any verbose logs. (Don't forget to restart (or logger reload) after change.)

essenemari commented 6 years ago

thank You both for your valuable help!

Issue description. Hopefully will be useful for others:)

Once again! Many thanks for you, gentlemen!