Loading ...
Sorry, an error occurred while loading the content.

outbound call scripts

Expand Messages
  • jamesbrandhurst
    Hi - Am hoping someone can help...I am trying to configure twinkle so that the ring duration of an outbound call is restricted to say 30 seconds and then
    Message 1 of 4 , Aug 1, 2011
    View Source
    • 0 Attachment
      Hi - Am hoping someone can help...I am trying to configure twinkle so that the ring duration of an outbound call is restricted to say 30 seconds and then automatically disconnects if the line hasn't been answered.

      As I'm no programming expert I have got as far as identifying that this could be done using a combination of "outbound" and "outbound-answered" twinkle scripts. Any help would be appreciated.
    • joerg
      you may want to create a script file myTwinkle30s like #!/bin/sh # write own ID to a defined place echo $$ /tmp/twinkle-killcall_line${TWINKLE_LINE} sleep 30
      Message 2 of 4 , Aug 1, 2011
      View Source
      • 0 Attachment
        you may want to create a script file myTwinkle30s like

        #!/bin/sh
        # write own ID to a defined place
        echo $$ >/tmp/twinkle-killcall_line${TWINKLE_LINE}
        sleep 30
        #tell twinkle to send a CANCEL, aka stop the INVITE
        twinkle --immediate --cmd "line ${TWINKLE_LINE}"
        twinkle --immediate --cmd bye


        and start this in Outgoing call script:

        #!/bin/sh
        # start the independent waiting script
        myTwinkle30s &


        in both Outgoing call answered and Outgoing call failed scripts (of course you
        may link both script hooks to same file ;-D), you do

        #!/bin/sh
        # kill the myTwinkle30s process for this line, by
        # getting PID from the "defined place"
        kill $(cat /tmp/twinkle-killcall_line${TWINKLE_LINE})


        the above is a draft and not tested or thoroughly checked for typos and
        mistakes, but should give you an idea how this could get implemented. Hope it
        may be useful

        cheers
        jOERG
      • joerg
        ... interesting problem anyway I guess you wouldn t want to switch a established call to hold without any warning. So I can t see an easy solution. I ll ponder
        Message 3 of 4 , Aug 1, 2011
        View Source
        • 0 Attachment
          >thank you Joerg...that is really appreciated....I shall give it a go at
          > installing shortly...but I follow your approach.
          >
          >Just a question you may also know the answer to. I have a script which calls
          > twinkle for any sip: urls.
          >
          >twinkle --immediate --call $1
          >
          >I use the --immediate so as to avoid having the dialler popup box which
          > appears, however when i use this and there is an inbound call on line1 it
          > doesn't dial. Is there a way of making it attempt to dial on line 2 (if
          > line 1 is busy)?
          >
          >
          >thanks

          interesting problem
          anyway I guess you wouldn't want to switch a established call to hold without
          any warning. So I can't see an easy solution.

          I'll ponder a bit about it.

          You are aware you can switch lines just like I suggested in last mail? Does
          the problem also occur when you put the call to hold manually before trying
          the cli cmd dialing? (sorry I have no working twinkle installation here atm,
          so can't check those things myself)

          /j
        • joerg
          well, obviously you could set a file variable with e.g. the line number to use for dialing out, and adjust this file s content on every Inbound call and revert
          Message 4 of 4 , Aug 2, 2011
          View Source
          • 0 Attachment
            well, obviously you could set a file variable with e.g. the line number to use
            for dialing out, and adjust this file's content on every Inbound call and
            revert on Call end and Call cancelled

            But it seems way simpler you'd generally use line2 for outbound calls.

            /j
          Your message has been successfully submitted and would be delivered to recipients shortly.