Fixed call forwarding after no response. Instread of dialing the old extension
authorAndreas Eversberg <jolly@eversberg.eu>
Mon, 14 Jun 2010 16:32:15 +0000 (18:32 +0200)
committerAndreas Eversberg <jolly@eversberg.eu>
Mon, 14 Jun 2010 16:32:15 +0000 (18:32 +0200)
again, the forwarding number is dialed after timeout.

modified:   apppbx.cpp
modified:   apppbx.h
modified:   socket_server.c

apppbx.cpp
apppbx.h
socket_server.c

index 090fcff..b60c2c7 100644 (file)
@@ -829,7 +829,7 @@ foundif:
  * ports will be created and a setup is sent if everything is ok. otherwhise
  * the endpoint is destroyed.
  */
  * ports will be created and a setup is sent if everything is ok. otherwhise
  * the endpoint is destroyed.
  */
-void EndpointAppPBX::out_setup(void)
+void EndpointAppPBX::out_setup(int cfnr)
 {
        struct dialing_info     dialinginfo;
        class Port              *port;
 {
        struct dialing_info     dialinginfo;
        class Port              *port;
@@ -938,7 +938,7 @@ void EndpointAppPBX::out_setup(void)
                p = e_ext.cfnr;
                if (*p) {
                        /* when cfnr is done, out_setup() will setup the call */
                p = e_ext.cfnr;
                if (*p) {
                        /* when cfnr is done, out_setup() will setup the call */
-                       if (e_cfnr_call_timeout.active) {
+                       if (cfnr) {
                                /* present to forwarded party */
                                if (e_ext.anon_ignore && e_callerinfo.id[0]) {
                                        e_callerinfo.present = INFO_PRESENT_ALLOWED;
                                /* present to forwarded party */
                                if (e_ext.anon_ignore && e_callerinfo.id[0]) {
                                        e_callerinfo.present = INFO_PRESENT_ALLOWED;
@@ -1303,7 +1303,7 @@ int redial_timeout(struct lcr_timer *timer, void *instance, int index)
 
        ea->new_state(EPOINT_STATE_OUT_SETUP);
        /* call special setup routine */
 
        ea->new_state(EPOINT_STATE_OUT_SETUP);
        /* call special setup routine */
-       ea->out_setup();
+       ea->out_setup(0);
 
        return 0;
 }
 
        return 0;
 }
@@ -1362,7 +1362,7 @@ int cfnr_call_timeout(struct lcr_timer *timer, void *instance, int index)
        class EndpointAppPBX *ea = (class EndpointAppPBX *)instance;
 
        PDEBUG(DEBUG_EPOINT, "EPOINT(%d) call-forward-busy time has expired, calling the forwarded number: %s.\n", ea->ea_endpoint->ep_serial, ea->e_ext.cfnr);
        class EndpointAppPBX *ea = (class EndpointAppPBX *)instance;
 
        PDEBUG(DEBUG_EPOINT, "EPOINT(%d) call-forward-busy time has expired, calling the forwarded number: %s.\n", ea->ea_endpoint->ep_serial, ea->e_ext.cfnr);
-       ea->out_setup();
+       ea->out_setup(1);
 
        return 0;
 }
 
        return 0;
 }
@@ -1375,7 +1375,7 @@ int callback_timeout(struct lcr_timer *timer, void *instance, int index)
                /* epoint is idle, check callback */
                PDEBUG(DEBUG_EPOINT, "EPOINT(%d) starting callback.\n", ea->ea_endpoint->ep_serial);
                ea->new_state(EPOINT_STATE_OUT_SETUP);
                /* epoint is idle, check callback */
                PDEBUG(DEBUG_EPOINT, "EPOINT(%d) starting callback.\n", ea->ea_endpoint->ep_serial);
                ea->new_state(EPOINT_STATE_OUT_SETUP);
-               ea->out_setup();
+               ea->out_setup(0);
        }
 
        return 0;
        }
 
        return 0;
@@ -3147,7 +3147,7 @@ void EndpointAppPBX::join_setup(struct port_list *portlist, int message_type, un
 
        new_state(EPOINT_STATE_OUT_SETUP);
        /* call special setup routine */
 
        new_state(EPOINT_STATE_OUT_SETUP);
        /* call special setup routine */
-       out_setup();
+       out_setup(0);
 }
 
 /* join MESSAGE_mISDNSIGNAL */
 }
 
 /* join MESSAGE_mISDNSIGNAL */
index a2608cc..ad0b6da 100644 (file)
--- a/apppbx.h
+++ b/apppbx.h
@@ -229,7 +229,7 @@ class EndpointAppPBX : public EndpointApp
        void notify_active(void);
        void keypad_function(char digit);
        void set_tone(struct port_list *portlist, const char *tone);
        void notify_active(void);
        void keypad_function(char digit);
        void set_tone(struct port_list *portlist, const char *tone);
-       void out_setup(void);
+       void out_setup(int cfnr);
        struct mISDNport *hunt_port(char *ifname, int *channel);
        char *apply_callerid_display(const char *id, int itype, int ntype, int present, int screen, const char *extension, const char *name);
        void auth(int job, int bit_num);
        struct mISDNport *hunt_port(char *ifname, int *channel);
        char *apply_callerid_display(const char *id, int itype, int ntype, int present, int screen, const char *extension, const char *name);
        void auth(int job, int bit_num);
index 1e6d5da..f881b85 100644 (file)
@@ -530,7 +530,7 @@ int admin_call(struct admin_list *admin, struct admin_message *msg)
        apppbx->e_dialinginfo.sending_complete = 1;
 
        apppbx->new_state(PORT_STATE_OUT_SETUP);
        apppbx->e_dialinginfo.sending_complete = 1;
 
        apppbx->new_state(PORT_STATE_OUT_SETUP);
-       apppbx->out_setup();
+       apppbx->out_setup(0);
        return(0);
 }
 
        return(0);
 }