[Freeswitch-users] Chat Plan Handling

Sean Devoy sdevoy at bizfocused.com
Sat Aug 10 16:24:08 UTC 2019


Thanks Keith, that is helpful if we need to cancel a message.

What I ended up with is NOT cancelling the event but modifying it to have the updated information it needs to route correctly. For inbound SMS messages, I just set the "to" value to a registered extension and let the plan exit.  The default handling is to then send it.

For external (out to my VSP) I had to set several "fields":
[cid:image001.png at 01D54F76.816FCA20]

Hope that helps others,
Sean


From: k at rhizomatica.org <k at rhizomatica.org>
Sent: Saturday, August 10, 2019 7:56 AM
To: FreeSWITCH Users Help <freeswitch-users at lists.freeswitch.org>; Sean Devoy <sdevoy at bizfocused.com>
Subject: Re: [Freeswitch-users] Chat Plan Handling


On 08/08/2019 16:23, Sean Devoy wrote:
>
> How can to stop the default handling of an inbound SMS message?

>



Hi Sean, after some long time trying to do that, then giving up, and coming back to it, various times, I finally went for the source code with a comb and it seems I finally found a way to do it:

Please see. https://github.com/Rhizomatica/rccn/commit/db08b977711da1e09e3326db1723f6774a2b4e6c

Hmm, when making that commit, I referenced: https://docs.freeswitch.org/switch__loadable__module_8c.html#a6389148319476a6f9858ccf4b889f8a4

Which is where I found in this comment:

/* The event was handled by an extension in the chatplan,
* so the event will be duplicated, modified and queued again,
  * but it won't be processed by the chatplan again.
  * So this copy of the event can be destroyed by the caller.
  */

This is the condition for skipping the default handling:

if (switch_true<https://docs.freeswitch.org/switch__utils_8h.html#a890e4243bd6e31e6c68a83832da023a7>(switch_event_get_header<https://docs.freeswitch.org/group__events.html#ga5c3108ab2e8d73d8ef8e6c41224059aa>(message_event, "final_delivery"))) {
    do_skip = 1;
}



so you need the final_delivery event header. Not sure how you add that in an XML dialplan, or in your implementation.

Maybe the python in github can give you some clues.

and no, stop and all that does not work - It only prevents the chatplan from execing applications. (IIUC)



Cheers

Keith.




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20190810/bcc6a5e9/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 34250 bytes
Desc: image001.png
URL: <http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20190810/bcc6a5e9/attachment-0001.png>


More information about the FreeSWITCH-users mailing list