Lines 53-59
Link Here
|
53 |
{ Q931_PROGRESS, "PROGRESS", { Q931_PROGRESS_INDICATOR } }, |
53 |
{ Q931_PROGRESS, "PROGRESS", { Q931_PROGRESS_INDICATOR } }, |
54 |
{ Q931_SETUP, "SETUP", { Q931_BEARER_CAPABILITY, Q931_CHANNEL_IDENT } }, |
54 |
{ Q931_SETUP, "SETUP", { Q931_BEARER_CAPABILITY, Q931_CHANNEL_IDENT } }, |
55 |
{ Q931_SETUP_ACKNOWLEDGE, "SETUP ACKNOWLEDGE" }, |
55 |
{ Q931_SETUP_ACKNOWLEDGE, "SETUP ACKNOWLEDGE" }, |
56 |
|
56 |
|
57 |
/* Call disestablishment messages */ |
57 |
/* Call disestablishment messages */ |
58 |
{ Q931_DISCONNECT, "DISCONNECT", { Q931_CAUSE } }, |
58 |
{ Q931_DISCONNECT, "DISCONNECT", { Q931_CAUSE } }, |
59 |
{ Q931_RELEASE, "RELEASE" }, |
59 |
{ Q931_RELEASE, "RELEASE" }, |
Lines 2779-2787
Link Here
|
2779 |
return send_message(pri, c, Q931_CALL_PROCEEDING, call_proceeding_ies); |
2779 |
return send_message(pri, c, Q931_CALL_PROCEEDING, call_proceeding_ies); |
2780 |
} |
2780 |
} |
2781 |
#ifndef ALERTING_NO_PROGRESS |
2781 |
#ifndef ALERTING_NO_PROGRESS |
2782 |
static int alerting_ies[] = { Q931_PROGRESS_INDICATOR, Q931_IE_USER_USER, -1 }; |
2782 |
static int alerting_ies[] = { Q931_PROGRESS_INDICATOR, Q931_IE_FACILITY, |
|
|
2783 |
Q931_IE_USER_USER, -1 }; |
2783 |
#else |
2784 |
#else |
2784 |
static int alerting_ies[] = { -1 }; |
2785 |
static int alerting_ies[] = { Q931_IE_FACILITY, -1 }; |
2785 |
#endif |
2786 |
#endif |
2786 |
|
2787 |
|
2787 |
int q931_alerting(struct pri *pri, q931_call *c, int channel, int info) |
2788 |
int q931_alerting(struct pri *pri, q931_call *c, int channel, int info) |
Lines 2797-2806
Link Here
|
2797 |
UPDATE_OURCALLSTATE(pri, c, Q931_CALL_STATE_CALL_RECEIVED); |
2798 |
UPDATE_OURCALLSTATE(pri, c, Q931_CALL_STATE_CALL_RECEIVED); |
2798 |
c->peercallstate = Q931_CALL_STATE_CALL_DELIVERED; |
2799 |
c->peercallstate = Q931_CALL_STATE_CALL_DELIVERED; |
2799 |
c->alive = 1; |
2800 |
c->alive = 1; |
|
|
2801 |
pri_call_add_alerting_apdus(pri, c); |
2800 |
return send_message(pri, c, Q931_ALERTING, alerting_ies); |
2802 |
return send_message(pri, c, Q931_ALERTING, alerting_ies); |
2801 |
} |
2803 |
} |
2802 |
|
2804 |
|
2803 |
static int connect_ies[] = { Q931_CHANNEL_IDENT, Q931_PROGRESS_INDICATOR, -1 }; |
2805 |
static int connect_ies[] = { Q931_CHANNEL_IDENT, Q931_PROGRESS_INDICATOR, |
|
|
2806 |
Q931_IE_FACILITY, -1 }; |
2804 |
|
2807 |
|
2805 |
int q931_setup_ack(struct pri *pri, q931_call *c, int channel, int nonisdn) |
2808 |
int q931_setup_ack(struct pri *pri, q931_call *c, int channel, int nonisdn) |
2806 |
{ |
2809 |
{ |
Lines 2910-2915
Link Here
|
2910 |
c->retranstimer = 0; |
2913 |
c->retranstimer = 0; |
2911 |
if ((c->ourcallstate == Q931_CALL_STATE_CONNECT_REQUEST) && (pri->bri || (!pri->subchannel))) |
2914 |
if ((c->ourcallstate == Q931_CALL_STATE_CONNECT_REQUEST) && (pri->bri || (!pri->subchannel))) |
2912 |
c->retranstimer = pri_schedule_event(pri, pri->timers[PRI_TIMER_T313], pri_connect_timeout, c); |
2915 |
c->retranstimer = pri_schedule_event(pri, pri->timers[PRI_TIMER_T313], pri_connect_timeout, c); |
|
|
2916 |
pri_call_add_connect_apdus(pri, c); |
2913 |
return send_message(pri, c, Q931_CONNECT, connect_ies); |
2917 |
return send_message(pri, c, Q931_CONNECT, connect_ies); |
2914 |
} |
2918 |
} |
2915 |
|
2919 |
|
Lines 2961-2967
Link Here
|
2961 |
return send_message(pri, c, Q931_RESTART, restart_ies); |
2965 |
return send_message(pri, c, Q931_RESTART, restart_ies); |
2962 |
} |
2966 |
} |
2963 |
|
2967 |
|
2964 |
static int disconnect_ies[] = { Q931_CAUSE, Q931_IE_USER_USER, -1 }; |
2968 |
static int disconnect_ies[] = { Q931_CAUSE, Q931_IE_FACILITY, Q931_IE_USER_USER, -1 }; |
2965 |
|
2969 |
|
2966 |
int q931_disconnect(struct pri *pri, q931_call *c, int cause) |
2970 |
int q931_disconnect(struct pri *pri, q931_call *c, int cause) |
2967 |
{ |
2971 |
{ |
Lines 2976-2981
Link Here
|
2976 |
if (c->retranstimer) |
2980 |
if (c->retranstimer) |
2977 |
pri_schedule_del(pri, c->retranstimer); |
2981 |
pri_schedule_del(pri, c->retranstimer); |
2978 |
c->retranstimer = pri_schedule_event(pri, pri->timers[PRI_TIMER_T305], pri_disconnect_timeout, c); |
2982 |
c->retranstimer = pri_schedule_event(pri, pri->timers[PRI_TIMER_T305], pri_disconnect_timeout, c); |
|
|
2983 |
if (cause == PRI_CAUSE_USER_BUSY) |
2984 |
pri_call_add_busy_apdus(pri, c); |
2979 |
return send_message(pri, c, Q931_DISCONNECT, disconnect_ies); |
2985 |
return send_message(pri, c, Q931_DISCONNECT, disconnect_ies); |
2980 |
} else |
2986 |
} else |
2981 |
return 0; |
2987 |
return 0; |
Lines 3292-3297
Link Here
|
3292 |
c->callerpres = -1; |
3298 |
c->callerpres = -1; |
3293 |
c->callernum[0] = '\0'; |
3299 |
c->callernum[0] = '\0'; |
3294 |
c->callednum[0] = '\0'; |
3300 |
c->callednum[0] = '\0'; |
|
|
3301 |
c->calledname[0] = '\0'; |
3295 |
c->callername[0] = '\0'; |
3302 |
c->callername[0] = '\0'; |
3296 |
c->callerani[0] = '\0'; |
3303 |
c->callerani[0] = '\0'; |
3297 |
c->callerplanani = -1; |
3304 |
c->callerplanani = -1; |
Lines 3556-3561
Link Here
|
3556 |
pri->ev.ringing.progressmask = c->progressmask; |
3563 |
pri->ev.ringing.progressmask = c->progressmask; |
3557 |
libpri_copy_string(pri->ev.ringing.useruserinfo, c->useruserinfo, sizeof(pri->ev.ringing.useruserinfo)); |
3564 |
libpri_copy_string(pri->ev.ringing.useruserinfo, c->useruserinfo, sizeof(pri->ev.ringing.useruserinfo)); |
3558 |
c->useruserinfo[0] = '\0'; |
3565 |
c->useruserinfo[0] = '\0'; |
|
|
3566 |
libpri_copy_string(pri->ev.ringing.calledname, c->calledname, sizeof(pri->ev.ringing.calledname)); |
3567 |
c->calledname[0] = '\0'; |
3559 |
|
3568 |
|
3560 |
cur = c->apdus; |
3569 |
cur = c->apdus; |
3561 |
while (cur) { |
3570 |
while (cur) { |
Lines 3586-3591
Link Here
|
3586 |
pri->ev.answer.progressmask = c->progressmask; |
3595 |
pri->ev.answer.progressmask = c->progressmask; |
3587 |
libpri_copy_string(pri->ev.answer.useruserinfo, c->useruserinfo, sizeof(pri->ev.answer.useruserinfo)); |
3596 |
libpri_copy_string(pri->ev.answer.useruserinfo, c->useruserinfo, sizeof(pri->ev.answer.useruserinfo)); |
3588 |
c->useruserinfo[0] = '\0'; |
3597 |
c->useruserinfo[0] = '\0'; |
|
|
3598 |
libpri_copy_string(pri->ev.answer.calledname, c->calledname, sizeof(pri->ev.answer.calledname)); |
3599 |
c->calledname[0] = '\0'; |
3589 |
q931_connect_acknowledge(pri, c); |
3600 |
q931_connect_acknowledge(pri, c); |
3590 |
if (c->justsignalling) { /* Make sure WE release when we initiatie a signalling only connection */ |
3601 |
if (c->justsignalling) { /* Make sure WE release when we initiatie a signalling only connection */ |
3591 |
q931_release(pri, c, PRI_CAUSE_NORMAL_CLEARING); |
3602 |
q931_release(pri, c, PRI_CAUSE_NORMAL_CLEARING); |
Lines 3752-3757
Link Here
|
3752 |
pri->ev.hangup.aoc_units = c->aoc_units; |
3763 |
pri->ev.hangup.aoc_units = c->aoc_units; |
3753 |
libpri_copy_string(pri->ev.hangup.useruserinfo, c->useruserinfo, sizeof(pri->ev.hangup.useruserinfo)); |
3764 |
libpri_copy_string(pri->ev.hangup.useruserinfo, c->useruserinfo, sizeof(pri->ev.hangup.useruserinfo)); |
3754 |
c->useruserinfo[0] = '\0'; |
3765 |
c->useruserinfo[0] = '\0'; |
|
|
3766 |
pri->ev.hangup.calledname[0] = '\0'; |
3755 |
/* Don't send release complete if they send us release |
3767 |
/* Don't send release complete if they send us release |
3756 |
while we sent it, assume a NULL state */ |
3768 |
while we sent it, assume a NULL state */ |
3757 |
if (c->newcall) |
3769 |
if (c->newcall) |
Lines 3786-3791
Link Here
|
3786 |
pri->ev.hangup.aoc_units = c->aoc_units; |
3798 |
pri->ev.hangup.aoc_units = c->aoc_units; |
3787 |
libpri_copy_string(pri->ev.hangup.useruserinfo, c->useruserinfo, sizeof(pri->ev.hangup.useruserinfo)); |
3799 |
libpri_copy_string(pri->ev.hangup.useruserinfo, c->useruserinfo, sizeof(pri->ev.hangup.useruserinfo)); |
3788 |
c->useruserinfo[0] = '\0'; |
3800 |
c->useruserinfo[0] = '\0'; |
|
|
3801 |
libpri_copy_string(pri->ev.hangup.calledname, c->calledname, sizeof(pri->ev.hangup.calledname)); |
3802 |
c->calledname[0] = '\0'; |
3789 |
if (c->alive) |
3803 |
if (c->alive) |
3790 |
return Q931_RES_HAVEEVENT; |
3804 |
return Q931_RES_HAVEEVENT; |
3791 |
else |
3805 |
else |