Send SMS "Thank You for calling" to incoming number

I reach this task - but still need help :grimacing:

context works OK

[macro-dialout-one-predial-hook]
exten => s,1,Noop(Entering user defined context in extensions_custom.conf to add sms calls hangup handler)
exten => s,n,Set(CHANNEL(hangup_handler_push)=sms-after-call,s,1)
exten => s,n,MacroExit()

[sms-after-call]
exten => s,1,NoOp(Sending SMS Thank you from mobile)
exten => s,n,DongleSendSMS(dongle0,${CALLERID(number)},THANK FOR CALLING,,false)
exten => s,n,Hangup()

BUT incoming caller number is getting to many messages. FreePBX is using a Queues and each time caller skips Agent1 to Agent2 he gets message (context is working on HANG UP).

EXAMPLE:
incoming call is waiting for Agent1 10-20sec when Agent1 is not picking up - Queues goes to another Agent2 - AND THIS IS THE MOMENT (hang up) when caller is getting sms.

Each time Queues skip agent then caller gets another and another message.

QUESTION:
its possible to send ONLY 1 sms to caller - after call (hangup) ??

Ps: i try this setup, but did not work fo me

MAYBE it should be “custom extension” only for send sms to caller ID, after call ??

:sob: :weary:

Add the hangup handler to the incoming call channel using a custom destination, not to each of the called channels.

1 Like

Dont know how to “add hangup handler to incoming call channel” ? :grimacing:

i make “cutom destination” target is: sms-after-call,s,1

what should i add/change in context?

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

[macro-dialout-one-predial-hook]
exten => s,1,Noop(Entering extensions_custom.conf to add sms calls hangup handler)
exten => s,n,Set(CHANNEL(hangup_handler_push)=sms-after-call,s,1)
exten => s,n,MacroExit()

[sms-after-call]
exten => s,1,NoOp(Sending SMS Thank you to ${CALLERID(number)})
exten => s,n,DongleSendSMS(dongle0,${CALLERID(number)},Thanks for calling,false)
exten => s,n,Return

Please help :weight_lifting_man:

Can’t setup hangup handler to incoming call channel, no luck for 5 days … :frowning:

Small bypass for everyone who wants Send SMS to Incoming Caller
1. In extensions_custom.conf add custom context like:

[sms-after-call]
exten => s,1,NoOp(SMS SENDING TO: ${CALLERID(num))
exten => s,n,System(asterisk -rx 'dongle sms dongle1 ${CALLERID(num)} www.SuperSite.com')
exten => s,n,Hangup()

2. New Extension (custom one - with Dial field sms-after-call,s,1 )
3. Put this extension to Queues (as queue agent with time 0)

It works, Incoming Caller get SMS (but on the begging of call…) :innocent:

Thanks for help.

BTW: Send sms can be done by
a) System(asterisk -rx ‘dongle sms dongle1 ${CALLERID(num)} www.SuperSite.com’)
or
b) DongleSendSMS(dongle1,${CALLERID(num)},“www.SuperSite.com”,0,no)

b) option gives more arguments (,0 means time ,no means report)

Just to understand: Does www.SuperSite.com stand for the SMS gateway web address?

You are right, www.supersite.com its only text as web page. :face_with_monocle:

Command to send SMS from context is like:

System(asterisk -rx 'dongle sms dongle1 ${CALLERID(num)} Thank You for calling, visit www.page.com')

or

DongleSendSMS(dongle1,${CALLERID(num)},"Thank You for calling, visit www.page.com",0,no)

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